[Andoid]Continue the application when it is minimized

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

[Andoid]Continue the application when it is minimized

Postby Lena » Sat May 28, 2016 4:52 am

I use component TBeacon and its events OnEnterBeacon and OnExitBeacon.
If I minimize the application screen android device, then after a while it ceases to perceive events OnEnterBeacon and OnExitBeacon. How do I get a minimized application from the android screen continued to work?
Thanks.
Lena
BCBJ Master
BCBJ Master
 
Posts: 419
Joined: Sun Feb 06, 2011 1:28 pm

Re: [Andoid]Continue the application when it is minimized

Postby rlebeau » Sun May 29, 2016 2:52 pm

Managing the Activity Lifecycle

Long story short, once the user can no longer see your app, it moves to the background and becomes subject to termination if the user does not switch back to the app for while. That is just how Android works. If you need to perform operations in the background, like listening for events, you may have to implement that logic in a service instead.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1375
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: [Andoid]Continue the application when it is minimized

Postby Lena » Sun May 29, 2016 9:19 pm

Thank you.
It is an enterprise application for the control of people in their workplace. While employees are in the company, he is obliged to include this application.

you may have to implement that logic in a service instead.


I can not make the Android service because it is not supported in C++ Builder Berlin. :(
Lena
BCBJ Master
BCBJ Master
 
Posts: 419
Joined: Sun Feb 06, 2011 1:28 pm

Re: [Andoid]Continue the application when it is minimized

Postby rlebeau » Mon May 30, 2016 10:15 am

Lena wrote:I can not make the Android service because it is not supported in C++ Builder Berlin. :(


Unfortunately, not yet. You will have to use something else to make it. Delphi, Java, etc.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1375
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: [Andoid]Continue the application when it is minimized

Postby Lena » Fri Jun 24, 2016 12:30 am

I found a solution in the examples:
C:\Users\Public\Documents\Embarcadero\Studio\18.0\Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\AndroidBeaconServiceDemo
Naturally it Object Pascal :cry:
I will try to understand.
Lena
BCBJ Master
BCBJ Master
 
Posts: 419
Joined: Sun Feb 06, 2011 1:28 pm

Re: [Andoid]Continue the application when it is minimized

Postby Lena » Fri Jun 24, 2016 1:24 am

I read readme.html from this example:
Right-click on the Android device, and select Add Android Service.

I try to add Android Service in my C++ app:
Right-click on the Android device, and select Add Android Service.
However, nothing happens - there is no dialog window.

It means I can not add a deiphi service application in c++ main android application. :(
Lena
BCBJ Master
BCBJ Master
 
Posts: 419
Joined: Sun Feb 06, 2011 1:28 pm


Return to Technical

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests

cron