How to install PhoneGap and Start Guide?

Here you go ( http://phonegap.com/start ). Here its detailed enough how to install and start guide of phonegap for all platforms. I choose Android platform. Here I’m going to talk about the issues i faced when setup a new project. I followed exactly the steps said by them but when I run the application it shows below errors:

Unknown chromium error: -6
DroidGap: GapViewClient.onReceivedError: Error code=-1 Description=A network error occurred. URL=file:///android_asset/www/index.html

Goggled, a few people faced the same problem and they given solution to fix this issue, they are:

1) add super.init() before loadurl();
2) add super.setIntegerProperty(“loadUrlTimeoutValue”, sometimevalue); 

will be like this:

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
super.init();
super.setIntegerProperty(“loadUrlTimeoutValue”, 6000);
super.loadUrl(“file:///android_asset/www/index.html”);
}

Now my code has those lines. I hoped after adding those lines my app works. I run my app, unlucky faced the same problem. So something is missing or doing wrong. After 2 hours, found that there is a extra space at beginning  of file name in”  index.html”.  I removed the space now it works 🙂

Whenever you are facing this problem first check the file name conversion is correct and then add above two lines(blue color) in your code.

 

 

Advertisements

About androiddummies

Android Learner and Developer

Posted on January 17, 2012, in PhoneGap and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: