L lymey Active Member Licensed User Longtime User May 23, 2014 #1 This may be a silly question, is it possible to amend this part of the code to run in a Service? If not, how can you get the default package? Thanks! Code: Copy Dim context As JavaObject = Activity context = context.RunMethod("getContext", Null) Dim so As JavaObject Dim package As String = so.InitializeStatic("android.provider.Telephony.Sms").RunMethod( _ "getDefaultSmsPackage", Array As Object(context))
This may be a silly question, is it possible to amend this part of the code to run in a Service? If not, how can you get the default package? Thanks! Code: Copy Dim context As JavaObject = Activity context = context.RunMethod("getContext", Null) Dim so As JavaObject Dim package As String = so.InitializeStatic("android.provider.Telephony.Sms").RunMethod( _ "getDefaultSmsPackage", Array As Object(context))
Erel B4X founder Staff member Licensed User Longtime User May 23, 2014 #2 Do you want to detect the OS version or do you want to run this code? Upvote 0
L lymey Active Member Licensed User Longtime User May 23, 2014 #3 Sorry, I wasn't very clear! I want to be able to detect the OS version ( I can do that with phone sdk) and then run this code to see what SMS app is the default. This will be done in a service. Upvote 0
Sorry, I wasn't very clear! I want to be able to detect the OS version ( I can do that with phone sdk) and then run this code to see what SMS app is the default. This will be done in a service.
Erel B4X founder Staff member Licensed User Longtime User May 23, 2014 #4 Use the code posted here to get the context: http://www.b4x.com/android/forum/th...onaljar-and-javaobject-picasso.40904/#content Upvote 0
Use the code posted here to get the context: http://www.b4x.com/android/forum/th...onaljar-and-javaobject-picasso.40904/#content
L lymey Active Member Licensed User Longtime User May 23, 2014 #5 Thanks Erel, that was easy! Is there a way of 'listening' for a change in the default SMS app setting - So if the user changes the setting, the service can detect it? Upvote 0
Thanks Erel, that was easy! Is there a way of 'listening' for a change in the default SMS app setting - So if the user changes the setting, the service can detect it?
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #6 Not that i know of. Upvote 0