Is there anything like GCM for offline communication? - android

Seems like GCM for Android only works if there is internet. Wondering whether there are any other methods (maybe via text/call, etc) that could trigger a background service which would send back user's location (via text, etc. or maybe keep it until connection is present)?
My two concerns are:
How much can I do without the user doing anything (or even knowing it's happening... assuming they downloaded the app already and gave appropriate permissions)?
How would I send the data back? (if via text, Reason #1 seems to be a bigger matter)

Here is an alternate solution but it is costly,
Create Broradcast Receiver that listen for incoming SMS.
In any sms with start some predefined word like "START_SERVICE" is arrived then fire the broadcast and start the service you want.
You may use normal SMS scheme or any bulk sms kind of service.
The above scenario doesn't require any INTERNET connection at all.

Related

Are there things like an Android trigger

I have never developed something in Android before, but now my company has put me on a project which includes android.
My question is this: Is it possible to write an application that runs in the background and waits for triggers (if that is the correct word for it). For instance lets say I want my application to do something as soon as you open your emails or as soon as you get an email. Is there some API that I can use to interact with other applications such as Mail. The application does not have to have any GUI, it will literally just push some information notifications on the mail just received or opened.
I don't require a to technical answer, but rather just yes or no, and indeed yes, where can I get more info on it. Also if it is not possible, is there some workaround to achieve this. I have googled it, but most of the links are how to send an email from your application.
Thanks
EDIT: So it can even be triggered when a notification is received. Then I just want to look at the notification and determine if it is an email?
You could register BroadCastReceiver for the actions that you need to be caught

Intercept incoming flash messages on android mobile

can anyone help me to intercept the incoming Flash messages (specially the ones from the telecom company, where they send our current balance after some activity like message sent).
My application deals with sending SMSes in bulk and I don't want the flash message popping now and then. So is it possible on Android ?
EDIT: Everyone says its not possible above Android 1.6 but I found a similar App on Google Play but I want the source of that kind of App. Please Help.
Edit: More than a year has passed and still I didnt got the solution. Can anyone help to resolve this thread..??
Might depend on the channel [of communication] used by your service provider. I guess they don't use SMS, probably they use WAP/PUSH or some pre-installed provider app for the notifications, which makes this harder to block. If it was SMS, you'd definitely have lots of ways to block their notifications, but in this case, I doubt there might be an easy / direct way to do this.
Flight Mode should ideally block telco / service-provider messages / notifications, but then this also blocks your connectivity, right? So, am not so certain on this one. Isn't there a way to opt-out of service provider notifications, maybe via a ussd routine? I've heard of this once...
Flash sms it is the same as usual sms except data coding flags. It has "class 0" indication in DCS.
For details about sms coding see: GSM 3.38 specification / 4 SMS Data Coding Scheme.
Some fragment from spec about it
When a mobile terminated message is class 0 and the MS has the capability of displaying short messages, the MS shall display the message immediately and send an acknowledgement to the SC when the message has successfully reached the MS irrespective of whether there is memory available in the SIM or ME. The message shall not be automatically stored in the SIM or ME.
So, in most cases, phone just displays this message and skips usual chain of actions.
Probably, you can't catch this message with usual API... probably you need deep hook and rooted device.
[Or may be just switch off this service by calling customer support?]

Is it possible to fake an incoming SMS on Android?

In a certain situation, I'd like my app to be able to "fake" an incoming SMS on the user's device, as a sort of notification. This would save me money when I'd normally use Twilio to send a text to my users but I know they already have my app. Is there any way to do this? I imagine it would have something to do with Intents and Content Providers but I don't really know where to start.
To clarify:
I'm not new to Android and I do respect all of the normal Notification methods. However, my app will have an opt-in for text messages and I'd like to be able to trigger them for free rather than paying for it. This is for SMS-specific uses and not as a substitute for a normal Notification.
Yes (although I really don't support doing this) it is, in theory possible by creating and broadcasting the proper intent. Specifically, they android.provider.Telephony.SMS_RECEIVED intent will be received by anybody who is listening for SMS messages, including the default SMS application. This will in turn cause the notification to be displayed.
All of that said, I've only ever done this in a custom version of Android from within the system process. I'm really not sure if a generic application can do this (in fact, I kinda doubt it). The other caveat is that you will need to formulate your data into PDU's which represent the binary data format of an SMS message. You can look this up, but it's nontrivial.
A far better approach would be to simply have your application display a notification in the tray, the way well behaved applications are supposed to notify the users of events. Take a look at the Notification class.
If you install the apk named ApiDemos-debug.apk that usually comes installed with your choosen platform for the SDK, you will find an example in
<Api Demos> > App > Notification > IncomingMessage
the complete source for this package is usually under
<SDK root>/samples/android-xx/ApiDemos

Triggering Intents remotely in Android

I am writing an Android app that talks to a server. The server has information that is updated irregularly, and the app must be informed of each update. My current solution is to have the app query the server at regular intervals to see if the information has been updated.
Is there any way to have the server initiate the interaction (say, only when the information is actually updated)? I have heard about "Remote Intents" which simulate this behavior, but I have not been able to find any information on them. Does anyone have any advice on how to make this work?
Read up on Cloud To Device Messaging. This is designed to do exactly what you're looking for.
You could have the server send out an SMS message, and the application checks for a certain pattern (perhaps starts with something known). The data is extracted from the message and the notification is raised.
This question deals with how to analyze incoming messages:
How to analyze incoming SMS on Android?

Listen for certain incoming SMSes

Is it possible to have an app listen for all incoming SMSes and take some action on certain ones?
I read through as many of the similar questions as I could but ended up more confused.
Basically, what I want to do is this:
Every time a new SMS is received, the app checks either the sender or the text, and if a certain string is found shows a message on the screen (Toast, for example).
The app doesn't have a GUI, and if possible I would like to to be running all the time in the background.
If possible, I would also like any SMSes that are shown this way to be deleted before they reach the inbox (or automatically deleted just after).
So, is this at all doable?
Yes this is very possible. With the implementation of a BroadcastListener you could easily be able to determine when an SMS is received by registering the listener to listen to that broadcast. Then in that broadcast receiver code you implement a check for the text of the message. Then do a string compare with what you are looking for and then execute a function.
However; deleting the message from the inbox.. may take a bit of research, i'm not absolutely sure if its possible to delete SMSes programatically, but it wouldn't surprise me if it is included in the API, although, I've never seen it.

Categories

Resources