Is it possible to create a native app that stay sleepy and from time to time connect to a webserver?

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

Hello Community,

i'd like to develop a new app but i don't think i will be able to do it native, for several reason (mostly $$$ and time).

The problem is that i need to send notifications, also if the user close the app, and if i just use a simple redirect on the website upon the run of the app, that will not be possible, right? (the user close the app, so the website and the api cannot talk each other anymore).

But what if i create a small (native) program that constantly poll (each every 5 mins or so) from the website API some kind of data (for ex: if there are new notifications, or what is the position of the user), and then if something match, it can popup the msg and when the user click on it "redirect" him to the website.

What do you think? it will work? other apps are using such method?

Thanks for your kind answers and have a nice day ^_^

S.C.
 
Hi, welcome to Android Forums

I'd like to recommend creating a account so me or other members can assist you, as guest have limitations in replying here and if we need further Information to communicate with you.

I'll provide a link to register, please come back to your post so we can further assist you . Thank you
https://forums.androidcentral.com/showthread.php?t=409154
 
Run a timer. Set it for a minute later. Then close it. You'll see that, even though it's not running, it still sounds off at the set time. It's using cron.

You can do the same hing with your app - have it set cron to wake it every 5 minutes (*/5 * * * * myapp), and poll the server when it wakes, then sleep. (The phone will probably have to be rooted and the user will probably have to install busybox - try it with and without.)
 

Members online

Forum statistics

Threads
955,878
Messages
6,965,990
Members
3,163,414
Latest member
dsfcdfcfdfc