// Path: AgileDayConferenceApp/src/it/agileday/utils/BitmapCache.java
// public class BitmapCache {
// 	private static final String TAG = BitmapCache.class.getName();
// 
// 	private final Map<String, Bitmap> cache = new HashMap<String, Bitmap>();
// 
// 	public Bitmap get(String url) {
// 		if (!cache.containsKey(url)) {
// 			cache.put(url, HttpRestUtil.httpGetBitmap(url));
// 			Log.i(TAG, "Bitmap loaded: " + url);
// 		}
// 		return cache.get(url);
// 	}
// }
// 
// Path: AgileDayConferenceApp/src/it/agileday/data/Tweet.java
// public class Tweet {
// 	public long id;
// 	public String text;
// 	public String fromUser;
// 	public Bitmap profileImage;
// 	public Date date;
// }
// 
// Path: AgileDayConferenceApp/src/it/agileday/data/TweetList.java
// public class TweetList extends ArrayList<Tweet> implements List<Tweet> {
// 	private static final long serialVersionUID = 1L;
// 	private static TweetList empty = new TweetList(0);
// 
// 	public TweetList(int length) {
// 		super(length);
// 	}
// 
// 	public static TweetList Empty() {
// 		return empty;
// 	}
// 
// }
// 
// Path: AgileDayConferenceApp/src/it/agileday/data/TweetRepository.java
// public class TweetRepository {
// 	@SuppressWarnings("unused")
// 	private static final String TAG = TweetRepository.class.getName();
// 	private static final String URL = "http://search.twitter.com/search.json";
// 
// 	private String nextPageQueryString;
// 	private final BitmapCache bitmapCache;
// 
// 	public TweetRepository(String hashTag, BitmapCache bitmapCache) {
// 		this.nextPageQueryString = "?result_type=recent&rpp=10&q=" + URLEncoder.encode(hashTag);
// 		this.bitmapCache = bitmapCache;
// 	}
// 
// 	public TweetList getNextPage() {
// 
// 		if (!hasNextPage())
// 			return TweetList.Empty();
// 
// 		JSONObject json = HttpRestUtil.httpGetJsonObject(String.format("%s%s", URL, nextPageQueryString));
// 
// 		nextPageQueryString = json.optString("next_page", null);
// 
// 		try {
// 			return fromJson(json.getJSONArray("results"));
// 		} catch (Exception e) {
// 			throw new RuntimeException(e);
// 		}
// 	}
// 
// 	public boolean hasNextPage() {
// 		return nextPageQueryString != null;
// 	}
// 
// 	private TweetList fromJson(JSONArray ary) throws Exception {
// 		TweetList tweets = new TweetList(ary.length());
// 		for (int i = 0; i < ary.length(); i++) {
// 			tweets.add(buildTweet(ary.getJSONObject(i)));
// 		}
// 		return tweets;
// 	}
// 
// 	public Tweet buildTweet(JSONObject json) {
// 		Tweet ret = new Tweet();
// 		try {
// 			ret.id = json.getLong("id");
// 			ret.text = json.getString("text");
// 			ret.fromUser = json.getString("from_user");
// 			ret.date = Dates.fromTweeterString(json.getString("created_at"));
// 			ret.profileImage = bitmapCache.get(json.getString("profile_image_url"));
// 		} catch (JSONException e) {
// 			throw new RuntimeException(e);
// 		}
// 		return ret;
// 	}
// 
// }


import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.Toast;
import it.agileday2011.R;
import it.agileday.utils.BitmapCache;
import it.agileday.data.Tweet;
import it.agileday.data.TweetList;
import it.agileday.data.TweetRepository;
import java.util.List;
import android.app.ListActivity;
import android.content.Context;

/*
	Copyright 2010 
	
	Author: Gian Marco Gherardi
	Author: Ilias Bartolini
	Author: Luigi Bozzo

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
 */

package it.agileday.ui.twitter;




