Hello evrybody,
I’m new on Ionic 2 and I have several questions.
I try to access to my local server (I performed an eclipse project which creates a servlet in order to get a connection) with my smartphone. My laptop is connected through wifi with my smartphone.
my Ionic app is simple, it just display a button which “on click” executes this code :
{
let params: URLSearchParams = new URLSearchParams();
params.set('device_token', this.DEVICE_TOKEN);
alert(this.DEVICE_TOKEN);
this.http.get("http://localhost:8080/pushOnDeviceHelloWorld/emettreAlerte",params)
// this.http.get("192.168.43.214:8080/pushOnDeviceHelloWorld/emettreAlerte",params)
.toPromise()
.then(response => response)
.catch(this.handleError);
}
I use :
this.http.get("http://localhost:8080/pushOnDeviceHelloWorld/emettreAlerte",params)
when I run :Ionic serve
and I use :
this.http.get("192.168.xx.xxx:8080/pushOnDeviceHelloWorld/emettreAlerte",params)
when I run :Ionic run android
but when I run :Ionic serve
I can see the application access to my servlet (output displayed on my eclipse console)
but I get the error : Uncaught (in promise): Response with status: 0 for URL: null
I don’t know why…
and when I run : Ionic run android
I have no informations and nothing display on the eclipse console…
any idea ? I wonder what error occurs…
Moreover I would know how can I debug that, how can I get any process informations ? I spent a lot of time to debug because I don’t know how debug ionic app… Could you say me how can I do that ?