Code example for LocationManager

Methods: requestSingleUpdate

0
			wakeLock.acquire();
 
		LocationManager locationManager = (LocationManager)
			this.getSystemService(Context.LOCATION_SERVICE);
 
		locationManager.requestSingleUpdate(LocationManager.GPS_PROVIDER,
			locationListener, null);
	} 
 
	public static boolean isRunning() { 
		return isRunning;
	} 
 
	private void showNotification() { 
		nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
		notification = new Notification(R.drawable.icon,
			"Trip Tracker Started", System.currentTimeMillis());
		PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
			new Intent(this, MainActivity.class), 0);
		notification.setLatestEventInfo(this, "Trip Tracker",
			"Sending location every " + freqString, contentIntent);