Hallo,
I realized that to run the GPS function, the GPS android option has to be set to on. Can anyone share with me a code that will first check if the GPS is on, on the mobile phone before running the GPS function. If the GPS is not on then it should notify the enumerator to put on the GPS on the phone.
Kindly help.
How to check if GPS is on, on Android phone before running GPS Function
Re: How to check if GPS is on, on Android phone before running GPS Function
Could you try something like
if execsystem("app:com.android.gps") <> 1 then
errmsg("Unable to launch gps.");
endif;
where com.android.gps is the package name of the application that you are trying to launch.
if execsystem("app:com.android.gps") <> 1 then
errmsg("Unable to launch gps.");
endif;
where com.android.gps is the package name of the application that you are trying to launch.
-
- Posts: 1803
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: How to check if GPS is on, on Android phone before running GPS Function
Won't this work?
if gps(open) = 0 then
errmsg("Please turn on the GPS");
reenter;
endif;
errmsg("Please turn on the GPS");
reenter;
endif;
Re: How to check if GPS is on, on Android phone before running GPS Function
Thanks Gregory,
It works.
It works.