1

I need to find all applications (among installed ones) that can open SMS. I have already found Gallery applications through the following method:

PackageManager pm = getPackageManager();
Intent newIntent = new Intent(Intent.ACTION_VIEW);
newIntent.setType("image/*");
allApps = pm.queryIntentActivities(newIntent, PackageManager.MATCH_DEFAULT_ONLY);

It gives me the list of all apps that can open images. Is there any similar way by which I can find all apps that can open SMS Messages?

Faheem
  • 509
  • 2
  • 7
  • 23

3 Answers3

1

You need to set set type as vnd.android-dir/mms-sms

Try this code :

Uri uri = Uri.parse("smsto:123456789");  
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);  
intent.putExtra("sms_body", "SMS text"); 

OR

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.putExtra("sms_body", "SMS text");
intent.putExtra("address", "123456789");
intent.setType("vnd.android-dir/mms-sms"); 

Hop it will help you :)

SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74
  • @SweetWicher: Your First code gives me closest results but it shows Viber and Whatsapp also .... but these apps use Internet to send Messages ... not SMS Messages. Specifically I only need SMS Applications. Such as defauls Messaging App and Google Hangouts etc. – Faheem Oct 01 '14 at 09:53
0
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
raja
  • 368
  • 2
  • 13
0

Try this?

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_VIEW);
sendIntent.putExtra(Intent.EXTRA_TEXT,"Your Text");
sendIntent.setData(Uri.parse("sms:"));
startActivity(sendIntent);
Dhinakaran Thennarasu
  • 3,336
  • 4
  • 26
  • 39