user3898539
user3898539

Reputation:

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.

Upvotes: 0

Views: 189

Answers (2)

Brent McFerrin
Brent McFerrin

Reputation: 528

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 [email protected] or something. However, you can mitigate this by including addition info in the message payload itself.

Upvotes: 1

An SO User
An SO User

Reputation: 25018

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.

Upvotes: 0

Related Questions