Guest User

Untitled

a guest
Jun 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. public static void addWall(final LitterBuggAPICallback callback, float latitude, float longitude, String title) {
  2. Network n = new Network();
  3. String url = LBConstants.LB_NEW_WALL_URL;
  4.  
  5. Hashtable params = new Hashtable();
  6. params.put("lat", String.valueOf(latitude));
  7. params.put("lon", String.valueOf(longitude));
  8. params.put("title", title);
  9.  
  10. n.setAuthorization(LitterBugg.oauth.oauth_header(url, HttpProtocolConstants.HTTP_METHOD_POST, params));
  11.  
  12. // n.doPost(url, (byte[])null, new LitterBuggCallback(callback) {
  13. // n.doGet(url, new LitterBuggCallback(callback) {
  14.  
  15. n.doPost(url, params, new LitterBuggCallback(callback) {
  16. public void onNetworkRequestSuccessful(InputStream reply) {
  17. String response = parseISToString(reply);
  18. System.out.println("********** add wall response **********\n" + response);
  19. System.out.println("*******************************");
  20. Object[] o = new Object[0];
  21. cb.onRequestSuccessful(o);
  22. /*Object[] p = parseWalls(reply);
  23.  
  24. System.out.println("here are the walls:");
  25. for(int i = 0; i < p.length; i++) {
  26. System.out.println("Wall = [" + ((Wall)p[i]).getTitle() + "]");
  27. }
  28.  
  29. cb.onRequestSuccessful(p);*/
  30. }
  31. });
  32. }
Add Comment
Please, Sign In to add comment