Software Archive
Read-only legacy content
17060 Discussions

App works fine on Emulator but shows blank screen on the app preview or installed APK

Andrew_D_2
Beginner
832 Views

Hi Guys,

So this is my first forum post for Intel XDK! :)

I am a little stuck with my application (Let me just say that I am not that pro with Intel XDK and I might be doing something silly as to why my application isn't working).

I am building a simple weather application using google maps API and Forecast.io, the application just gets your current position and returns the results found such as current, 7 day forecast and more in detail weather data.

I have used Html, CSS and JQuery for the application. The application is running perfect on the Intel XDK emulator (Any platform - 100% no errors), however when I try to test it on a device via App preview or install the APK it just shows a blank screen?

  • I thought maybe the issue would be with the devices used for testing that it couldn't pick up the devices GPS so I set the GPS to a static value for testing reasons and still the same, the screen just shows blank. 
  • I tried to set the minimum required android/iOS version (Devices used for testing is an Asus Fonepad and an Iphone 5 - running latest OS)
  • For what it's worth I have included the latest JQuery.js file, external js library for icons and coded my own js file to handle the GPS geolocation and forecast using JSON. As mentioned above it does work on the emu 100% :)
     

I appreciate any feedback or suggestions, please let me know if I must post my code for you guys to double check.

0 Kudos
3 Replies
PaulF_IntelCorp
Employee
832 Views

Hello Andrew -- I'm guessing that your app is hung up trying to retrieve a Google Map over the device network interface. Please read this doc regarding the limitations of the Emulate tab > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#EmulateTab and see the rest of that page for a variety of suggestions regarding how to debug your app on a real device. Also, check this documentation regarding the domain white list feature in the Build Settings on the Projects tab > http://cordova.apache.org/docs/en/4.0.0/guide_appdev_whitelist_index.md.html#Whitelist%20Guide

0 Kudos
Andrew_D_2
Beginner
832 Views

Please see code below. This is what is causing the white screen when trying to run on a mobile device, I have used static values and then the application works fine, I did copy this code from the example, however as mentioned it works on the emu but not on an actual device, any ideas? I just put the intel alert inside the success function to see if the success function runs with the returned results.
 

var getLocation = function() 
{
    var suc = function(p){
        alert("geolocation success");
        if (p.coords.latitude != undefined)
        {
            currentLatitude = p.coords.latitude;
            currentLongitude = p.coords.longitude;
            intel.xdk.notification.alert("CO-ORDS"+ currentLongitude + " " + currentLatitude);
        }

    };
    var fail = function(){ 
        alert("geolocation failed"); 
        getLocation();
    };

    intel.xdk.geolocation.getCurrentPosition(suc,fail);
}
    getLocation();

 

0 Kudos
PaulF_IntelCorp
Employee
832 Views

I'm guessing that it is hanging on an undefined intel.xdk object because you probably do not have the intelxdk.js file included as a script in your index.html file (the intel.xdk functions are included automatically in the Emulate tab and inside the App Preview apps, because they must be pre-configured).

We are moving away from these intel.xdk APIs, as the bulk of them are based on very early implementations of PhoneGap and are obsolete. We encourage you to use the Cordova equivalents.

0 Kudos
Reply