I have done everything as mentioned here: http://docs.drupalgap.org/7/Compiling_a_Mobile_Application/Preparing_Pho... and have made sure all my Cordova dependencies have been met, but I cannot get past the splash screen on my Andriod Device. Everything works fine as a web-app, however, when I compile it to run on my mobile device, it just loads the splash screen on the mobile and just stays there.

I have no error messages, I have got just a basic vanilla D7 site (up-to-date) and the bare minimum modules to get DrupalGap working. I'm not sure what could be going wrong. I put alert messages in the drupalgap_onload() function in 'ExampleApp/www/bin/drupalgap.js' file but the alerts are not happening. Not sure how to debug this and which file to modify to step through to find the issue.

Any help, would be appreciated. Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shabana.navas created an issue. See original summary.

shabana.navas’s picture

Title: DrupalGap Stuck on Splash Screen » DrupalGap Stuck on Splash Screen on Android
tyler.frankenstein’s picture

Status: Active » Postponed (maintainer needs more info)

Did you copy the cordova.js file to your project's www folder from the platform_www folder and then include it in the index.html file and set the mode in settings.js to phonegap?

shabana.navas’s picture

I think Drupal.settings.site_path might be the issue. I'm using Acquia Dev Desktop and the path that my vanilla Drupal site is on is: http://drupal-7.dd:8089. So, Drupal.settings.site_path = 'http://drupal-7.dd:8089';

When I changed that to just 'http://www.example.com', I am now getting the loading icon. So, perhaps it's not liking the path to my local?

Yes, cordova.js is there and settings.js in www/app folder was changed to load 'phonegap' and index.html in www/ was changed to include the code to load cordova.js.

shabana.navas’s picture

Status: Postponed (maintainer needs more info) » Active
shabana.navas’s picture

Well, I tried setting the site up on Wamp and had the same issues, where if the site_path was referring to localhost, it just got stuck on the splash screen. If I change it to like http://drupalgap.org, it loads the drupalgap.org app just fine on my android phone, ruling out anything related to the way I installed cordova, the DrupalGap SDK, and Phonegap.

For Wamp, the site path was http://localhost/drupal-7. I tried changing it to http://127.0.0.1/drupal-7, but same result.

So, what I did was, I created the same vanilla site on Pantheon and changed the site path to point to the new Pantheon url. That also worked. So, basically, I am kind of half relieved that I could get something working and at least test my changes via the Pantheon site. Just, wondering why it won't load the app if the link points to localhost, though.

tyler.frankenstein’s picture

Status: Active » Postponed (maintainer needs more info)

Think about it like this, can you open your mobile phone and access the localhost that is available on your laptop? No (well you can, but it takes some network configuration / firewall settings / etc).

When developing applications (especially when it is time to compile onto an actual device), my Drupal site is always up on the Internet, that way it is accessible to everyone. If I am exclusively developing on localhost, then I'll only develop web applications. But when it comes time to compile the app, I move the site up to the Internet, that way my device has access to it.

shabana.navas’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

You are absolutely right. I actually had an air-head of a moment there (I swear, normally, I really am not this stupid!!). I was thinking while my mobile was connected via USB, that Apache Cordova would be able to connect to my localhost, some how. The enlightenment only hit me a day later. I was just going to close this issue with a similar comment, that's when I saw your reply. Thanks for clearing it up. Appreciate it.

rahulbaisanemca’s picture

Issue : i have follow all steps given on drupalgap
then also my drupalGap stuck on splash screen of android emulator.

But Thanks to @tyler.frankenstein and @shabana.navas
this conversation help me, specially @tyler.frankenstein's comment #7
This comment clear my doubt, based on this conversation i have made changes in site_path.

Previously :Drupal.settings.site_path = 'http://localhost/drupal7gap';
image: drupalGap_stuck_on_splash_screen_on_android.png
After reading this comment i changed "localhost" with my ip_address Drupal.settings.site_path = 'http://192.xxx.x.xx/drupal7gap';
image:drupal_gap_on_android_emulator.png
and this solved my issue, now i can be able to see my drupalgap instance on android emulator.