use of itor.topnetwork.com.dxditor.bean.Device in project Dxditor by kimi2009.
the class MapPageActivity method initGPSData.
private void initGPSData() {
try {
InputStream is = MapPageActivity.this.getAssets().open("devicetestdata.txt");
String jsonString = MyUtils.inputStream2String(is);
JSONObject js = new JSONObject(jsonString);
String re = js.getString("devices");
Gson gson = new Gson();
List<Device> devices = gson.fromJson(re, new TypeToken<List<Device>>() {
}.getType());
for (int i = 0; i < devices.size(); i++) {
LatLng latlng = convert(MapPageActivity.this, devices.get(i).getLocationy() + "", devices.get(i).getLocationx() + "");
addMarkersToMap(latlng, devices.get(i));
}
aMap.setOnMarkerClickListener(this);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations