I am following https://github.com/pardom/ActiveAndroid/wiki/Querying-the-database to incorporate activeandroid in my application like so:
@Table(name="Contact")
public class Contact extends Model implements Serializable, Comparable {
public Contact() {
super();
}
public Contact(String id, String n, String c, String p, String addr, String phone,
String fb, String twit, String yt) {
super();
candID = id;
name = n;
chamber = c;
party = p;
address = addr;
phoneNo = phone;
facebook = fb;
twitter = twit;
youtube = yt;
}
public static List<Contact> getCachedContactsByState(String stateAbbr) {
/*return new Select().from(Contact.class).where("state = ?",
stateAbbr).execute();*/
Select s = new Select();
From f = s.from(Contact.class);
f = f.where("state = ?", stateAbbr);
List<Contact> cachedContacts = f.execute();
return cachedContacts;
}
According to my debugger, the f.execute throws a null pointer exception, and f is not null.
just making sure, the tutorial didn't mention needing to install sqlite before using activeandroid, and it said the point of activeandroid was to use objects and their functions to do CRUD on sqlite, so I'm assuming I just needed to follow the tutorial to create and query my sqlite db?