user3333414 user3333414 - 6 days ago 6
Android Question

Is there an Android Wear sms intent?

I've been trying to make a social media app that lets you send texts to your contacts from the watch. Is there an intent that does that for Android Wear?

I tried using the one from developer guides, but I get the error: "No Activity found to handle Intent { act=android.intent.action.VIEW typ=vnd.android-dir/mms-sms (has extras)".

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setData(Uri.parse("smsto:")); // This ensures only SMS apps respond
intent.putExtra("sms_body", "Hey, I am at {location}. Want to meet up?");
intent.putExtra("address", phoneNumber);
if (intent.resolveActivity(getActivity().getPackageManager()) != null) {
getActivity().startActivity(intent);
}`

Answer

Android Wear devices don't have any Telephony features. You have to put your data to the phone (using the DataLayer) and send the intent from it.