makis_best Well-Known Member Licensed User Longtime User Nov 22, 2019 #1 Hi. How I can disable GPS functionality if a device doesn't have GPS device. Thank you
Solution Erel Nov 26, 2019 Code: Copy Sub HasFeature (Feature As String) As Boolean Dim ctxt As JavaObject ctxt.InitializeContext Return ctxt.RunMethodJO("getPackageManager", Null).RunMethod("hasSystemFeature", Array(Feature)) End Sub Feature: "android.hardware.location.gps"
Code: Copy Sub HasFeature (Feature As String) As Boolean Dim ctxt As JavaObject ctxt.InitializeContext Return ctxt.RunMethodJO("getPackageManager", Null).RunMethod("hasSystemFeature", Array(Feature)) End Sub Feature: "android.hardware.location.gps"
Erel B4X founder Staff member Licensed User Longtime User Nov 24, 2019 #2 I don't understand the question. Do you want to check whether GPS is enabled? Upvote 0
makis_best Well-Known Member Licensed User Longtime User Nov 25, 2019 #3 I want to check if GPS device exist in the device I install the application Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 26, 2019 #4 Code: Copy Sub HasFeature (Feature As String) As Boolean Dim ctxt As JavaObject ctxt.InitializeContext Return ctxt.RunMethodJO("getPackageManager", Null).RunMethod("hasSystemFeature", Array(Feature)) End Sub Feature: "android.hardware.location.gps" Upvote 0 Solution
Code: Copy Sub HasFeature (Feature As String) As Boolean Dim ctxt As JavaObject ctxt.InitializeContext Return ctxt.RunMethodJO("getPackageManager", Null).RunMethod("hasSystemFeature", Array(Feature)) End Sub Feature: "android.hardware.location.gps"
makis_best Well-Known Member Licensed User Longtime User Nov 26, 2019 #5 Perfect @Erel Just what I needed... Upvote 0
M Mahares Expert Licensed User Longtime User Nov 26, 2019 #6 makis_best said: Just what I needed Click to expand... Hey! @makis_best : Why don't you start giving 'Like' to people helping solve your problems in the forum; and you have been getting a lot of help lately. Upvote 0
makis_best said: Just what I needed Click to expand... Hey! @makis_best : Why don't you start giving 'Like' to people helping solve your problems in the forum; and you have been getting a lot of help lately.