GPS - Prise de la distance,du temps lors de l'exécution et de la marche

j'ai une situation où j'ai besoin d'utiliser le GPS de la technique.

j'ai besoin de trouver la distance entre deux points lorsque la personne est en marche.

Lorsque la personne commence à marcher, il va cliquer sur Start button et quand il s'arrête, il clique sur stop button

après cela, il devrait lui montrer

1.le temps pris
2.La Distance parcourue en Km.
3.d'où à où(nom) par exemple: de a à b

Ai-je besoin de google maps pour cela?

J'ai vu le code ici lien pour obtenir l'emplacement actuel qui me donne de la latitude, de la longitude.

s'il vous plaît aider comment faire pour aller avec ce

**

Édité:

**

C'est le code, je suis en utilisant

private EditText editTextShowLocation;
private Button buttonGetLocation;
private ProgressBar progress;
private LocationManager locManager;
private LocationListener locListener = new MyLocationListener();
private boolean gps_enabled = false;
private boolean network_enabled = false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
editTextShowLocation = (EditText) findViewById(R.id.editTextShowLocation);
progress = (ProgressBar) findViewById(R.id.progressBar1);
progress.setVisibility(View.GONE);
buttonGetLocation = (Button) findViewById(R.id.buttonGetLocation);
buttonGetLocation.setOnClickListener(this);
locManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
}
@Override
public void onClick(View v) {
progress.setVisibility(View.VISIBLE);
//exceptions will be thrown if provider is not permitted.
try {
gps_enabled = locManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
} catch (Exception ex) {
}
try {
network_enabled = locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} catch (Exception ex) {
}
//don't start listeners if no provider is enabled
if (!gps_enabled && !network_enabled) {
AlertDialog.Builder builder = new Builder(this);
builder.setTitle("Attention!");
builder.setMessage("Sorry, location is not determined. Please enable location providers");
builder.setPositiveButton("OK", this);
builder.setNeutralButton("Cancel", this);
builder.create().show();
progress.setVisibility(View.GONE);
}
if (gps_enabled) {
locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locListener);
}
if (network_enabled) {
locManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locListener);
}
}
class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location location) {
if (location != null) {
//This needs to stop getting the location data and save the battery power.
locManager.removeUpdates(locListener); 
String londitude = "Londitude: " + location.getLongitude();
String latitude = "Latitude: " + location.getLatitude();
String altitiude = "Altitiude: " + location.getAltitude();
String accuracy = "Accuracy: " + location.getAccuracy();
String time = "Time: " + location.getTime();
editTextShowLocation.setText(londitude + "\n" + latitude + "\n" + altitiude + "\n" + accuracy + "\n" + time);
progress.setVisibility(View.GONE);
} 
}
@Override
public void onProviderDisabled(String provider) {
//TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
//TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
//TODO Auto-generated method stub
}
}
@Override
public void onClick(DialogInterface dialog, int which) {
if(which == DialogInterface.BUTTON_NEUTRAL){
editTextShowLocation.setText("Sorry, location is not determined. To fix this please enable location providers");
}else if (which == DialogInterface.BUTTON_POSITIVE) {
startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));
}
}

C'est de la Longitude la Latitude dont je suis saisie de emulator control.

En cela, je suis en entrant manuellement les détails de la longitude et de la latitude
en allant à window->showview->other->emulator control pour les essais dans l'émulateur
mais ce que je besoin est, je vais avoir deux edittext où je entrer le nom du lieu(A) et (B)

il devrait me donner la distance

s'il vous plaît aider

petite suggestion.. prendre le code de la onclick et dans une fonction nommée. C'est une petite chose, mais elle rend le code des tas plus facile à lire si vous savez ce que la méthode est censée faire.

OriginalL'auteur Goofy | 2012-03-12