Android Question (Solved) service forground tired of searching for sample that work !

mrezaes

Member
Licensed User
Longtime User
hi
i almost tested all of ther code in the forum and disapoint from srvices .

pls post a sample project that service stay in memory and not killed when i swip kill app.

my problem is when i swip end app , service will destroy from service list and not run again. im fully

confused and please dont refer to another post on another topic.

post a simple running service (sticky service) whatever that i use for gps tacking on background

i want my service with not killed like instagram and other services like in the image that i posted

thanks in advanced.
 

Attachments

  • photo_۲۰۱۸-۱۱-۱۰_۱۷-۲۱-۴۵.jpg
    photo_۲۰۱۸-۱۱-۱۰_۱۷-۲۱-۴۵.jpg
    70 KB · Views: 364
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
please dont refer to another post on another topic.
Sorry but this is not a legitimate request.

pls post a sample project that service stay in memory and not killed when i swip kill app.
B4A-Bridge code: https://www.b4x.com/android/forum/threads/8153/#content

About sticky services, go to the sticky services tutorial: Creating a sticky service - long running background tasks

The very first line says:
Edit: Things have changed with newer versions of Android and new restrictions. Sticky services should not be used any more.

Any simple foreground service will work. Make sure not to use the starter service for this.
 
Upvote 0

mrezaes

Member
Licensed User
Longtime User
Sorry but this is not a legitimate request.


B4A-Bridge code: https://www.b4x.com/android/forum/threads/8153/#content

About sticky services, go to the sticky services tutorial: Creating a sticky service - long running background tasks

The very first line says:
Edit: Things have changed with newer versions of Android and new restrictions. Sticky services should not be used any more.

Any simple foreground service will work. Make sure not to use the starter service for this.
thanks for quick reply .
but still have problem when i swipe end b4a bridge activity , service will destroy !!!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
but still have problem when i swipe end b4a bridge activity , service will destroy !!!
Now you are providing relevant information.

Your phone doesn't behave as expected. Foreground services should not be killed when the user swipes the app. Upgrading the phone OS might solve it.
There is no other mechanism in Android that will help to prevent the app from being killed.
 
Upvote 0

mrezaes

Member
Licensed User
Longtime User
Now you are providing relevant information.

Your phone doesn't behave as expected. Foreground services should not be killed when the user swipes the app. Upgrading the phone OS might solve it.
There is no other mechanism in Android that will help to prevent the app from being killed.

but as you see in the picture of first post imo , instagram and other services are running
 
Upvote 0

mrezaes

Member
Licensed User
Longtime User
also i tested this sms project you posted before.
service not fired when sms arrive and service kill when swipe app
 

Attachments

  • test sms project.zip
    8.7 KB · Views: 312
Upvote 0

KMatle

Expert
Licensed User
Longtime User
but there is a question i didnot configure anything for imo and instagram . how do that work ?

When I first got my Huawei P8 years ago, I wondered why my Google Calendar wasn't updated, WhatsApp also. Huawei had a whitelist with known apps which are allowed to run in the background. All others were not. Took me days with my first FCM app which did not work as yours.
 
Upvote 0

mrezaes

Member
Licensed User
Longtime User
When I first got my Huawei P8 years ago, I wondered why my Google Calendar wasn't updated, WhatsApp also. Huawei had a whitelist with known apps which are allowed to run in the background. All others were not. Took me days with my first FCM app which did not work as yours.

thanks .you helped me alot.
pls let me khow if you could do something for that
 
Upvote 0
Top