Skip to content
Trailma

Android settings for reliable navigation in continuous background | Trailma

Stop Android from killing Trailma while recording. Battery optimisation, background activity, location permission and per manufacturer steps for Xiaomi, Samsung, OnePlus, Oppo, Vivo and Huawei.


Why Trailma stops when the screen goes off

Android is built to save battery, and the way it does that is by putting apps to sleep as soon as you stop looking at them. For most apps that is fine. For an app that has to keep reading GPS while your phone is in your pocket on a ridge above Ghandruk, it is the single biggest cause of problems.

When Android freezes Trailma in the background you will see one or more of these:

  • Your recorded track has a straight line across a section you actually walked, or it simply stops partway.

  • Distance, pace and elevation stop updating while the screen is locked.

  • Turn by turn voice directions go quiet and you miss a junction.

  • The recording notification disappears from your status bar.

  • An offline map or route download stops before it finishes.

  • Activities never sync, or sync only when you next open the app.

None of this is a GPS fault and none of it is fixed by restarting the app. It is a power setting, and once you change it, it stays changed.

Do this before your trip, not on the trail. Most of these settings need a few taps in Android Settings, and some of them need a working data connection to verify. Sort them out at home in Kathmandu or Pokhara while you still have signal.

The five minute checklist

If you only do one pass, do this one. Every setting below is explained in more detail further down.

  1. Battery optimisation: set Trailma to Unrestricted or Not optimised.

  2. Background activity: allowed.

  3. Location permission: Allow all the time, with Precise location on.

  4. Protected apps / auto start: add Trailma to your phone maker's list. This is the step most people miss.

  5. Battery saver: off while you record, or Trailma excluded from it.

  6. Recent apps: lock Trailma so it is not cleared, and never swipe it away while recording.

1. Take Trailma out of battery optimisation

Battery optimisation is Android's blanket permission to suspend an app whenever it decides the app is idle. A recording app is never really idle, but Android cannot tell the difference.

Go to Settings > Apps > Trailma > Battery and choose Unrestricted. On older Android versions the same screen is at Settings > Battery > Battery optimisation > All apps > Trailma > Don't optimise.

Names vary by phone. Look for Unrestricted, Not optimised, No restrictions, or Allow background activity. Avoid anything called Optimised, Restricted or Intelligent.

2. Allow background activity and background data

Two separate switches, both on the same app screen, and both matter for different reasons.

  • Background activity lets Trailma keep its recording service alive while the screen is off. Without it the track stops.

  • Background data lets finished activities upload and lets a map download continue while you are doing something else. Without it your ride sits on the phone until you open the app.

Find both under Settings > Apps > Trailma > Mobile data and > Battery. If you use Data Saver, add Trailma to its Unrestricted data list as well.

3. Set location to Allow all the time

Android offers three location choices, and the middle one is the trap. Allow only while using the app sounds right, but it means Android may cut location as soon as you lock the screen.

Go to Settings > Apps > Trailma > Permissions > Location and choose Allow all the time. On the same screen, turn on Use precise location. Approximate location is accurate to a few hundred metres, which is useless for a trail.

Android 11 and later hide the all the time option behind an extra tap, so you may have to open the full permission screen rather than answering the popup.

4. Add Trailma to your phone maker's protected list

This is the step that catches people out. Xiaomi, Samsung, OnePlus, Oppo, Vivo, Realme, Huawei and others all add their own app killer on top of Android's, with its own separate list. Trailma can be perfectly configured in Android Settings and still be shut down by this layer.

Xiaomi, Redmi and POCO (MIUI and HyperOS)

  • Settings > Apps > Manage apps > Trailma > Battery saver > No restrictions.

  • On the same screen turn on Autostart.

  • Settings > Battery > turn off Battery saver and, in the battery menu, turn off MIUI optimisation if your build offers it under Developer options.

  • Open Recents, drag the Trailma card down, and tap the lock icon.

  • Set Settings > Additional settings > Developer options > Memory optimisation off if present.

MIUI is the most aggressive of the lot. If a track still breaks after all of the above, also allow Display pop up windows while running in the background in the app's Other permissions list.

Samsung (One UI)

  • Settings > Apps > Trailma > Battery > Unrestricted.

  • Settings > Battery > Background usage limits and make sure Trailma is not in Sleeping apps or Deep sleeping apps. Remove it if it is.

  • Turn off Put unused apps to sleep, or at least add Trailma to Never sleeping apps.

  • Turn off Adaptive battery for long trips.

  • Settings > Device care > Memory and exclude Trailma from Apps not checked.

