Web page not showing on android apk

I am using phonegap to basically allow me to create a web page that looks like an app, and the page is fine in the native browser on Android, works fine in the emulator, but when it comes to the app (which is the same resolution as the emulator) there is just a white blank page.

Any ideas?

I installed apk before and uninstalled it .. maybe it has something to do with this?

+3


source to share


1 answer


Make sure your activity doesn't have:

setContentView(R.layout.activity_main);

      

Perhaps your layout is empty and this line still exists along with:

super.loadUrl("file:///android_asset/www/dummy.html");

      

You can also include config.xml file in / res / xml folder (/res/xml/config.xml)



Here's a basic example:

<?xml version="1.0" encoding="utf-8"?>
<cordova>
<access origin="http://127.0.0.1*"/> <!-- allow local pages -->

<log level="DEBUG"/>
<preference name="useBrowserHistory" value="true" />
<preference name="exit-on-suspend" value="false" />
  <plugins>
     <plugin name="App" value="org.apache.cordova.App"/>
     <plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser"/>     
  </plugins>
</cordova>

      

I had similar problems when I first started experimenting with telephony. Also, make sure cordova-2.2..jar is in your libs folder and it's also listed in your build path.

Hope it helps.

0


source







All Articles