Traccar Client stops reporting after idle period of time?

pavithra19848 years ago

Same problem. latest version of traccar client hidden.
it work with Xperia M2 on kitkat without any issue. but stop working after some time in Samsung J2 Android 5

Anton Tananaev8 years ago

I have seen many reports of this issue. I think Samsung has customized Android on their devices to kill background apps. I'm working on a solution for this problem.

jeansj8 years ago

Hi, I have a samsung s6 that was killing traccar service , read in forums that could be the Samsung's SPCM feature that would be killing the service, follow a tutorial to disable it ( the device must be rooted ) and so far not killed service traccar , I will do more tests and post results later.
Tutorial

Anton Tananaev8 years ago

Thanks for sharing the info. I plan to use alarm manager as a work-around for the issue, but it won't be a perfect solution.

jo7 years ago

HI Anton
I like Traccar very much ! But now on my mi note 3 with Android, OS XIOMI 5.1.1 I have the same problem as other people discribe, that the Traccar client app stops to send possiton data after some minutes. On other phones i used it, also with Android 6.0 it works fine but not with OS Xiomi.

When I restart the app, I got new possition data for mayby 5 minutes of even less, then it stops and I can't the the phone on the server any more. When I check the app, it is still running but in the status there are no listings of any postiondata after some minutes.

Something seems to stop the traccar. Is there a solution for this problem now? It would be so great because I realy need a functioning tracker.

Thanx for all your work Anton

Anton Tananaev7 years ago

I heard that Xiomi version of Android kills the background processes. I'm not aware of any solutions to this problem. Nothing can be done about it from the app side.

jo7 years ago

thanx Anton for your fast answer.
Do you or somebody else maybe know an other client programm that will maybe work with Xiomi and Traccar server? Or does anybody heart about an solution to change something in the OS that it will work ?
Thanx for your support

Anton Tananaev7 years ago

The problem is not with the app, it's with the operating system. I don't know if there is any way to configure system to not kill background apps.

abyss7 years ago

MIUI 7.x has such problem, I needed to exclude messengers from battery saving.
You can try: Settings -> Battery & Performance -> Manage apps battery usage -> Select Traccar -> Select something like "No restriction"

jo7 years ago

Hi Abyss
Great that works !!!
Thanx a lot. I didn't know that in Xiomi OS is an extra menu in the settings to "manage apps battery usage" for each app extra. There it was blocked that the traccar app can work in the background, searching for gps and using the network for transfering the data. After changing this settings now it works perfect.

And special thank to you Anton for programming that great traccar app ;-). Now everything works fine.

jo

mohammed shafeeq5 years ago

I got this solution from stackoverflow, is it work for traccar ? : https://stackoverflow.com/questions/31154128/set-specific-app-to-ignore-optimization-by-code-in-android-m

WARNING: It seems Google doesn't allow apps on the Play Store to do this. See the comments below.
Based on the AndroidManifest.xml extracted from Settings. apk in the MPA44I build, it would seem you might be able to do what you want by something like the intent below.

From XML:

<intent
    android:action="android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
    android:targetPackage="com.android.settings"
    android:data="package:PUT_YOUR_PACKAGE_NAME_HERE" />

From code:

try {
    Intent intent = new Intent(android.provider.Settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
    intent.setData(Uri.parse("package:PUT_YOUR_PACKAGE_NAME_HERE"));
    startActivity(intent);

} catch (ActivityNotFoundException e) {
    e.printStackTrace();
}

is it possible ?