Android Beam - special usecase - android

I have this use-case for Android Beam. I could have tested it myself but my app is not available in Google Play yet.
Here it goes:
I want to beam some content from my phone and the receiver phone does not have it. So with AAR, the app will be fetched from Google Play on the receiver phone. So far so good. So I download and login.
My question is: Once the app is downloaded will the receiver app still have the information that was beamed or should the sender initiate Beam again? Will my data in first Beam be lost? How should this be handled?
Theoretically, the onResume should be called to handle the intent.
Any thought if someone has come across such a kind of case.

The data will be lost, unfortunately. Think of it as if the NDEF message with the AAR will have been delivered to the Play Store app. (The Play Store app will not be able to deliver it to your newly installed app.)
The only solution is to Beam again.

Related

How do popular apps like WhatsApp and Instagram receive push notifications even while the app is closed

I am creating a native social app which includes features such as Direct Messages, Voice and Video Calls etc and I have been trying to find a way to be able to receive data payloads from Firebase Cloud Messaging containing values such that I create a custom notification based on the type values from the data payload eg for VOIP calls I’d like to set a remoteInput action to see if a person declines or accepts a call or for direct messages add a remoteInput action for a quick reply and so far I haven’t had any luck especially with background services not being allowed anymore ever since the release of Android 8.1. So I would like to know if there’s a workaround I’ve been missing or if it’s even possible and if it is how do these popular apps do it. Thank you in advance.
Its same as your mentioned, once after the release of 8.1 apps are now more strict in regarding the background running process. There are actually two insights I had received while developed some projects. 1) More the app is used by the user, the app is sort of whitelisted and can receive more notifications, i.e., the system actually tracks the frequency of app usage. 2) You have the possibility to ignore your app from battery optimization process hence more chance of background process to run.

Send a data to one android phone to another android phone

There is a scenario where I have to communicate from one android device to another android device (Far Away). But without using any server or sms service. Although I do have an active internet connection. I found a way through GCM, as GCM service provide data upstream as well as data downstream.
I want to know is there anymore way of doing this ?
You need a notification service, and google has something like that for us...
how does this works??
Take a look at the image below,
you need to register your android app in the google service, and your web interface will need an id, so everytime you want to push something to the android, your web interface instead will push it to the google server with the Id of the app, then google (no matter how) will localize your app, and even if its not running, they will get the notification,
behind the scenes there is a couple of thing that you must do, bu nothing like launching rockets from the NASA.
I will suggest to take a look to some tutorials
in order to start with the registration of your app, get the api key etc etc..
In your case
you will need the id of the other phone, so you can push it data.

Does whatsapp use c2dm aka GCM on android?

I always thought WhatsApp uses c2dm for message delivery. But when I see running apps MessageService is always running. You don't need a service to be run to receive c2dm.
Why keep the service running all the time?
Facebook is even more strange they have 3 services running. One of them is for uploads. Did they start stealing my photos?
Like cached background proccess say - this is an old application proccess that is being kept for better speed in case it is needed again. I suppose, same thing happening with services
WhatsApp uses something like XMPP
WhatsApp uses a customized version of the open standard Extensible Messaging and Presence Protocol (XMPP).
See: http://en.wikipedia.org/wiki/WhatsApp
I'm using GCM myself for a chat application for Android. It's still not working properly if the device is idle for a long time.

Android :Get Online or Offline status through SERVER

I am creating a app in android 4.0.3 i.e ICS version, which connects to the server when client gets login into the app.I am trying to get status of an client when he gets online or offline through server & seen onto the app screen.I am unable to proceed. Can anyone say me:
Is it possible to get the status of an user through server?
1-- How to proceed for first step...?
2-- How should I get a response from the server that the client is connected & viewed to other client example - when we login into skype our status shows available with green radio button, In same way how can I get it.?
It ll be very help full, If anybody guide me.
Many Thanks..
I'm assuming you're trying to develop a chat app ?
If this is the case, try using an XMPP library. XMPP is widely used for chat apps, including Facebook chat (and Google talk I think) and there are plenty of open source libraries available.
Otherwise, if you only want real-time notifications as a part of a bigger picture, try using push notifications. Google supports Cloud to Device Messaging (C2DM) for android. It allows to have push notifications to a specific device without you having to deal with persistent connections, battery and CPU use .etc.
C2DM approach comes down to this. When a client connects to your server, get a list of his friends and their 'C2DM IDs' and fire a C2DM push to their devices. This push is delivered to your app, and you can respond to it by firing a notification, or update UI .etc. (Your app doesn't necessarily have to be running. Push notification is delivered via a specific broadcast, and your app can register a receiver for it to wake up.)
Keep in mind that there is a quota for C2DM messages per device, per app and also a limit for the payload per message. So you're not supposed to send massive files via this. Just a notification to your app, so it can call your server and get an updated list, instead of polling.
You can get more info on C2DM and code samples here. https://developers.google.com/android/c2dm/
Hope this helps.
You may have moved on, but I'm posting for anyone who would run into this one in the future.
Firebase is a good solution to use in this scenario, if the app is always running when you want communication to happen. (It will not wake up your app as C2DM/CDM does, unless you have a service running all the time and still wouldn't wake up if the device is asleep... AFAIK)
It may be useful for some scenarios, but may be not for a chat app as you want the device to wake up when a message arrives.
Note that they have limitations on the free subscription though.

How to catch application uninstalling on device and let server know about this (iOS/Android)

Problem Description:
We have a service which has applications for main mobile OS’s. We use push notifications. When user is log in, we store his device authorization data (lets say token) for later use in the push service. The problem is about few device authorizations for one user and properly keeping them valid when the user uninstall the application.
Example:
I gave my login to system to a few people, in case to try it. They logged in through the mob. application and the system automatically add a few device authorizations into database (tokens). So now we have N device tokens for 1 user. So that if we send push notification everyone will receive it. Now, suppose those who have installed applications want to uninstall it. Without logout they uninstall application through application manager. And at this time we have NOT VALID data for authorized device. And if we try to notify them, notification will be sent nowhere. Which is wrong, and useless work for server. How to let the core know that some of stored data is no longer valid?
Shortly – is there any possibility in Android / iOS to trigger application delete event. If the application is being delete application call server to clean-up data in the storage. Or if the application is open and the user uninstall it, would there onDestroy() trigger fired? Or some other?
I’m not iOS developer, not Android developer, just know a little about second one and nothing of the first. Any advice will be appreciated. Thanks in advance.
I cannot speak for iOS. You cannot get control when your application is uninstalled in Android.
That depends on which push service you are using. Afaik, if you are using C2DM, the act of uninstalling the application will automatically unregister it from C2DM.
Edit:
Oh, and about iOS - afaik it does not directly track uninstalled apps, it does however come with a failed notification feedback service that after a sequence of failed notifications (reported by the device to the push network) will notify you - allowing you to clean up after an uninstalled app.

Categories

Resources