Turn on GPS for Android 4.0

wantlin

Member
Licensed User
Longtime User
Hi All

I have problem for GPS . I want to turn on GPS on the Android 4.0 OS.
Do you have good idea for me ? Thank you !

Kim
 

genesi

Active Member
Licensed User
Longtime User
Hi
Due to privacy concerns the Android OS doesn't allow you to turn the GPS on programatically, and it seems reasonable
Mario
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Look at the GPS tutorial.

The tutorial code shows:

B4X:
    If GPS1.GPSEnabled = False Then
        ToastMessageShow("Please enable the GPS device.", True)
        StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
    Else
        GPS1.Start(0, 0) 'Listen to GPS with no filters.
    End If

Does that work with ICS?
Can you test for GPSEnabled property and if it is False then start the Location Setting options?

Martin.
 
Upvote 0

wantlin

Member
Licensed User
Longtime User
 
Upvote 0

wantlin

Member
Licensed User
Longtime User
Hi
Due to privacy concerns the Android OS doesn't allow you to turn the GPS on programatically, and it seems reasonable
Mario

Hi Mario

Thank you .
Yes , I know ,but I want to know my phone location ,but I can not open GPS device always.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…