wilxjcherokee
wilxjcherokee

Reputation: 571

What is the best option to pull data from wordpress posts into Android?

I need to take data from a wordpress site(posts) and put it natively into an android app.I have tried a few approaches but am getting lost in my own head. I have access to the admin panel so I can add plugins if need be.

Possible ways(in my mind):

RSS Parser(best option for android?) JSON api for wordpress(can I use this for android?) ???

I tried using XMLPullParser and I can get the posts into a ListView but I cannot find a way to parse the text of the article(the XML contains the full text for all articles).

Any ideas? I can post my current code if necessary.

Upvotes: 1

Views: 656

Answers (2)

Vincent Mimoun-Prat
Vincent Mimoun-Prat

Reputation: 28541

I cannot find a way to parse the text of the article(the XML contains the full text for all articles).

Save that html text to a String and then feed it to a WebView to display it.

Possible ways(in my mind): RSS Parser(best option for android?) JSON api for wordpress(can I use this for android?) ???

Both are valid. The JSON api would give you more control however as the RSS produced by WordPress is rather static (you can ask for the RSS of a category, archive, ... but JSON API would allow you to get data for any object of WP exposed by the JSON API plugin)

Upvotes: 0

Nikola Ninkovic
Nikola Ninkovic

Reputation: 1262

I've done something similar with Wordpress Json Api link

Just make an request and then parse JSON formatted data with Java.

Upvotes: 2

Related Questions