How to Hide Android Application from Task Manager/ not recent apps tab - java

I'm using a SG Note 4 and when I open the Google Maps app and then go to task manager it never shows up, it does when you go to settings, applications, cached..., how can I achieve the same with my app. Im using a map fragment and when moving the camera the cache increases and increases, I imagine people with little knowledge going to task manager and seeing my app using 500mb of ram might end up getting scared and kill it, or worse uninstalling it. Maybe not all manufacturers give users this option but for those that do how can I do this if it's even possible thanks!!

Related

App freezes on splash screen for some users

Some users report an issue: they launch the app, the splash screen appears, but nothing else happens. Splash screen just stays on without ANR or errors.
I can't see any logs because no loggers were initialized yet, and I don't even know if the onCreate method was called.
Important notes:
99% of users don't experience this
users that report such issue say that it's persistent - they can't use the app at all
some users say if they launch google play store first and then launch app - it works fine, but without that step it always freezes at the splash screen, so they have to launch google play store each time before launching the app
To send any data anywhere I need to initialize a bunch of dependencies, but looks like it doesn't even get to that point. App works fine on millions of devices, but a few thousand users reported this issue. Cannot post application initialization code as it's huge.
Questions:
What can possibly be the reason of this?
Where would be the best place to start searching for the bug?
Is there a way to determine the first line of code where the app is not launching as it should?
Is there something that the google play store triggers that applications need to launch properly?
It was because of googlePlayStoreAppUpdateManager.appUpdateInfo check for updates that returns a Task, but sometimes it doesn't actually call nor success nor fail listeners, so we hang forever. Solution was to add RxJava wrapper with timeout and limit waiting time for Google to answer to some reasonable time.
It looks like some devices, like Xiaomi or Honor are not allowing google play manager to check for updates unless explicitly started by the user, so this check should be done carefully.

Remove android setting screen from recent list [duplicate]

I was wondering if anyone had a relatively simple solution for us.
We created an app to be used by our clients on android devices that we give them.
We would like the client to only be able to use our app and have limited access to everything else (i.e. settings, email etc.) What is the best way to achieve this without using 3rd party apps.
Thank you in advance!
This may not help but the L preview has a task locking feature included that may be of some insight, I'm not aware of how it functions as yet
Task locking
The L Developer Preview introduces a new task locking API that lets you temporarily restrict users from leaving your app or being interrupted by notifications. This could be used, for example, if you are developing an education app to support high stakes assessment requirements on Android. Once your app activates this mode, users will not be able to see notifications, access other apps, or return to the Home screen, until your app exits the mode.
http://developer.android.com/preview/api-overview.html
Hope this helped
Suppress the Title Bar & Make Your App a Launcher
Root Your Tablet
Modify System Files and Settings to hide the soft keys
On the next link you can find the complete solution for the Nexus 7 (2012)
http://thebitplague.wordpress.com/2013/04/05/kiosk-mode-on-the-nexus-7/
simple Answer is:
Lock Install button with modify system settings.
Create your own customized-ROM and apply your requirement to that ROM.
more info, visit XDADavelopers

How to make an app unclosable?

