<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hello Swati: in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015013#M35643</link>
    <description>Hello Swati:

First of all thank you for your response.
I have sent you a message with the files you request.

Best regards,
Miguel Angel</description>
    <pubDate>Wed, 08 Apr 2015 16:47:59 GMT</pubDate>
    <dc:creator>Miguel_Ángel_M_</dc:creator>
    <dc:date>2015-04-08T16:47:59Z</dc:date>
    <item>
      <title>Ajax call in Android return no response when build App (test works fine)</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015011#M35641</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I'm developing a mobile app that need to consume ajax/json web services.&lt;/P&gt;

&lt;P&gt;The application works fine when I test in Intel XDK enviroment and in Intel App Preview android app, but when I build the application an install it in the device and error ocurr. I test in Galaxy S2 (Android 4.1.2) and the response status was 0 and S5 (Android 5.0) and the response was 404 (not found).&lt;/P&gt;

&lt;P&gt;I don't know if this affects, but recently the IntelXDK enviroment updated to version 1878 (I think but not sure that before the update I can consume cross domain webservices, is it possible?).&lt;/P&gt;

&lt;P&gt;I search for the solution several days and test different codes but the error persist. Finally I create a basic application from XDK to try solve the problem but with no result. This is my test code (extract from the Intel XDK article &lt;A href="https://software.intel.com/en-us/xdk/docs/how-to-access-JSON-data-in-HTML5-apps):" target="_blank"&gt;https://software.intel.com/en-us/xdk/docs/how-to-access-JSON-data-in-HTML5-apps):&lt;/A&gt;&lt;/P&gt;

&lt;PRE class="brush:xml;"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Blank Cordova App Project Template&amp;lt;/title&amp;gt;
    &amp;lt;meta http-equiv="Content-type" content="text/html; charset=utf-8"&amp;gt;
    &amp;lt;script src="intelxdk.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="xhr.js"&amp;gt;&amp;lt;/script&amp;gt;       
    &amp;lt;script src="cordova.js" id="xdkJScordova_"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="js/app.js"&amp;gt;&amp;lt;/script&amp;gt;           &amp;lt;!-- for your event code, see README and file comments for details --&amp;gt;
    &amp;lt;script src="js/init-app.js"&amp;gt;&amp;lt;/script&amp;gt;      &amp;lt;!-- for your init code, see README and file comments for details --&amp;gt;
    &amp;lt;script src="xdk/init-dev.js"&amp;gt;&amp;lt;/script&amp;gt;     &amp;lt;!-- normalizes device and document ready events, see file for details --&amp;gt;    
    &amp;lt;script src="scripts/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;     
    
    &amp;lt;script&amp;gt;
        function transferFailed(e) {
            alert("Error:"+e.target.status);
        }
        function callJsonWS(){           
            $.getJSON("http://time.jsontest.com", function(data){
                alert(data);
            });       
        }
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body onload="callJsonWS()"&amp;gt;
    &amp;lt;h1 class="align-center"&amp;gt;A Blank Project Template&amp;lt;/h1&amp;gt;
&amp;lt;/body&amp;gt;    
&amp;lt;/html&amp;gt;&lt;/PRE&gt;

&lt;P&gt;The result of the code below is no response when I install the app in the Android device.&lt;/P&gt;

&lt;P&gt;Sorry for my english and thank you in advance.&lt;/P&gt;

&lt;P&gt;Miguel Ángel&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 11:53:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015011#M35641</guid>
      <dc:creator>Miguel_Ángel_M_</dc:creator>
      <dc:date>2015-04-08T11:53:07Z</dc:date>
    </item>
    <item>
      <title>Hello Miguel,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015012#M35642</link>
      <description>&lt;P&gt;Hello Miguel,&lt;/P&gt;

&lt;P&gt;Please send your whole project in a zip file and also .apk separately. You can PM me your app.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:59:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015012#M35642</guid>
      <dc:creator>Swati_S_Intel1</dc:creator>
      <dc:date>2015-04-08T14:59:17Z</dc:date>
    </item>
    <item>
      <title>Hello Swati:</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015013#M35643</link>
      <description>Hello Swati:

First of all thank you for your response.
I have sent you a message with the files you request.

Best regards,
Miguel Angel</description>
      <pubDate>Wed, 08 Apr 2015 16:47:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015013#M35643</guid>
      <dc:creator>Miguel_Ángel_M_</dc:creator>
      <dc:date>2015-04-08T16:47:59Z</dc:date>
    </item>
    <item>
      <title>Hi Miguel,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015014#M35644</link>
      <description>&lt;P&gt;Hi Miguel,&lt;/P&gt;

&lt;P&gt;The project you sent me doesn't work, neither on emulator nor App Preview. Please find this attached sample ajax code and see if it works for you.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 18:22:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015014#M35644</guid>
      <dc:creator>Swati_S_Intel1</dc:creator>
      <dc:date>2015-04-08T18:22:44Z</dc:date>
    </item>
    <item>
      <title>Hi Swati,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015015#M35645</link>
      <description>&lt;P&gt;Hi Swati,&lt;/P&gt;

&lt;P&gt;I test my code again and it works on the emulator. I have tested in XDK 1878 and Motorola Droid as emulator. The application only makes a call on body load and show and alert.&lt;/P&gt;

&lt;P&gt;The good news are that your sample code works for me in emulator and in the device too :-). Now I'm going to compare the apps to discover why mine doens't work. When I'll do I'll write again in this thread with the conclusion.&lt;/P&gt;

&lt;P&gt;Thans a lot,&lt;/P&gt;

&lt;P&gt;Miguel Ángel&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 18:44:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015015#M35645</guid>
      <dc:creator>Miguel_Ángel_M_</dc:creator>
      <dc:date>2015-04-08T18:44:27Z</dc:date>
    </item>
    <item>
      <title>Hi Miguel,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015016#M35646</link>
      <description>&lt;P&gt;Hi Miguel,&lt;/P&gt;

&lt;P&gt;The issue with starting your project from scratch from the template in XDK 1878 is that Domain List is left blank in the project build settings. Please put * in the domain list and your ajax call will work in your app.&lt;/P&gt;

&lt;P&gt;This issue is being fixed and will be available soon.&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2015 19:06:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015016#M35646</guid>
      <dc:creator>Swati_S_Intel1</dc:creator>
      <dc:date>2015-04-08T19:06:35Z</dc:date>
    </item>
    <item>
      <title>Hi Swati,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015017#M35647</link>
      <description>&lt;P&gt;Hi Swati,&lt;/P&gt;

&lt;P&gt;The issue you comment was the problem.&lt;/P&gt;

&lt;P&gt;I added &amp;lt;access origin="*"/&amp;gt; to my intelxdk.config.android.xml file and all works fine, in my test app and in my original app.&lt;/P&gt;

&lt;P&gt;Thank you very much for your help, I was &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;a little desperate.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Miguel Ángel&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2015 07:50:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-call-in-Android-return-no-response-when-build-App-test/m-p/1015017#M35647</guid>
      <dc:creator>Miguel_Ángel_M_</dc:creator>
      <dc:date>2015-04-09T07:50:06Z</dc:date>
    </item>
  </channel>
</rss>

