first off I was wondering if there are even HTML parsers that work with Android app programming or not, or if all I have access to is the html commands listed on the Android developers web site. The reason is I am making an app that allows you to access the Zelda Wikia and instead of hard coding everything such as the titles of the video games I wanted to go ahead and pull the names using the MediaWiki API, the command I found was this:
http://zelda.wikia.com/api.php?action=query&list=categorymembers&cmtitle=Category:Games&cmlimit=500
This returns all of the titles in HTML formatting and the only way that I can think to pull what I need from what this returns is using an HTML parser, but I am not sure that there is one that works with Android programming and if so how I would even go about pulling what I need from this. After I get the data from this I want to display it in a ListView and when the title is clicked it will take the user to the Wikia for that specific title in a WebView. Is this the way I should be going about this or are there any other recommendations that anyone has, please I really need help. The rest of the code is as follows just incase anyone wants to see what I have:
package com.lvlup.kikurself.zeldatest;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
public class zeldaGames extends ListActivity {
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
String[] values = new String[] { "The Legend of Zelda", "Zelda II: The
Adventure of Link", "The Legend of Zelda: Ocarina of Time",};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, values);
setListAdapter(adapter);
final ListView zeldaList = getListView();
zeldaList.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long thisID)
{
Object o = (zeldaList.getItemAtPosition(position));
String gameName_temp = (o.toString());
Intent newIntent = new Intent(v.getContext(), gameDisp.class);
newIntent.putExtra("tempG", gameName_temp);
startActivity(newIntent);
}
});
Thank you for taking the time to read this.