I've used The FIRST Alliance for a test scouting app that I was working on a little while ago.
Their API is pretty nice.
Here is some sample code, it gets all the teams from a regional and outputs them according to their ranking. It could easily be extended to get the team name.
Code:
package org.team3309.scout;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import com.google.appengine.labs.repackaged.org.json.JSONArray;
import com.google.appengine.labs.repackaged.org.json.JSONException;
import com.google.appengine.labs.repackaged.org.json.JSONObject;
public class FirstAlliance {
private static final String API = "http://www.thefirstalliance.org/api/api.json.php?action=";
public static Event[] getEvents(String teamNumber) {
Event[] competitions = new Event[0];
String url = API + "team-events&team-number=3309";
JSONArray events = getArray(url);
competitions = new Event[events.length()];
try {
for (int i = 0; i < events.length(); i++) {
JSONObject event = events.getJSONObject(i);
competitions[i] = new Event(event);
}
} catch (JSONException ex) {
ex.printStackTrace();
}
return competitions;
}
public static Event getEventById(int id){
String url = API+ "event-details&event-id="+id;
JSONObject json = getJson(url);
return new Event(json);
}
private static JSONArray getArray(String url) {
try {
HttpURLConnection c = (HttpURLConnection) new URL(url)
.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(
c.getInputStream()));
String line;
String input = "";
while ((line = reader.readLine()) != null)
input += line;
JSONObject json = new JSONObject(input);
return json.getJSONArray("data");
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
private static JSONObject getJson(String url){
try {
HttpURLConnection c = (HttpURLConnection) new URL(url)
.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(
c.getInputStream()));
String line;
String input = "";
while ((line = reader.readLine()) != null)
input += line;
JSONObject json = new JSONObject(input);
return json.getJSONObject("data");
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
public static class Event{
private String name;
private int id;
private JSONArray rankingsJson;
private ArrayList<Ranking> rankings;
private Event(JSONObject json){
this.name = json.optString("name");
this.id = json.optInt("id");
this.rankingsJson = json.optJSONArray("rankings");
}
public String getName(){
return name;
}
public int getId(){
return id;
}
public ArrayList<Ranking> getRankings(){
if(rankings != null)
return rankings;
ArrayList<Ranking> list = new ArrayList<Ranking>();
for(int i=0; i<rankingsJson.length(); i++){
JSONObject json = rankingsJson.optJSONObject(i);
list.add(new Ranking(json.optString("Team"), json.optInt("Rank"), json.optString("Record (W-L-T)")));
}
return list;
}
public String toString(){
return name;
}
}
public static class Ranking{
private String team, record;
private int ranking;
private Ranking(String team, int ranking, String record){
this.team = team;
this.ranking = ranking;
this.record = record;
}
public String getRecord(){
return record;
}
public int getWins(){
return Integer.parseInt(record.substring(0, record.indexOf("-")));
}
public int getLosses(){
return Integer.parseInt(record.substring(record.indexOf("-")+1, record.indexOf("-", record.indexOf("-")+1)));
}
public int getTies(){
return Integer.parseInt(record.substring(record.lastIndexOf("-")+1));
}
public String getTeam(){
return team;
}
public int getRank(){
return ranking;
}
}
}
If you want to get the team names use the method getArray("http://www.thefirstalliance.org/api/api.json.php?action=event-teams&event-id=<your event id>") and then loop through the array and get the field named "name" from each JSONObject. There is also a field called "number" if you want the team number too. If you want to know more about JSON you can go to json.org or look at this code to see how to get the team name.
If you need to find your event id, you can get the data from
http://www.thefirstalliance.org/api/...on=list-events
Edit: TBA's API looks nice too, if you want to use that you can still use the getJSON method (not getArray) if you don't know how to do HTTP GET in Android
Edit 2: Don't forget to add the INTERNET permission to your manifest. I've done that in probably every app that I've made and I feel more and more stupid each time.