62e1fc5c by chiangbt

全面更新

1 parent eeafb1ff
......@@ -16,7 +16,12 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".BootActivity" />
<activity android:name=".BootActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
......@@ -27,10 +32,7 @@
</activity>
<activity android:name=".BaiduMapActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
......
package com.pashanhoo.landsurvey.search;
import com.androidnetworking.AndroidNetworking;
import com.androidnetworking.error.ANError;
import com.androidnetworking.interfaces.JSONObjectRequestListener;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
public class TiandituSearch {
private static ArrayList<POISuggestion> poiSuggestionArrayList = new ArrayList<POISuggestion>();
public static ArrayList<POISuggestion> getPoi(String name){
String str = "{\"keyWord\":\"" + name + "\",\"level\":\"11\",\"mapBound\":" +
"\"76.24832,30.1129,156.40458,49.97618\",\"queryType\":\"1\",\"count\":\"10\"" +
",\"start\":\"0\",\"queryTerminal\":\"1000\"}";
AndroidNetworking.post("http://map.tianditu.com/query.shtml")
.addBodyParameter("type", "query")
.addBodyParameter("postStr", str)
.setTag("test")
.build()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
try {
JSONArray jsonArray = response.getJSONArray("pois");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject Jasonobject = jsonArray.getJSONObject(i);
poiSuggestionArrayList.add(new POISuggestion(Jasonobject.getString("name"),
Jasonobject.getString("address"),
Jasonobject.getString("lonlat")));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onError(ANError anError) {
poiSuggestionArrayList = null;
}
});
return poiSuggestionArrayList;
}
}