problem with some asset loading after using phone gap build

  • 1
  • Question
  • Updated 8 years ago
Hi;
Hi a developed a mobile web app using Sencha Touch. the app is pertty simple and does not require any phonegap special features. the app working fine on IOS safari and galaxy S android browser. I have succesfully compiled an APK file (signed with a keystore) from the web app. I have also installed it on the galaxy S with no problems.

the thing is, it looks like some assets (images/json) are not loaded to the phone. I was wondering what I was missing because it has to be something simple.
for example: my index.html has an image 'src="/mobile/img/logo.png"' that is not loaded to the app but from the web its ok.

any ideas? it has to be something simple that I am missing or something I dont understand that is different when compiling the app.
thanks
Photo of bitwave

bitwave

  • 10 Posts
  • 0 Reply Likes
  • frustrated

Posted 9 years ago

  • 1
Photo of bitwave

bitwave

  • 10 Posts
  • 0 Reply Likes
update;
here are somethingsI thought of that might help analyze this:
1. the certificate I signed the keystore with is a self signed certificate generated with Java's KeyTool. (so its not known by a trusted CA)
2. could it be that the phone does not allow me to open network connections? (note that when installing the app I am prompt with a list of features, such as location based, network connectivity etc, and I was required to approve them as a part of the installation process - and I approved them).

thats it.
many thanks for your help
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
It sounds like a pathing issue. If you want to access files on the device, use a relative path: "mobile/img/logo.png" rather than "/mobile/img/logo.png." If you want to access files from your server, make sure to use an absolute path: "http://google.com/logo.png"
Photo of bitwave

bitwave

  • 10 Posts
  • 0 Reply Likes
Great thanks
Will check it and let u know
Photo of bitwave

bitwave

  • 10 Posts
  • 0 Reply Likes
checked it and was a pathing issue. thanks
Photo of joel

joel

  • 1 Post
  • 0 Reply Likes
This got me, too. I'd put this in the FAQ, since I'll be it's a common first-time-user issue.