OnePlus, Oppo and Realme (OxygenOS and ColorOS)

  • Settings > Battery > Battery optimisation > Trailma > Don't optimise.

  • Settings > Apps > App management > Trailma > Allow auto launch or Allow background running.

  • Turn off Advanced optimisation, Deep optimisation or Sleep standby optimisation under Battery.

  • Lock the app in Recents using the three dot menu on the card.

Vivo and iQOO (Funtouch and OriginOS)

  • Settings > Battery > High background power consumption and allow Trailma.

  • Settings > Apps > Autostart and turn Trailma on.

  • Turn off Power saving mode and Super power saving while recording.

Huawei and Honor (EMUI and MagicOS)

  • Settings > Battery > App launch, switch Trailma from Automatic to Manage manually, then turn on all three: Auto launch, Secondary launch and Run in background.

  • Turn off Power Genie style optimisations and any Ultra power saving mode.

  • Lock Trailma in the Recents screen.

Google Pixel, Motorola and Nothing

These run close to stock Android, so the standard steps are usually enough. Set the app to Unrestricted under Battery, allow location all the time, and turn off Adaptive Battery under Settings > Battery > Adaptive preferences before a long day out.

5. Battery saver and Extreme battery saver

Battery saver throttles background work across the whole phone, and Extreme or Ultra battery saver goes further by suspending almost everything that is not on screen. Both will break a recording.

If your battery is low and you still need the track, do this instead: turn battery saver off, drop screen brightness, put the phone in flight mode with GPS still on, and keep it in a warm inside pocket. Cold drains a battery in the mountains faster than the app does.

Also check that battery saver is not set to switch itself on automatically at a percentage, which is easy to forget about until it triggers halfway up a climb.

6. Do not swipe the app away

Clearing Trailma from the Recents screen while it is recording ends the recording service on most Android phones. The same goes for any cleaner or booster app, including the ones built into MIUI, One UI and ColorOS.

Lock the Trailma card in Recents so a clear all does not take it, and uninstall third party RAM cleaners if you use one. They provide no real benefit on modern Android and they are a common cause of lost tracks.

7. Keep the recording notification visible

While Trailma records, it shows a persistent notification. That notification is not decoration. It is what tells Android the app is doing work the user asked for, and hiding it makes the app much easier for the system to kill.

Go to Settings > Apps > Trailma > Notifications and leave the recording channel enabled. If the notification disappears mid activity, the app has been stopped in the background, and that is your signal to revisit the steps above.

8. Settings for offline maps and remote areas

Most of Nepal outside the main towns has no usable mobile data, so offline maps do the real work. A few extra settings keep downloads and tracking healthy.

  • Download over Wi-Fi before you leave. Download the regions you need while the phone is on charge and the screen is on. A large region download that gets suspended halfway leaves you with partial coverage.

  • Keep enough free storage. Android deletes cached data when storage runs low. Leave a couple of gigabytes free so your maps are not evicted.

  • Do not use Adaptive or Auto storage cleanup tools that remove app caches while you are away.

  • Turn off Wi-Fi scanning throttling if your phone offers it, and leave Google Location Accuracy on. It improves the first GPS fix even without a data connection.

  • Give the phone a clear view of the sky for the first fix. Under thick canopy or between valley walls the first lock can take a minute or two. Start recording before you set off rather than on the move.

9. Do Not Disturb and voice navigation

If turn by turn directions are silent, check Settings > Sound > Do Not Disturb and allow Trailma, or allow alarms and media. Also check the media volume separately from the ring volume, and if you are using Bluetooth headphones, confirm the phone is routing navigation audio to them rather than to the speaker in your pack.

10. Check it worked before you rely on it

A five minute test saves a ruined track. Start a recording, lock the phone, put it in your pocket, and walk for ten to fifteen minutes without touching it. Then open Trailma and look at the track.

A clean line that matches where you walked means the settings are right. A straight line between two points, or a recording that ended on its own, means something is still shutting the app down, so go back through the manufacturer section for your phone.

Repeat this check after every Android system update. Updates routinely reset battery and permission settings back to their defaults.

Still not working

Write to us with your phone model, your Android version, your Trailma version and what exactly happened, including whether the recording notification was still there when you noticed. Those four details let us tell the difference between a system power setting and a genuine bug in the app.

More detail on your specific phone

Every Android manufacturer handles background apps differently, and they change their behaviour between versions. Don't kill my app! is an independent, community maintained site that documents exactly what each manufacturer does and the precise steps to work around it, ranked from the worst offenders down.

If your phone is not covered above, or the menu names on your device do not match, look it up there: https://dontkillmyapp.com

Was this helpful?

Still need help?

Tell us what happened and we will come back to you. Include what you were doing and what you expected — it is what makes a report answerable.

Contact support