Android Question How to access default SMS manager

ThRuST

Well-Known Member
Licensed User
Longtime User
(B4A) Hello I wonder how to start the default SMS manager intent in android? I have tried the packagemanager without luck, but I can read email that way but not SMS.

I can access the phones settings this way, perhaps it makes it easier.

Dim intent1 As Intent
intent1.Initialize("android.settings.WIFI_SETTINGS", "")
StartActivity(intent1)

Anyone?
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Thanks NJDude. I allready know how how to send SMS, I need to read them from intent and not any list (SMS main menu) from the SMS manager as specified in my post. Can you solve it? :)
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
I was hoping there was an intent available to access the 'SMS inbox message handler'. A running service was not really the prime answer to this question. Thanks anyway.
This is the closest I could get:

Dim intent1 As Intent
intent1.Initialize("android.provider.Telephony.SMS_RECEIVED")
StartActivity(intent1)

Perhaps you or someone else can help me solve it by looking at this page:
http://developer.android.com/reference/android/telephony/SmsManager.html
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
I solved this myself. Here's how to start the SMS inbox handler:

' Start SMS handler intent
Dim PM As PackageManager
Dim StartIntent As Intent
Dim iStr As String
Dim Packages As List

Packages = PM.GetInstalledPackages
For i = 0 To Packages.size - 1
iStr=Packages.Get(i)

If iStr.Contains("mms") = True Then
StartIntent=PM.GetApplicationIntent(iStr)
If StartIntent.IsInitialized Then StartActivity(StartIntent)
Exit
End If
Next
 
Upvote 0
Top