This is a migrated thread and some comments may be shown as answers.

Android App will not POST via AJAX

6 Answers 204 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marcelo
Top achievements
Rank 1
Marcelo asked on 27 Jan 2014, 06:11 PM
Hello,

I was automatically upgraded from Icenium Graphite (Windows 7) to AppBuilder today. Now, when I try to launch my Android app on device for testing (local USB connection) my ajax requests made with plain-ol Jquery are failing. I used the experimental debugger so I could see what was going on in the device and I get a 404 error when executing the XHR call (which I use for logging into my app).

I tested the exact same thing on the AppBuilder "Simulator" on desktop and on an iPhone device and it works fine. What is going on with my Android device? I am using Nexus 5 purchased directly form Google. Unfortunately, I have not been able to test on another Android device yet, but I strongly suspect this bug has something to do with the transition from Icenium to AppBuilder since things were working perfectly on Friday (when I last touched the app code).

Anyone else experiencing issues with and built and deployed for testing on Android???

Cheers,

Marcelo

6 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 28 Jan 2014, 02:51 PM
Hi Marcelo,

Actually it sounds like you've hit a Cordova breaking change that was introduced in Icenium (now AppBuilder) as part of its previous release, namely:

Apache Cordova 3.1 introduces unified whitelist for Android. To reflect this change, the declaration of the whitelisting rules in the Android config.xml template in Icenium is changed to <access origin="*"/>.
If you have existing projects in which you have already manually modified Android config.xml, you might need to manually change the whitelisting rules declaration to <access origin="*"/>.


Please note that you should also rebuild and redeploy your app to the Nexus after this change. Let me know the name of your app if the problem persists.

Regards,
Steve
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Marcelo
Top achievements
Rank 1
answered on 28 Jan 2014, 02:55 PM
Indeed. That did it :-)

Thanks.
0
Josef
Top achievements
Rank 1
answered on 30 Sep 2014, 04:26 PM
This is not working for me. Any ideas?
0
Tsvetina
Telerik team
answered on 03 Oct 2014, 02:20 PM
Hello Josef,

I am posting a link to the forum thread where my colleague addressed your question about this scenario, in case anyone else experiences this problem and the suggestion from our previous post does not help. 
$.ajax Not working on android devices

If you still cannot resolve the problem, please post either in the other forum thread or in the support ticket that you have opened and we will provide further assistance.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Rehana
Top achievements
Rank 1
answered on 28 Oct 2015, 06:26 AM

Dear Team,

 

I have been developing an application in appbuilder. But it always fails the ajax. ajax calls are not working. I have all the rights on the server. these calls works fine in the appbuilder. but when i deploy the application on android or any device, my ajax fails. please help as i am in the middle of my application.

 

Regards,

Rehana Baloch

0
Tsvetina
Telerik team
answered on 29 Oct 2015, 03:45 PM
Hello Hanna,

Can you confirm that you have enabled the INTERNET permission in your project's Android settings:
Project Properties for Android Devices

Without it, your app won't have access to the device's internet connection.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Report a bug
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Steve
Telerik team
Marcelo
Top achievements
Rank 1
Josef
Top achievements
Rank 1
Tsvetina
Telerik team
Rehana
Top achievements
Rank 1
Share this question
or