Android Question Detect OS version in a service (i.e KitKat)

lymey

Active Member
Licensed User
Longtime User
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!
B4X:
  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))
 

lymey

Active Member
Licensed User
Longtime User
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

lymey

Active Member
Licensed User
Longtime User
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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…