Translate

domingo, 22 de marzo de 2015

Intel XDK Android APK problem


In the emulator the web service works. When build and install .apk in cell phone does not work.

En el emulador el servicio web funciona. Cuando compila y se instala el .apk en el celular no funciona.




URL web Service:  http://solucionesapps.co/intelxdk/webServiceSlim/usuario/

SOLUCIÓN 



<script>
   $(function(){

    var xmlhttp = new XMLHttpRequest();
    var url = "http://solucionesapps.co/intelxdk/webServiceSlim/usuario/";

    xmlhttp.onreadystatechange=function() {
     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
      myFunction(xmlhttp.responseText);
     }else if(xmlhttp.status == 404)
     {
      intel.xdk.notification.alert("Web Service Doesn't Exist", "Error");
     }
    }
    xmlhttp.open("GET", url, true);
    xmlhttp.send();

    function myFunction(response) {
   
     console.log(response);
   
     var arr = JSON.parse(response);
     var i;
     var out = "<table>";

     for(i = 0; i < arr.length; i++) {
      out += "<tr><td>" +
       arr[i].id_usu +
       "</td><td>" +
       arr[i].nombre_usu +
       "</td><td>" +
       arr[i].apellido_usu +
       "</td></tr>";
     }
     out += "</table>"
     document.getElementById("resutlado").innerHTML = out;
    }

   });
  </script>


Build: LEGACY HYBRID MOBILE APP PLATFORMS


APP DETAILS   edit


Suggest: SELECT CODE BASE     LEAN






No hay comentarios.:

Publicar un comentario