I'm working on a Android app that supports several languages. When I put it in background, change device language and then resume the app, it restarts and it seems like the Android system destroys it after changing device language. Do you know if this is what happens? If not, it's certainly regarded to my code, but I don't really know if Android system behaves this way. I've tested on devices with Android 4.3, 4.4, 4.0 versions. On 4.0 it doesn't happen always.
I would like to avoid the app restart, as I don't need to also change the app language along with the device's.
Thank you in advance.
Related
Few days ago I moved to HUAWEI P9 phone and try to keep developing my app.
My new problem (have not seen it on other devices..) is that my app is getting killed after the screen turns off (not immeditaely but after a minute or too).
To be sure that the issue is not related to my application, I created the simple "hello world" application from the android studio, and the behavior is exactly the same.
I'm running Android 6.0 (API 23) on my device.
Any Idea why even the simplest app is getting killed after the screen is turned off?
Thanks!
Lior
You need to add your app in the 'protect application with battery saver' (under battery's option).
Hope this helps
I'm writing an app to disconnect the phone entirely from the outside. i.e. only local activities are allowed. Things like data, wifi, phone calls, text message are all disabled.
I understand that with MDM one can (probably) change the passcode and lock the phone, which will basically achieve the same thing. But still I'd like to know if one can write such a program on Android.
I assume a possibility would be to put the phone in airplane mode. But sadly this isn't possible anymore, as written in Official Android 4.2 API Documentation.
Some device settings defined by Settings.System are now read-only. If
your app attempts to write changes to settings defined in
Settings.System that have moved to Settings.Global, the write
operation will silently fail when running on Android 4.2 and higher.
Even if your value for android:targetSdkVersion and
android:minSdkVersion is lower than 17, your app is not able to modify
the settings that have moved to Settings.Global when running on
Android 4.2 and higher.
I recently tried to implemented something like this, but the only way would be to deactivate everything manually (from what I found)
In my Android manifest, I have flagged my application as "persistent", so that it automatically restarts if it crashes, is less likely to be killed by the system, etc. I know that normal applications cannot use this setting, but I am working on a custom ROM, and I load my application into the priv-app folder, and so I am able to use it.
This works perfectly well on pre-Lollipop phones. However, when I load my APK onto an Android 5 phone, the "persistent" setting is no longer honoured. I can use 'dumpsys activity' to verify that my app is persistent on Android 4.4.4, but not on Android 5.0.
Is there some additional requirement for persistence in Android 5? I see that some system-supplied apps are still persistent, so it's not as if it's completely impossible. Thanks.
Turns out I misunderstood the nature of the problem. The real problem was that I hadn't given the apk the selinux context permissions. I used chcon to copy the context from another file in priv-app and that sorted it out.
I was woundering if theres any way to program an android smartphone to work with users like windows works, when each user has it's own desktop meaning it's own apps and it's own configurations?
any help would be good for me i'm kind of lost here
Multiple User support was unofficially added in 4.1, and was made public and enabled on tablets in 4.2.
AFAIK there is absolutely no way to detect the moment when app gets uninstalled.
I am currently writing an app which should among else toggle on/off 3G data. It went ok before 2.3 with ITelephony reflection calls, but from Android 2.3 this is not possible.
So I had to resort to APNDroid-style way of adding suffixes to APNs in content://telephony/carriers. This seems to work, but I stumble on the same problem as APNDroid has: since we can't detect when the app is removed, all the suffixes will remain if the user first turns off 3G with the app and then uninstalls the app.
This is an ugly and dangerous solution, because the end user may be left with all APNs broken.
It's possible to detect uninstallation from another application, but how would one force the user to install another application to just monitor the first one? It seems there is no way from 2.3 on to write a 3G-managing app.
Any ideas?
AFAIK there is absolutely no way to detect the moment when app gets uninstalled.
Correct.
I am currently writing an app which should among else toggle on/off 3G data. It went ok before 2.3 with ITelephony reflection calls, but from Android 2.3 this is not possible.
Which means that you should not be implementing the app as an SDK application. You should have not implemented the app using "ITelephony reflection calls", either.
This is an ugly and dangerous solution, because the end user may be left with all APNs broken.
Which means that you should not be implementing the app as an SDK application.
how would one force the user to install another application to just monitor the first one?
You can't.
It seems there is no way from 2.3 on to write a 3G-managing app.
Correct.
You are welcome to try to contribute changes to the AOSP Settings application, or create a new firmware application, that offers the features you seek.