How do I call remote API using Phonegap for Android?
Asked Answered
P

2

6

How do I do remote API call in Android Apps using Phonegap???

Penick answered 27/2, 2012 at 11:52 Comment(2)
What do you mean by a remote API?Fruge
I am sorry i meant how to call web service or REST API ...Penick
F
5

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

Fruge answered 27/2, 2012 at 17:19 Comment(0)
S
0

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.

Sharpfreeze answered 27/2, 2012 at 16:50 Comment(1)
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.