2

I am developing an application that needs to know the package name of the SMS application that comes with all android devices. People say that it is com.android.mms but this isn't always true.

In Sony Xperia devices the package name isn't com.android.mms because my application can't open SMS application in those devices. My application works well on Samsung, Huawei and LG devices, but in Sony Xperia seems that the package name of SMS application has changed.

The reason for this is that I have to register a BroadcastReceiver to get my application notified when the SMS database changes. I tried with ContentObserver but in LG devices it does't work. I also put that question in Stackoverflow but no one knows the answer yet, so I want to try with this BroadcastReceiver approach. As I said, the package name com.android.mms is wrong for the Xperia, so until I know it, the following code of my manifest will not work for my BroadcastReceiver:

<receiver
    android:name="windowsmobilewidget.backend.observers.MessagesChangesReceiver"
>
    <intent-filter>
        <action android:name="android.intent.action.PROVIDER_CHANGED"/>
        <data android:scheme="content"/>
        <data android:host="com.android.mms"/>
    </intent-filter>
</receiver>
user3289695
  • 740
  • 1
  • 9
  • 20
  • 2
    "I am developing an application that needs to know the package name of the SMS application that comes with all android devices" -- not all Android devices have one SMS application. Many will have none (e.g., tablets). Some could have more than one. – CommonsWare Feb 22 '14 at 10:48

2 Answers2

1

Check this PackageManager provides methods for querying and manipulating installed packages and related permissions, etc.

But if you don't mind me asking , why link to the package directly?

This might be a workaround

Community
  • 1
  • 1
Nour
  • 777
  • 1
  • 8
  • 25
  • Thank you. The problem is that I need to hardcode the package name in the manifest. If you see the changes I made in the question, you'll understand why. – user3289695 Feb 22 '14 at 13:21
0

Based on testing on a Xperia Z3C running Lollipop (5.1.1), I think the stock SMS app is com.sonyericsson.conversations

John Cummings
  • 1,949
  • 3
  • 22
  • 38