i've been developing an iphone,ipad and android application but the following code works perfectly fine in the first two platforms I mentioned but in android it jumps directly to the function xhr.onerror() the code is bellow
var URL ="http://localhost:3000/icuponcels/list?latitude="+25.650657+"&longitude="+-100.287216; var xhr = Titanium.Network.createHTTPClient(); xhr.onload = function() { json = JSON.parse(this.responseText); Ti.API.info(json); }; xhr.onerror = function() { var internet=Ti.UI.createAlertDialog({ title:'Por el momento esta funcion no esta disponible por problemas de conexion a internet', buttonNames: ['OK'] }); Ti.API.info("error en xhr"); internet.show(); }; xhr.open("GET",URL); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Accept', 'application/json'); xhr.send();