Send SMS on Android to itself - android

I need to write a service that translate short messages obtain from JSON and transform it to a SMS. Is it possible for an Android service to send itself SMS? If so, which lib or api?
(In some way, fake SMS.)

The only way you have to get an SMS in the inbox is to send a regular message to the own phone number (you may incur in two sms charges, so be careful on how you use it).

Related

Modifing SMS before sending in android

I was wondering if it's possible to modify the SMS before sending it in Android, but not only if it's send by my application, but also if it's being send by other applications. My application would work in the background and wait for an sms sending, and when that occurres it prevents it from doing so, modifies it and sends it.
For example, a default SMS application(built-in or otherwise) sends an sms to someone and I want to catch it before it does, modify the body(like add new receiver or some text inside message itself).
I think that this: Can I modify sms_body before sending SMS with built-in SMS Application? might be an answer to my question, but I'm not sure, and it's kind of old.
Let me know if I was unclear in something. Thanks.
Let me try with simple example-
Its just like you have an Account in a Bank and you wish all deposit should come in your Account. Here Account refers to your App and Bank refers to your Mobile device.
In a short, you can't achieve this on a non-rooted device. Yes that is possible on non-rooted device if user like to send his messages from your App, then surely you can modify messages written by user.
not only if it's send by my application, but also if it's being send by other applications
This is not possible, except perhaps on rooted devices.

Receive specific SMS and elaborate it with an Android app?

sorry fo my complete ignorance developing an Android.
I'm asking about the feaseability of this pseudocode I would like to implement as native app; let imagine a task that:
when a specific SMS arrive (only those sent from a specific sender number)
possibly (multi-SMS in case of text bigger than 160 chars )
elaborate/format each received SMS:
. save text content on a local db
. print text on a bluetooth printer
. reply to sender with some sort of "ACK" SMS
BTW, what above could be sort of background task, and I would need on foreground a sort of user interface that visualizes received SMS and do some user actions (sending back SMS to sender)
Is all that possible on Android ? Any issue ?
I mean, above all: is possible to "catch" specific SMSs (by example those sent by a specific sender number), living unalterated the usual SMS workflow for ALL other SMSs ?
Sorry for my beginner question and Thanks for your patience
giorgio
www.giorgiorobino.com
Following this link to implement a BroadcastReceiver that will listen for incoming SMS.
Inside your onReceive from your BroadcastReceiver, handle your logic (print/save/..)
It is possible, yes. But not recommended. That being said the way to set this up is to catch the SMS intent, so your app would be started when an SMS is received. Otherwise it would not run at all (as long as you don't have any other interface open). For a code example on the message interception part, see this post. For the database part look up local storage on android phones. Look up on SMS messaging for the reply. Not sure how bluetooth printing would work as I've never done it, but if it's a standard protocol I'm sure there's either built in support or a library for it.

Android sms notification issue

I'm having some trouble with my app. I'm inserting programmatically sms to test into inbox folder,
but i cannot "simulate" original sms notify. I don't want to make my own, but i want to call the original one. The message is in inbox folder, with status unread.
Otherwise, is possible to refresh "sms inbox", such a way to recognize the unread sms and provide to notify themself?
Thanks
I don't want to make my own, but i want to call the original one.
There are thousands of Android device models. These ship with dozens, perhaps hundreds, of default SMS clients. In addition, users can install their own SMS clients.
A few, at most, might provide some sort of documented and supported API by which they would trigger this notification. You will need to contact each SMS client vendor directly and ask them if they offer such a capability.
Moreover, what you are trying to do (modify the SMS inbox) does not work on Android 4.4+ unless you are the user's chosen SMS client, in which case it is your job to show the notification.
is possible to refresh "sms inbox", such a way to recognize the unread sms and provide to notify themself?
Again, a few SMS clients, at most, might provide some sort of documented and supported API by which they would trigger this notification.

Manipulate incoming SMS in Android

How to manipulate certain incoming SMS messages in Android?
I want to change sender number before message will reach Inbox (so all text messages coming from a range of numbers wold be grouped into single conversation).
Can this be done from broadcast receiver of android.provider.Telephony.SMS_RECEIVED intents?
I dont think you can do it. What you get through android.provider.Telephony.SMS_RECEIVED, the data is a copy, so even if you change it wont be changed for other Recievers. You can block it from going to other Broadcasts, but not change it and rebroadcast
What you could do is manipulate using contentProvider of SMS . You will need WRITE_SMS permission
You cannot modify incoming messages in "stealth mode" and you cannot replace broadcast with your fake message without rooting and platform modifications. You can try to play with SMS using content provider but you need WRITE_SMS permission so your intentions would be clear to many.

Android and consume SMS

I write application which will get data from received SMS. This is data only for application and I dont want to user can read this message. Is possible to consume SMS just after get data from them to prevent user from reading this SMS? Thanks for any help.
You will need a sms receiver see http://davanum.wordpress.com/2007/12/15/android-listen-for-incoming-sms-messages/
Maybe you need also to delete the received sms.
Yes, this is easy to do. See my answer here for how to do this:
SMS receive with no notification
Once you've confirmed that the SMS is one of your special ones, you just need to call abortBroadcast() to stop it going into the user's inbox:
// Stop it being passed to the main Messaging inbox
abortBroadcast();
You should also be aware that the SMS receiver will not intercept SMS messages sent to the user's Google Voice number, as by default those messages will be downloaded over the data connection and displayed by the Google Voice app. If their Google Voice number is configured to forward the SMSs to the phone then those will be handled fine by the SMS receiver.

Categories

Resources