-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map_service.java
60 lines (36 loc) · 1.12 KB
/
Map_service.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.d_andaman;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.widget.TextView;
public class Map_service extends AsyncTask<String,Void,String>{
private TextView lat,lon;
private Context context;
private Location_Manager m;
public Map_service(Context contex,TextView lat,TextView lon) {
this.context=contex;
this.lat=lat;
this.lon=lon;
m=new Location_Manager();
}
protected void onPreExecute(){
}
@Override
protected String doInBackground(String... arg0) {
String lat= (String)arg0[0];
String lon= (String)arg0[1];
double lat1=Double.parseDouble(lat);
double lon1=Double.parseDouble(lon);
String location=m.checklocation(lat1, lon1);
return location;
}
@Override
protected void onPostExecute(String result){
if(result=="X"){
lat.setText("Location Service is Unavilable to find your location");
lon.setText("Your location is still under discovery");
}else{
lon.setText(result);
}
}
}