hay dear my code is running fine from localhost but build app is not able to make database connection i have updated detail of db connection and hosted php file on server
- 78 Posts
- 0 Reply Likes
Posted 4 years ago
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Apps don't make database connections. They simply send ajax requests to a web service, which then retrieves and returns the data, most likely in json format.
- 78 Posts
- 0 Reply Likes
yup i know that but my build app is not able to do sooo same code is working fine with simulator
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
How did you whitelist your web service interface?
- 78 Posts
- 0 Reply Likes
i don't know that please provide me link where i can find the resource for same
- 78 Posts
- 0 Reply Likes
i don't know that please provide me link where i can find the resource for same
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
See http://docs.build.phonegap.com/en_US/...
which also links to
https://github.com/apache/cordova-plu...
which also links to
https://github.com/apache/cordova-plu...
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
is already in my xmlThen why didn't you know how you whitelisted the web service?
Anyway, do you wait for the deviceready event to fire before attempting to make ajax/xhr requests to that web service?
- 78 Posts
- 0 Reply Likes
yes ajax request is on function after device ready
please help me out
please help me out
- 78 Posts
- 0 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- Is the ajax call reached at all in your javascript code flow?
- Is the ajax call executed?
- Is the request received on the server?
If any of the answers is "no", you need to find out why. Because you're the developer and you have your source code, I can't debug for you.
BTW: "yes ajax request is on function " is hardly an answer to my question.
- Is the ajax call executed?
- Is the request received on the server?
If any of the answers is "no", you need to find out why. Because you're the developer and you have your source code, I can't debug for you.
BTW: "yes ajax request is on function " is hardly an answer to my question.
- 78 Posts
- 0 Reply Likes
build apk is not working and white listing you were suggesting is allowed by default
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
What "build api"? We are not talking about the Phonegap Build API, are we?
Anyway, the fact that it runs in an emulator doesn't mean that it runs properly in a real environment, so you need to debug.
If your zip file is publicly available somewhere, please post its url. I'll be happy to have a look.
Anyway, the fact that it runs in an emulator doesn't mean that it runs properly in a real environment, so you need to debug.
If your zip file is publicly available somewhere, please post its url. I'll be happy to have a look.
- 78 Posts
- 0 Reply Likes
okay thanks
i will give you link in a minute
i will give you link in a minute
- 78 Posts
- 0 Reply Likes
- 78 Posts
- 0 Reply Likes
url of project
http://farmtocustomer.com/api/test%20...
http://farmtocustomer.com/api/test%20...
- 78 Posts
- 0 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Here is some feedback:
1. In your zip file, index.html and config.xml should both be in the root ("/"). Not in a directory like /test_new_app or even /test_new_app/www
If you don't do this correctly, PGB will not find your config and will use some default config
2. You are uploading a full Cordova project, including directories like /platforms and /hooks. You can't do that. PGB only wants your assets and a config.
This would be a good time to start reading the Getting Started section of the PGB documentation.
3. In your config, you are using old, deprecated plugins. You should replace them by the latest versions of npm plugins. Be aware that these are named differently (mostly something like cordova-plugin-xxxxx).
4. Your index.html doesn't contain a reference to phonegap.js or cordova.js. Also, you are not waiting for the deviceready event to fire before making any ajax calls.
And unrelated, but still noticable:
5. You can safely remove everything related to blackberry and webOS, because PGB is not going to build these, anyway
You can also remove everything for winphone, because you excluded that OS using platform elements for the other two.
6. You don't have the larger dimensions for Android (xxhdpi and xxxhdpi). The landscape splashes are missing completely, although you have set 'default' orientation, which means both portrait and landscape
7. The larger icons and splashes for iOS are missing, too.
8. An allow-navigation whitelist rule for each of your external links is missing.
1. In your zip file, index.html and config.xml should both be in the root ("/"). Not in a directory like /test_new_app or even /test_new_app/www
If you don't do this correctly, PGB will not find your config and will use some default config
2. You are uploading a full Cordova project, including directories like /platforms and /hooks. You can't do that. PGB only wants your assets and a config.
This would be a good time to start reading the Getting Started section of the PGB documentation.
3. In your config, you are using old, deprecated plugins. You should replace them by the latest versions of npm plugins. Be aware that these are named differently (mostly something like cordova-plugin-xxxxx).
4. Your index.html doesn't contain a reference to phonegap.js or cordova.js. Also, you are not waiting for the deviceready event to fire before making any ajax calls.
And unrelated, but still noticable:
5. You can safely remove everything related to blackberry and webOS, because PGB is not going to build these, anyway
You can also remove everything for winphone, because you excluded that OS using platform elements for the other two.
6. You don't have the larger dimensions for Android (xxhdpi and xxxhdpi). The landscape splashes are missing completely, although you have set 'default' orientation, which means both portrait and landscape
7. The larger icons and splashes for iOS are missing, too.
8. An allow-navigation whitelist rule for each of your external links is missing.
- 78 Posts
- 0 Reply Likes
btw thanks for suggestion will fix these thing and this is just a test app so have not icons and all
- 78 Posts
- 0 Reply Likes
damm i am able to do that you are really a angel dear thanks for helping
god bless you
god bless you
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers



vikash mishra
vikash mishra less than a minute ago
yup i know that but my build app is not able to do sooo same code is working fine with simulator