Android App will not POST via AJAX

7 posts, 1 answers
  1. Marcelo
    Marcelo avatar
    9 posts
    Member since:
    Oct 2013

    Posted 27 Jan 2014 Link to this post

    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
  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 28 Jan 2014 Link to this post

    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.

  3. Marcelo
    Marcelo avatar
    9 posts
    Member since:
    Oct 2013

    Posted 28 Jan 2014 Link to this post

    Indeed. That did it :-)

    Thanks.
  4. Josef
    Josef avatar
    3 posts
    Member since:
    Jul 2013

    Posted 30 Sep 2014 Link to this post

    This is not working for me. Any ideas?
  5. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 03 Oct 2014 Link to this post

    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.

     
  6. Rehana
    Rehana avatar
    4 posts
    Member since:
    Oct 2011

    Posted 28 Oct 2015 Link to this post

    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

  7. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 29 Oct 2015 Link to this post

    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.

     
Back to Top