termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.26k stars 449 forks source link

Add alternate termux-sms-send method? Feature Request. #118

Closed wb666greene closed 4 years ago

wb666greene commented 6 years ago

I'm new to termux and find it amazingly useful. One problem I'm having is that super low cost carriers that try to do as much as possible with voip (Freedompop for example) instead of using the cell networks seem to run their messanging apps in "parallel" to the default Android Messenger and thus termux-sms-send messages end up in Android Messenger instead of the app that would actually send them. I see them in the conversation "history" but they never get sent, despite the proprietary messaging being set as the default.

Would it be possible to add an alternate termux method, say something like termux-sms-sendx , or a command line option switch to use Implicit Intents as an alternative to using the SMS Manager API?

I found this code snippet for using implicit intends:

String phoneNumber = "9999999999";
String smsBody = "This is an SMS!";

// Add the phone number in the data
Uri uri = Uri.parse("smsto:" + phoneNumber);
// Create intent with the action and data
Intent smsIntent = new Intent(Intent.ACTION_SENDTO, uri);
// smsIntent.setData(uri); // We just set the data in the constructor above
// Set the message
smsIntent.putExtra("sms_body", smsBody);

startActivity(smsIntent);

I don't know how you'd specify the alternate app.

I've never done any real Android programming although years ago at the Android 2.4 level, I did write a java method to talk to a proprietary device over Bluetooth to stream the data to Android, a real Android programmer used it -- he didn't understand the external device, I didn't understand Android, it was an efficient solution to the task.

ghost commented 4 years ago

Closing as SMS feature was removed in https://github.com/termux/termux-api/commit/de44896a01111506590a258f0267400af067b778.