Created
March 18, 2012 05:39
-
-
Save twaddington/2069215 to your computer and use it in GitHub Desktop.
Geoloqi Android SDK: Simple POST Request
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
if (mService != null) { | |
LQSession session = mService.getSession(); | |
// Build your request | |
try { | |
JSONObject geonote = new JSONObject(); | |
geonote.put("text", "Test!"); | |
geonote.put("latitude", 45.5037078163837); | |
geonote.put("longitude", -122.622699737549); | |
geonote.put("radius", 467); | |
geonote.put("place_name", "Grocery Store"); | |
} catch (JSONException e) { | |
// Pass | |
} | |
// Send the request | |
session.runPostRequest("geonote/create", geonote, new OnRunApiRequestListener() { | |
@Override | |
public void onComplete(HttpResponse response) { | |
try { | |
Log.d(TAG, EntityUtils.toString(response.getEntity())); | |
} catch (ParseException e) { | |
// Pass | |
} catch (IOException e) { | |
// Pass | |
} | |
} | |
@Override | |
public void onFailure(LQSession session, LQException e) { | |
// Pass | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment