2
I’m developing an app using jquery mobile
and phonegap
.
Question: why when I test the application on 'phonegap serve'
of node.js
works and when I download apk
created by Buil Phonegap
nay?
Example: if I try to communicate with a database (mysql
) external through phonegap serves works normal, but by apk not.
My reference code is:
$(document).on('click', '#envcep', function() {
var cep1 = $("#cep").val();
var n = cep1.length;
if (n < 8) {
$("#mesg").text("CEP incompleto.");
$("#dialog2").popup('open');
return true;
} else {
var data = $("#app").serialize();
$.ajax
({
type: "POST",
url: "http://meuwebsite.com.br/aplicativo/cep.php",
data: data,
cache: false,
success:
function(resposta) {...
Detail: my config.xml already has: access origin="*" access origin="http://meusite.com.br"
Where would the error be? What would be the difference between testing an application with phonegap serves and by the apk generated by build phonegap?
Thank you!!
android.permission.INTERNET
? http://stackoverflow.com/questions/23387007/phonegap-build-permissions-in-android– rubStackOverflow
My permissions look like this: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
– Wrobbi
The Cordova/Phonegap by default comes with a "lock" to Internet access by the application. But in its own documentation, it has a very well explained guide, where it teaches to remove this lock, so that it is possible to access the Web through the app. Follow the link: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-whitelist/#supported-Cordova-Platforms
– Joao Victor Pereira santos