Recent

Author Topic: LAMW + FirebaseMessaging + JobScheduler  (Read 947 times)

CC

  • Full Member
  • ***
  • Posts: 149
LAMW + FirebaseMessaging + JobScheduler
« on: October 30, 2019, 11:22:47 am »
Hi!

I would assume it is quite a common task to handle cloud messages even when the device is sleeping and prevent it from going to sleep mode before handling the the message is finished.

I had and Android studio project to do this based on WakefulBroadcastReceiver (url]https://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver[/url]) but it is deprecated  now.

Has anyone  done this with LAMW?  As always a sample project is the most useful to learn how it is done.

Thaddy

  • Hero Member
  • *****
  • Posts: 14367
  • Sensorship about opinions does not belong here.
Re: LAMW + FirebaseMessaging + JobScheduler
« Reply #1 on: October 30, 2019, 11:46:24 am »
I would assume it is quite a common task to handle cloud messages even when the device is sleeping and prevent it from going to sleep mode before handling the the message is finished.
No. That's battery murder on long tasks. I remove such software immediately.
That said: write your software such that it can resume and recover. And take care about server- and client side.

What you suggest is the completely wrong approach. I hope it is not by design....
Serious software development can not be done on a shoestring.
« Last Edit: October 30, 2019, 11:57:52 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

CC

  • Full Member
  • ***
  • Posts: 149
Re: LAMW + FirebaseMessaging + JobScheduler
« Reply #2 on: October 30, 2019, 03:12:53 pm »
Thaddy,

I assume that  you have no chat apps, no viber , no skype, nothing this sort on your devices. :)
 
There are couple of things which effects the actual battery usage and need to be considered, but being online is a must have in some cases. All my up and coming applications require all sorts of messaging across different servers and clients. And this is most definitely the right way to do it for Android. It is the most energy efficient way to stay connected while ensuring that the received messages are delivered to the user properly and the sender receives the acknowledgement about the delivery.

 

TinyPortal © 2005-2018