GPS

Calling system settings from an Android app - GPS example

SDK Version: 
M3
This tutorial shows how to redirect the user to a system settings screen asking to modify some settings the application depends on. We will make a specific example with GPS: The application can be used only if GPS is available.

The android systems GPS setting screen can be called just like any other Activities:

  1. startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);

To check GPS availability use the code code below: (the Activity must implement LocationListener)

Syndicate content