Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected static void postCoors(double lat, double lon, double speed)
- {
- try {
- String url = "http://vrbrusnichka.appspot.com:80/coordinates/request";
- HttpClient client = new DefaultHttpClient();
- HttpPost post = new HttpPost(url);
- List<NameValuePair> pairs = new ArrayList<NameValuePair>();
- pairs.add(new BasicNameValuePair("userName", MainActivity.name));
- pairs.add(new BasicNameValuePair("lat", Double.toString(lat)));
- pairs.add(new BasicNameValuePair("lon", Double.toString(lon)));
- pairs.add(new BasicNameValuePair("velocity", Double.toString(speed)));
- post.setEntity(new UrlEncodedFormEntity(pairs));
- HttpResponse response = client.execute(post);
- } catch (Exception e) {System.out.println(e.getMessage());}
- }
- protected static void postRegid(String regid, String name, String platform){
- try {
- String url = "http://vrbrusnichka.appspot.com:80/team/save";
- HttpClient client = new DefaultHttpClient();
- HttpPost post = new HttpPost(url);
- System.out.println("Regid: " + regid);
- System.out.println("Name: " + name);
- System.out.println("Platform: " + platform);
- List<NameValuePair> pairs = new ArrayList<NameValuePair>();
- pairs.add(new BasicNameValuePair("userName", name));
- pairs.add(new BasicNameValuePair("token", regid));
- pairs.add(new BasicNameValuePair("platform", platform));
- post.setEntity(new UrlEncodedFormEntity(pairs));
- HttpResponse response = client.execute(post);
- } catch (Exception e) {System.out.println(e.getMessage());}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement