Question

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

Was it helpful?

Solution

Following this link to implement a BroadcastReceiver that will listen for incoming SMS.

Inside your onReceive from your BroadcastReceiver, handle your logic (print/save/..)

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top