How do I do remote API call in Android Apps using Phonegap???
How do I call remote API using Phonegap for Android?
Asked Answered
What do you mean by a remote API? –
Fruge
I am sorry i meant how to call web service or REST API ... –
Penick
Just use XmlHttpReqquest to communicate with your server. Here is my stock example that gets a list of tweets from Twitter:
http://simonmacdonald.blogspot.com/2011/12/on-third-day-of-phonegapping-getting.html
If you use PhoneGap in combination with jQuery Mobile you can use the Ajax function of jQuery. Simply pass the url and use the succes or error callback to edit or use returned data.
It might be easier to use the solution @SimonMacDonald mentioned. If you use my solution you need to add libraries to your project that might be unnecessary for the rest of the application. –
Sharpfreeze
© 2022 - 2024 — McMap. All rights reserved.