Created
March 14, 2012 19:22
-
-
Save StlTenny/2038823 to your computer and use it in GitHub Desktop.
Sample RestService Implementation Snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RestService restService; | |
restService = new RestService(mHandler, this, "http://10.0.2.2:3000/bars/"); | |
restService.addParam("lat", "40764917"); //Add params to request | |
restService.addParam("lng", "-73983130"); | |
restService.addParam("range", "10"); | |
restService.addHeader("Content-Type","application/json");//Add headers to request | |
//Overridden handler to process incoming response. | |
private final Handler mHandler = new Handler(){ | |
@Override | |
public void handleMessage(Message msg){ | |
String response = (String) msg.obj; | |
}}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment