Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
17060 Discussions

Failed to fetch url

Szymon_P_
Novice
1,570 Views

Hello,

My code is:

intel.xdk.device.getRemoteData(app.url + 'some/url',"POST","some=data","success","error");

It works great in emulate tab, but if I build crosswalk for android or just android it doesnt work.

I've tried export app to chrome and check it console. This is what i get:

Uncaught ReferenceError: intel is not defined

Legacy hybrid mobile app build -> Android make a build with this works, but resolution is too high and I cant see anything except a data is downloaded from external server successfully.

 

EDIT

I've fixed this js error by changing 

$(function(){
myFetchFunc();
});

to:

document.addEventListener("intel.xdk.device.ready",function(){
 myFetchFunc();
},false); 

But fetching data from url is still broken in build. Works great in emulating and usb debug... 

 

0 Kudos
1 Solution
Szymon_P_
Novice
1,570 Views

After few hours of debugging

I have made AWFUL hack but it works

* {
font-size: 50px !important;
}

With legacy android build

This is app only for my own use, so I could do that, because it doesn't look well now.

The same code but builded with crosswalk doesn't work.

View solution in original post

0 Kudos
6 Replies
Szymon_P_
Novice
1,571 Views

After few hours of debugging

I have made AWFUL hack but it works

* {
font-size: 50px !important;
}

With legacy android build

This is app only for my own use, so I could do that, because it doesn't look well now.

The same code but builded with crosswalk doesn't work.

0 Kudos
Pamela_H_Intel
Moderator
1,570 Views

Szymon,

Perhaps you have not specified a needed plugin for the build (core plugins are automatically included in the emulator and Debug features, but not in builds). See forum thread 561120.

Pamela

0 Kudos
PaulF_IntelCorp
Employee
1,570 Views

I'm guessing that you might be getting hit by the white list (domain access) gremlin -- see the white list doc on this page: https://software.intel.com/en-us/xdk/docs/xdk-doc-quick-links

0 Kudos
Szymon_P_
Novice
1,570 Views

Paul Fischer (Intel) wrote:

I'm guessing that you might be getting hit by the white list (domain access) gremlin -- see the white list doc on this page: https://software.intel.com/en-us/xdk/docs/xdk-doc-quick-links

Thanks, I have created new rule:
http://* + external
It didn't work.

 

0 Kudos
Pamela_H_Intel
Moderator
1,569 Views

Szymon,

You do want to use the Crosswalk for Android build. Your app does work with Crosswalk - that is what USB debug uses. Perhaps there is an App Version Code issue. Try uninstalling the app from your device and then install the Crosswalk build.

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
1,570 Views

If you have included JQuery, you can use something like that:

    $.ajax({
        type: "POST",
        url: "http://xxxxxxxxxxxxxxxxxxxxxxxx",
        data: wpost,
        success: function(retorno) {funFuncao(retorno);},
        dataType: 'json'
    });

 

I used this with Cordova Android/iOS

 

0 Kudos
Reply