I created the .apk file and I'm able to make ajax requests, so the problem is when using simulator.
Repeat: Works on computer browser, works using Rippled on Chrome and now works installing the app in the phone.
What emulators are you testing on?
I'm using EvothingsWorkbrench and now a plugin for Chrome (Rippled). Any suggestion? An emulator you recommend?
I need help, so I can test in an emulator, not building the app and installing on the phone.
Neither of those things are emulators AFAIK. They can be useful for testing, but they can also introduce additional complexity when they don't act exactly as you might expect. Since I use neither, it's difficult for me to be of any assistance in that regard.
You can use the emulator shipped with the Android SDK or something like GenyMotion. These emulators use an Android image to provide, essentially, Android on your desktop. They aren't exactly the same as running the app on your device (typically slower, and lacking in sensors, or provide mock sensor data), but the environment is far closer to the real thing than what you're currently using (AFAIK).
Depending on which emulator you use, you'll use different Cordova commands:
- cordova emulate android --> launches the Android SDK emulator (you have to configure at least one emulator in advance)
- Configure and launch a GenyMotion Android emulator --> cordova run android --> app runs on the emulator
Hope that helps.
Thank you for the answer. I'll try with that and let you know the results.
I added the parameter "timeout: 5000" to my Ajax Request and I get the error "Timeout". Any idea what happen? I get that error only when executing from the "emulator".
Something with the Content-Security-Policy rules? Can I know what should I put there (In the Content-Security-Policy)?
Thanks in advance!!