Page 452 - 2
P. 452
public void run() {
bluetooth_manager = new Bluetooth_Manager();
}
}).start();
}
});
Tmap_Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (All_setting_OK()) {
Intent intent = new Intent(getApplicationContext(), TmMActivity.class);
startActivity(intent);
}
}
});
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (intent != null) {
if(start_drive != null){
start_drive.isdrive = false;
}
start_drive = new Start_Drive(intent.getStringExtra("ParsingData"));
start_drive.start();
}
}
public class Start_Drive extends Thread {
ArrayList<Point_info> Points = new ArrayList<Point_info>();
ArrayList<TMapPolyLine> Lines = new ArrayList<TMapPolyLine>();
boolean isdrive = true;
String ParsingData;
public Start_Drive(String Parsing) {
ParsingData = Parsing;
try {
if (bluetooth_manager != null) {
if (bluetooth_manager.mmSocket.isConnected()) {
JSONObject jsonObject = new JSONObject(ParsingData);
JSONArray features = jsonObject.getJSONArray("features");
for (int i = 0; i < features.length(); i++) {
JSONObject feature = features.getJSONObject(i);
if (feature.getJSONObject("geometry").getString("type").equals("Point")) {
JSONObject geometry = feature.getJSONObject("geometry");
JSONArray coordinates = geometry.getJSONArray("coordinates");
JSONObject properties = feature.getJSONObject("properties");
- 452 -