Programmatically Send SMS without it showing in Messaging App - android

Is there a way to programmatically send sms messages without them showing in the Messaging app?
I am using the following code to send SMS:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("number", null, "message", null, null);
And the messages are showing in the default Messaging app aswell as Google Hangouts. For my application it would be ideal for the messages not to show up, as they are simply sending code to a GSM module, and they just fill up the users Messaging app.

If you aren't sending real texts, you should probably send a port based SMS which won't be added to the messaging DB. But if you can't, you need to delete it from the sms content resolver.
ctx.getContentResolver().delete(Uri.parse("content://sms/inbox"), {"body"}, messageBodyToDelete);

Related

send bulk sms on android sms app using api from another provider

I have a bulk sms site http://esmsafrica.com now I am building a sms app that will use the same API so that users registered on the site can still view there balance and send sms, I understand to use default smsmanager for android is below code, I have also searched on android developer page yet nothing seems to help, can someone let me know how to go about this, would I need to import any code from my site? I believe it should look like below code. I have a valid API code, username and password.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, senderID, message, sentPI, deliveredPI);

Send automatic message via android app

I'm just wondering is it possible to send a Message from the app without using actionView or actionSend ( meaning no asking for chooser to send via google or hotmail etc.. ) from the Intent ?
what I want to make is like a TextView and a Button
the user will enter a text in the textview and then click the Button to send the message, then the message will be automiatlly sent to the developer ( me )
I hope what I'm thinking of is possible.
I'm not sure what kind of message you are trying to send, but you can use the SMS feature of the phone to send not only a SMS, but an email, too.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("1"+yourPhoneNumber, userPhoneNumber, message, null, null);
You can replace phone numbers with emails and it will work without user interaction (unlike sending an email through an email client which cannot be done automatically). You can try it out by texting your own email. For your specific situation, you could set up a developer email that handles all of these messages that you are trying to send. The only issue with this is that you may not know who you are receiving messages from. For example, if you send a SMS -> email, it might show up as from something#vz.com or something. However, you can mitigate this by including addition info in the message payload itself.
Yes, it is possible. You can use the internet connection to have the message saved to some cloud storage or something. Personally, I prefer using Parse.com because they have an amazing API that saves you a lot of hassle.
Just add the message from the EditText to a ParseObject and call the saveEventually() method. As soon as the internet is back on, the message will be sent to your cloud storage.

Add text message entry into native messaging application in Android

In my application I am trying to send a text message with the following code and it's working fine. But when I check the native messaging application the message that i have sent from my application is not in the native messaging application. Am I missing something or is their any other code that I have to write, so that the text that I'll send from the application also get's updated in the native messaging application. The code that I am using is:
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(number, null, message, null, null);
Please let me know how can I create an entry in the native messaging application of this message.
Thanks..

How to use Service to receive sms and read sms from inbox and send sms message from inbox to another activity in Android?

I am working an Android project. In this project I am sending some data from android app to webserver.Now I am able to send data from Android client to WebServer using PHP- MySQL perfectly..Now my question is how to make an android app so that I can receive sms and after receiving sms, how to read sms from inbox and then how to send read(retrived) sms message to that app which is sending data(message) to webserver. I want to receive , read and send to an activity completely in a background.

Android: How to send SMS to email account

The stock Android text messaging app allows you to send SMS to an email account instead of a phone number. How is this done? I tried the following code and it failed.
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("myaccount#gmail.com", null, textMsg, sentPI, null);
This other question seems to be related How to send SMS message reply to email address?
... but the accepted answer says
Each cell carrier has a specific SMS number that you can send a text message to in a certain format. This is called a "SMS Gateway".
I want to send to my gmail account, not to AT&T.
Sorry, seems I misread the answer. Looks like my carrier (AT&T) will send the email for me. What puzzles me is how an app could work for different carriers?

Categories

Resources