Recent

Author Topic: [lamw]App to runs permanently: How to  (Read 3705 times)

Luigi

  • New Member
  • *
  • Posts: 26
[lamw]App to runs permanently: How to
« on: March 19, 2018, 07:30:26 pm »
Hello,
I developed an app to control every hour if do anything, but the app can closed by press the X in the list of recent apps.
How I can runs the app as a service or in background?
I needs a GUI interactions with users.
Thanks
« Last Edit: March 20, 2018, 03:47:21 pm by Luigi »

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: [lamw]App to runs permanently: How to
« Reply #1 on: March 19, 2018, 08:44:43 pm »
You mean an app that can't be closed? Impossible on Windows and Unix and Mac. On these platforms any process can be murdered. Does not matter if it is a service or daemon.
It depends on rights. Give the proper rights or limit the rights.
« Last Edit: March 19, 2018, 08:46:45 pm by Thaddy »
Specialize a type, not a var.

Luigi

  • New Member
  • *
  • Posts: 26
Re: [lamw]App to runs permanently: How to
« Reply #2 on: March 19, 2018, 09:02:22 pm »
I need, in android phone, my app must show a message every hours. But is quite
simple to close the app.
I need to run my app as a service or in background, what I do?
Thanks

Luigi

  • New Member
  • *
  • Posts: 26
Re: [lamw]App to runs permanently: How to
« Reply #3 on: March 19, 2018, 09:08:13 pm »
I need that my app is like whatsapp that runs ever, even it is closed or in background.
Thanks

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [lamw]App to runs permanently: How to
« Reply #4 on: March 21, 2018, 06:34:16 am »
Hi Luigi,

about, there are

AppIncommingCallWidgetProviderDemo1

and

AppSMSWidgetProviderDemo1

in folder "....demos\GUI"
« Last Edit: March 23, 2018, 03:30:47 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: [lamw]App to runs permanently: How to
« Reply #5 on: March 21, 2018, 08:40:17 am »
I think he means the way Whatsapp runs forever in the background and not the functionality of Whatsapp.
You would need something like a watchdog/daemon/service that would respawn every x secs/minutes if it notices it's not running? start app on phone bootup etc.
BroadcastReceiver/Intent and permissions to start the app on boot?

I need that my app is like whatsapp that runs ever, even it is closed or in background.
Thanks
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

Luigi

  • New Member
  • *
  • Posts: 26
Re: [lamw]App to runs permanently: How to
« Reply #6 on: March 22, 2018, 03:27:52 pm »
I think he means the way Whatsapp runs forever in the background and not the functionality of Whatsapp.
Yes, you understand my problem.

Quote
You would need something like a watchdog/daemon/service that would respawn every x secs/minutes if it notices it's not running? start app on phone bootup etc.
BroadcastReceiver/Intent and permissions to start the app on boot?
What I do to deploy my app who starts on phone boot?

I tried to run my app and I notice that my app works correctly even in background, but my app is quite simple to stop working because it can kills by recent apps. Often my app is accidentally closed from recent apps :(

Then I search a way to modify/rewrite my app to runs like a service but service not have gui functionality. I need GUI functionality to interact with the users for get some parameters  :(

Thanks.

 

TinyPortal © 2005-2018