Android Request - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Request class.

This code example shows how to use the following methods:executeAsync
 
	public void getNewsFeed(Session session) {
		Log.i("ListFeedActivity", "Making request");
		Bundle params = new Bundle();
		params.putString("limit", "0");
		Request request = new Request(session, "me/home", params,
				HttpMethod.GET, new Request.Callback() {
					public void onCompleted(Response response) {
						Log.i("ListFeedActivity", "finised request");
						Log.i("ListFeedActivity", response.toString());
						ArrayList<String> values = buildValuesFromResponse(response);
						buildList(values);
					} 
				}); 
		request.executeAsync();
	} 
 
	public ArrayList<String> buildValuesFromResponse(Response response) {
		JSONObject responseJson = response.getGraphObject()
				.getInnerJSONObject();
4
CodeRank
This code example shows how to use the following methods:
		 
		String fqlQuery = "SELECT post_id,description FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = me() AND type = 'newsfeed')";
	        Bundle params = new Bundle();
	        params.putString("q", fqlQuery);
	         
	        Request request = new Request(session,
	            "/fql",                          
	            params,                         
	            HttpMethod.GET,                 
	            new Request.Callback(){       
	        		 
	                public void onCompleted(Response response) {
	                	 
	                	extractFeeds(response);
	                	 
	                   
	                }                   
	        });  
	        Request.executeBatchAsync(request);                
		 
3
CodeRank
This code example shows how to use the following methods:
		 * @param callback 
		 * @return 
		 */ 
		public Request buildGraphRequest(Session session, HttpMethod method,
				Callback callback) {
			return new Request(session, getGraphPath(), getParams(), method,
					callback);
		} 
		 
		private String getGraphPath() {
			return graphPath.toString();
		} 
 
		private Bundle getParams() {
			return params;
		} 
	} 
} 
2
CodeRank

Related Android Request Questions & Answers:

Other Android Request Examples

46:		}
47:	
48:		public  void addToRequestQueue(Request<T> req, String tag) {
49:			// set the default tag if tag is empty
50:			req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
-
52:		}
53:	
54:		public  void addToRequestQueue(Request<T> req) {
55:			req.setTag(TAG);
56:			getRequestQueue().add(req);

Read More

See Code Examples for Android Request Methods: