use of com.androidquery.auth.TwitterHandle in project androidquery by androidquery.
the class AjaxAuthActivity method auth_unauth.
public void auth_unauth() {
FacebookHandle fh = new FacebookHandle(this, APP_ID, "read_stream");
fh.unauth();
TwitterHandle th = new TwitterHandle(this, CONSUMER_KEY, CONSUMER_SECRET);
th.unauth();
showResult("Auth data cleared", null);
}
use of com.androidquery.auth.TwitterHandle in project androidquery by androidquery.
the class AjaxAuthActivity method auth_twitter.
public void auth_twitter() {
TwitterHandle handle = new TwitterHandle(this, CONSUMER_KEY, CONSUMER_SECRET);
String url = "http://twitter.com/statuses/mentions.json";
aq.auth(handle).progress(R.id.progress).ajax(url, JSONArray.class, this, "twitterCb");
}
use of com.androidquery.auth.TwitterHandle in project androidquery by androidquery.
the class AjaxAuthActivity method auth_twitter_update.
public void auth_twitter_update() {
TwitterHandle handle = new TwitterHandle(this, CONSUMER_KEY, CONSUMER_SECRET);
//1/statuses/update.format
//https://upload.twitter.com/1/statuses/update_with_media.format
String url = "http://twitter.com/statuses/update.json";
Map<String, String> params = new HashMap<String, String>();
params.put("status", "Testing 123");
aq.auth(handle).progress(R.id.progress).ajax(url, params, JSONObject.class, this, "twitterCb2");
}
use of com.androidquery.auth.TwitterHandle in project androidquery by androidquery.
the class AjaxAuthActivity method auth_twitter_upload.
public void auth_twitter_upload() {
File file = aq.getCachedFile(UPLOAD_IMAGE);
if (file == null) {
aq.cache(UPLOAD_IMAGE, 0);
return;
}
AQUtility.debug("upload file:" + file.length());
TwitterHandle handle = new TwitterHandle(this, CONSUMER_KEY, CONSUMER_SECRET);
String url = "https://upload.twitter.com/1/statuses/update_with_media.json";
Map<String, Object> params = new HashMap<String, Object>();
params.put("status", "Testing Status Update with AndroidQuery");
params.put("media[]", file);
aq.auth(handle).progress(R.id.progress).ajax(url, params, JSONObject.class, this, "twitterCb2");
}
use of com.androidquery.auth.TwitterHandle in project androidquery by androidquery.
the class AjaxAuthActivity method auth_twitter_token.
public void auth_twitter_token() {
TwitterHandle handle = new TwitterHandle(this, CONSUMER_KEY, CONSUMER_SECRET) {
@Override
protected void authenticated(String secret, String token) {
showResult("secret:" + secret + " token:" + token, null);
}
};
handle.authenticate(false);
}
Aggregations