Skip to content

Instantly share code, notes, and snippets.

@silmood
Created April 28, 2015 01:39
Show Gist options
  • Select an option

  • Save silmood/246da6df9c2d10dae2d5 to your computer and use it in GitHub Desktop.

Select an option

Save silmood/246da6df9c2d10dae2d5 to your computer and use it in GitHub Desktop.
AsyncTaskDevfExample
public class Constants {
//URL
public static final String SEARCH_URL = "http://api.eventful.com/json/events/search?app_key=4Q7hC5bJXwHMZ99t&category=art&date=This%Week";
//JSON keys
public static final String EVENTS_KEY = "events";
public static final String EVENT_KEY = "event";
public static final String DATE_KEY = "start_time";
public static final String DESCRIPTION_KEY = "description";
public static final String TITLE_KEY = "title";
public static final String COUNTRY_KEY = "country_name";
public static final String REGION_KEY = "region_name";
public static final String CITY_KEY = "city_name";
public static final String ADDRESS_KEY = "venue_address";
public static final String VENUE_KEY = "venue_name";
}
public class Event {
String title;
String description;
String date;
Venue venue;
public Event(String title, String description, String date, Venue venue) {
this.title = title;
this.description = description;
this.date = date;
this.venue = venue;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public Venue getVenue() {
return venue;
}
public void setVenue(Venue venue) {
this.venue = venue;
}
}
public class Venue {
String name;
String country;
String region;
String city;
String address;
public Venue(String name, String country, String region, String city, String address) {
this.name = name;
this.country = country;
this.region = region;
this.city = city;
this.address = address;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment