Hi Erel and everyone,
I wanted to give a final update and share the solution that worked for me.
Device: Samsung Galaxy A35 – Android 16 (One UI 8)
After many tests, my app now successfully appears in the default SMS list (Settings > Apps > Default apps > SMS app) together with Google Messages and Samsung Messages. When I open Google Messages while it's not default, the selection dialog appears and my app is also listed there.
I worked on
TestSMSdefaultapp.zip sample (post #28 in the linked thread with minor changes):
However, on this newer Samsung device, calling RoleManager.createRequestRoleIntent("android.app.role.SMS") from inside my own app does
nothing – no dialog appears at all.
The reliable workaround is to open the Default apps settings page directly and let the user choose manually:
basic
Sub RequestDefaultSms
Dim i As Intent
Dim P As Phone
Dim sdk As Int = P.SdkVersion
Log("Sdk Version ==> " & sdk)
If sdk >= 29 Then
Dim jo As JavaObject
jo.InitializeContext
Dim roleManager As JavaObject = jo.RunMethod("getSystemService", Array("role"))
If roleManager.RunMethod("isRoleAvailable", Array("android.app.role.SMS")) Then
Log("android.app.role.SMS is Available")
If Not(roleManager.RunMethod("isRoleHeld", Array("android.app.role.SMS"))) Then
' Dim requestIntent As Intent
' requestIntent = roleManager.RunMethod("createRequestRoleIntent", Array("android.app.role.SMS"))
' StartActivity(requestIntent)
i.Initialize("android.settings.MANAGE_DEFAULT_APPS_SETTINGS", "")
StartActivity(i)
ToastMessageShow("In DEFAULT APPS page, find the 'SMS app' section and select your own application.", True)
Else
Log("isRoleHeld")
End If
Else
Log("android.app.role.SMS is not Available")
End If
Else
i.Initialize("android.provider.Telephony.ACTION_CHANGE_DEFAULT", "")
i.PutExtra("package", Application.PackageName)
StartActivity(i)
End If
End Sub
This opens Settings > Apps > Default apps directly, where my app is visible and can be selected without any problem.
I've attached a minimal working project (exported as zip from B4A) that demonstrates this. It includes the full manifest setup and the code to guide the user to the settings page.
Thank you very much Erel for the original sample and the help – it was the key to getting the app qualified!
Hope this helps others with newer Samsung devices.