public class TwitterActivity extends ListActivity implements OnScrollListener {
	private static final String TAG = TwitterActivity.class.getName();

// Path: AgileDayConferenceApp/src/it/agileday/utils/BitmapCache.java
// public class BitmapCache {
// 	private static final String TAG = BitmapCache.class.getName();
// 
// 	private final Map<String, Bitmap> cache = new HashMap<String, Bitmap>();
// 
// 	public Bitmap get(String url) {
// 		if (!cache.containsKey(url)) {
// 			cache.put(url, HttpRestUtil.httpGetBitmap(url));
// 			Log.i(TAG, "Bitmap loaded: " + url);
// 		}
// 		return cache.get(url);
// 	}
// }
// 
// Path: AgileDayConferenceApp/src/it/agileday/data/Tweet.java
// public class Tweet {
// 	public long id;
// 	public String text;
// 	public String fromUser;
// 	public Bitmap profileImage;
// 	public Date date;
// }
// 
// Path: AgileDayConferenceApp/src/it/agileday/data/TweetList.java
// public class TweetList extends ArrayList<Tweet> implements List<Tweet> {
// 	private static final long serialVersionUID = 1L;
// 	private static TweetList empty = new TweetList(0);
// 
// 	public TweetList(int length) {
// 		super(length);
// 	}
// 
// 	public static TweetList Empty() {
// 		return empty;
// 	}
// 
// }
// 
// Path: AgileDayConferenceApp/src/it/agileday/data/TweetRepository.java
// public class TweetRepository {
// 	@SuppressWarnings("unused")
// 	private static final String TAG = TweetRepository.class.getName();
// 	private static final String URL = "http://search.twitter.com/search.json";
// 
// 	private String nextPageQueryString;
// 	private final BitmapCache bitmapCache;
// 
// 	public TweetRepository(String hashTag, BitmapCache bitmapCache) {
// 		this.nextPageQueryString = "?result_type=recent&rpp=10&q=" + URLEncoder.encode(hashTag);
// 		this.bitmapCache = bitmapCache;
// 	}
// 
// 	public TweetList getNextPage() {
// 
// 		if (!hasNextPage())
// 			return TweetList.Empty();
// 
// 		JSONObject json = HttpRestUtil.httpGetJsonObject(String.format("%s%s", URL, nextPageQueryString));
// 
// 		nextPageQueryString = json.optString("next_page", null);
// 
// 		try {
// 			return fromJson(json.getJSONArray("results"));
// 		} catch (Exception e) {
// 			throw new RuntimeException(e);
// 		}
// 	}
// 
// 	public boolean hasNextPage() {
// 		return nextPageQueryString != null;
// 	}
// 
// 	private TweetList fromJson(JSONArray ary) throws Exception {
// 		TweetList tweets = new TweetList(ary.length());
// 		for (int i = 0; i < ary.length(); i++) {
// 			tweets.add(buildTweet(ary.getJSONObject(i)));
// 		}
// 		return tweets;
// 	}
// 
// 	public Tweet buildTweet(JSONObject json) {
// 		Tweet ret = new Tweet();
// 		try {
// 			ret.id = json.getLong("id");
// 			ret.text = json.getString("text");
// 			ret.fromUser = json.getString("from_user");
// 			ret.date = Dates.fromTweeterString(json.getString("created_at"));
// 			ret.profileImage = bitmapCache.get(json.getString("profile_image_url"));
// 		} catch (JSONException e) {
// 			throw new RuntimeException(e);
// 		}
// 		return ret;
// 	}
// 
// }


// Path: AgileDayConferenceApp/src/it/agileday/ui/twitter/TwitterActivity.java
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.Toast;
import it.agileday2011.R;
import it.agileday.utils.BitmapCache;
import it.agileday.data.Tweet;
import it.agileday.data.TweetList;
import it.agileday.data.TweetRepository;
import java.util.List;
import android.app.ListActivity;
import android.content.Context;

/*
	Copyright 2010 
	
	Author: Gian Marco Gherardi
	Author: Ilias Bartolini
	Author: Luigi Bozzo

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
 */

package it.agileday.ui.twitter;




public class TwitterActivity extends ListActivity implements OnScrollListener {
	private static final String TAG = TwitterActivity.class.getName();

	private TweetRepository repository;