After a user opens my application I don't want them to be able to get out. So when they press the home or back button it doesn't let them exit the app. I know there are ways using a service to keep the app always running in the background, but I don't even want them to even exit.
Is this even possible, if so how? Without having to hack the kernel.
I know this sounds odd, but it is not for a commercial app, but for my lab, it will never be on GooglePlay. The tablets will be given to little kids and they will take a test on it, so I can't have them using youtube or anything else.
Related post: Android, How to make the task of the app unclosable? Only closable by task killing
The answer by CommonWare seems to indicate that kernel hacking is the only way, but is it?
Also I am using Android L.
there is no official support yet - there will be support with android L via the Task locking API
The L Developer Preview introduces a new task locking API that lets
you temporarily restrict users from leaving your app or being
interrupted by notifications. This could be used, for example, if you
are developing an education app to support high stakes assessment
requirements on Android. Once your app activates this mode, users will
not be able to see notifications, access other apps, or return to the
Home screen, until your app exits the mode.
https://developer.android.com/preview/api-overview.html
EDIT: as you said you use L this got obsolete - but I leave it here as a hint for others
said that - you are also able to get this kind of work without root today if you have to ( e.g. kiosk mode app on a certain hardware ). It is not simple - and no solution that works for all devices - but if you need it you can get it work with tricks like:
- reacting on home-screen intent ( and setting it as default )
- when you go to background - bring your self foreground again
- ..
It seems google has some thing called COSU for setting up single-purpose devices
Android 5.0 Lollipop introduced two new ways to configure Android
devices for a single purpose:
With app pinning, the device user can temporarily pin specific apps to the screen.
With lock task mode, a user can’t escape the app and the Home and Recents buttons are hidden. Additionally, lock task mode gives the IT
administrator a more robust way to manage COSU devices, as discussed
below.
and
As an IT administrator, you can configure Android 6.0 Marshmallow and
later devices as corporate-owned, single-use (COSU) devices. These are
Android devices used for a single purpose, such as digital signage,
ticket printing, point of sale, or inventory management. To use
Android devices as COSU devices, you need to develop Android apps that
your customers can manage.
from here
and there is a code lab for it here
for earlier versions of android here i founded How-To Create a Working Kiosk Mode in Android which shows some hacks for disabling buttons and restarting the application after boot and lock. note that most of these hacks, don't work on android 6 and later

Android - Setting usage flag

I am currently creating an app and would like to create a demo version (free) and a full version.
However, I am wondering how I can set some sort of flag so that when the demo version has been used 5 times, you have to buy the full version to continue using. This usage will be detected on a submit button.
I was considering setting a flag in the app, however releasied that the user could uninstall the app and then re-install it overcoming my set flag (as this would set it back to 0).
Has anyone got any clever solutions for my little dilema?
Thanks
You might want to try one of the techniques in this answer: https://stackoverflow.com/a/996288/1205715
I think that is not possible with an local application.
File saving to sdcard with strange filename can be a way but It is not perfect.
In my opinion, Right way is using an application server that manages user run times with unique UUID.
It might also be worth thinking about an alternative approach.
In app purchases are now available, so you could have a free and a restricted section in your app, and use the in app purchase to unlock the restricted section. You see more developers going with this approach these days, rather than managing two versions of the app.
Also worth considering the fact that if you have a paid version of the app it can be pirated pretty quickly, one person just needs to get their hands on the full apk. However, if you go with the in app purchase model you will be letting google handle a lot of these issues for you.... just a thought, and the road I will be taking with my next app.

Warning Android user that app update could lead to losing data from old app version?

I'm writing a game for Android. When the user completes a level, they can restart from the next level if they lose (i.e. I need to store an integer to remember which level they got to). If the app is interrupted during play, I save the world state to disk (this is complex state storing a map and game entities).
I'd like to keep my options open in the future for changing my game code and the way the world state is saved/stored. However, I must consider the scenario when a user has an old version of the world state on their phone because they were in the middle of a game, they upgrade the app and now the app cannot load the world state.
Having to write code to migrate the old version of the data to the new version of the data would be a pain if there's some way I can avoid this. It would be nice if I could somehow ask the user to finish their current game in progress before updating. Can this be done? Are there any other options?
I don't intend to do this often. I'd like to iteratively develop my game while getting some early feedback, but this is difficult if I must fix how the world state is saved and restored now.
I hope this doesn't seem a silly question, but on a PC or a console it's perfectly OK to have games that you cannot save during a game or you can only save between levels. I'm just finding Android a bit of a pain here as you must have a save game strategy for all games.
You cannot prevent a user from upgrading an app, and you cannot execute any code until your app is installed (or upgraded).
Quite frankly, losing data due to an upgrade is unacceptable. If you use an SQLiteOpenHelper, you automatically get nice hooks that help you with the upgrade process.
I understand that you have a pretty complex savegame setup, but try to keep it as flexible as possible to allow for easy upgrades. There are lots of techniques that help you with that.
And Android and PCs are just completely different - on a PC, you sit down and play for hours. On Android, you play real quick and then do something else. Or, you play and get a phone call and are forced to switch away from your game.

Categories

Resources