2
votes

I have an app which runs on iPhone and Android devices. I also have a server that transfers files and other data between the clients. Now, my question is about the android client.

Currently, I have a service that runs in the background and handles the output and input, to and from the server, and whenever a new data recieved from the server, the client will launch a notification to the user.

So, if the user go in to his device Setting and force to close the app, the service stops running and the data won't be recieved (the socket to the server will close and the server won't send him any data and will store it in the database for the next time the user launchs the app and connects).

So this is one approach, but another on is the Push Notifications, that will launch a notification even if the entire app including the service, is closed. But the downside is, the way I see it, that I need to use a 3rd party component in my app and it increases the complexity.

I need help to decide whether or not to use the Push Notification, and also, how common is this feature in other Android apps?

1

1 Answers

4
votes

as far as I understood you have a service always running with a socket connection always connected to your server. That is a HUGE battery consumption and probably is already a lot of unnecessary complication to your app.

the 3rd party component you're talking about is the Google Play Service, which is developed and maintained by the same people who created the Android OS (that's Google).

The "extra complication" you're talking about is to add a couple of permissions and a BroadcastReceiver on the AndroidManifest.xml and register your application on the GCM web-panel. Which is all detailed here https://developer.android.com/google/gcm/client.html

It's a VERY VERY VERY VERY VERY common thing in lots of apps. Facebook, Facebook messenger, Gmail, Weather apps with severe weather notification, WhatsApp, Skype, Twitter, pretty much anything with a "what's new" section, Foursquare. All of them uses push notification.

So to answer the question in a very direct way:

  • you definitely should use the Push notification.