Bonjour a tous,

Alors j'explique mon problème sous Android 4.0.3 (simu AVD) les changement (telnet) de position marche NIKEL

Cependant en 2.3.3 (simu) RIEN ne se passe et meme pire au bout de 30s environ l'écran devient tout noir...

Sur mobile pareil, le GPS s'active bien, mais rien ne se fait, je ne retourne plus dans position change et la position reste à lat 0.0 long 0.0

Voici le code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
61
62
63
64
65
66
67
68
public class Gps extends Activity {
 
	double latEnd;
	double lonEnd;
	double latStart;
	double lonStart;
	double distance;
 
	TextView tPosition;
	TextView tDestination;
	TextView tDistance;
 
	@Override
	public void onCreate(Bundle savedInstanceState){
 
		super.onCreate(savedInstanceState);
 
		setContentView(R.layout.gps);
		//On récupère l’Intent que l’on a reçu
		Intent thisIntent = getIntent();
		//On récupère les deux extra grâce à leurs id
		latEnd = Math.toRadians(thisIntent.getExtras().getDouble("latEnd"));
		lonEnd = Math.toRadians(thisIntent.getExtras().getDouble("lonEnd"));
 
		//Positionne les textes
		tPosition = (TextView) findViewById(R.id.textPosition);
		tDestination = (TextView) findViewById(R.id.textDestination);
		tDistance = (TextView) findViewById(R.id.textDistance);
		RefreshText();
 
		//On récupère le service de localisation
		LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
		LocationListener mlocListener = new MyLocationListener();
		mlocManager .requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0, mlocListener);
	}
 
	public class MyLocationListener implements LocationListener {
		public void onLocationChanged(Location location){
 
			double R = 6371;	// Rayon de la terre
 
			latStart = Math.toRadians(location.getLatitude());
			lonStart = Math.toRadians(location.getLongitude());
 
			distance = Math.acos(Math.sin(latStart)*Math.sin(latEnd) + Math.cos(latStart)*Math.cos(latEnd) * Math.cos(lonEnd-lonStart)) * R;
 
			RefreshText();
		}
 
		public void onProviderDisabled(String provider){
			Toast.makeText(getApplicationContext(),"Gps Désactivé",Toast.LENGTH_SHORT ).show();
		}
 
		public void onProviderEnabled(String provider){
			Toast.makeText( getApplicationContext(),"Gps Activé",Toast.LENGTH_SHORT).show();
		}
 
		public void onStatusChanged(String provider, int status, Bundle extras){
	}
	}
 
	private void RefreshText(){
		tPosition.setText("Position actuelle = " + latStart + ", " + lonStart);
		tDestination.setText("Destination actuelle = " + latEnd + ", " + lonEnd);
		tDistance.setText("Distance réstante = " + distance);
	}
 
}
Pouvez vous me dire ce qui cloche... (à savoir que mon telephone de test n'a pas internet en forfait et c'est un Desire S.

Merci a tous,

Bastien