I'm running Android 7.1 and I cannot for the life of me figure out how to ensure "car mode" doesn't start when the device (honeywell CT60) is docked. I've already tried the following:
installing app "no dock"
installing app "car mode off"
getting app devs to add uiMode to the <ACITIVTY> element in the manifest.xml file.
None of these seem to work.
Does anyone have any advice or ideas?
Perhaps even an app that force the device to not go into car mode.
You're on the right track. According to Honeywell the app's AndroidManifest.xml has to be modified in the following way:
<manifest>
<application>
<activity android:configChanges="uiMode">
[...]
</activity>
</application>
</manifest>
This has to be added for each activity, where CAR_MODE should be disabled. It signals to the OS that the app will handle changes regarding the UiMode itself. Now instead of restarting the app to apply changes, the OS will leave handling this change up to the app.
If you want to find out how exactly it works, there already is a post explaining it. Alternatively you can find a guide about this topic at the Android Developer Docs.
Related
My app needs to display activity over the lock screen, And that is not working particularly on xiaomi devices, After some research I found that there is need to enable Show On Lock Screen permission.
I found that some of the applications on play store has this permission enabled by default,I have done lots of research but not found anyway of doing the same, Please help me with this
the following code worked for me, give it a try
<activity
android:name=".activities.alarm"
android:launchMode="singleTask"
android:showOnLockScreen="true"
></activity>
Android states i must ask for permission if my app wants to "Draw over other apps" when on Android v 6.0+. This permission can only be given manually by the user navigating to the appropriate Settings area.
When sent to Settings (via my app calling the intent) i noticed the "Draw over other apps" option for my app is always set to Disabled; it cannot be modified. Furthermore, if one were to navigate to the Apps permissions manually you'll notice the desired app isnt even listed in the "Draw over other apps" page making it impossible to adjust the setting.
I've already followed the baffling instructions by others to disable all the other apps listed then to try running my app again but to no luck. I've also tried restarting the emulator, factory reset, and other emulators. No luck.
Are there any other solutions to resolving this disabled issue?
Ok i discovered the problem and this is likely the same issue all others have had. Within my AndroidManifest.xml i forgot to include the SYSTEM_ALERT_WINDOW permission.
So add the following just before the application element:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Problem solved. Everyone should ignore the ridiculous claim that you need to disable all the other Draw over apps or Force stop others. Completely unnecessary in my case.
I'm going to write an application for a special device. The device's OS is android and it connects to a TV with HDMI cable and has a remote control as input hardware.(Like a video player) I need these to be done:
When the user works with it, it should not be clear that the OS is android.
User could not access to the OS system options like "Action bar" or "Setting menu" or etc.
My app be the default app of the system and it runs at start up before any other app even the launcher.
so,
How can I change the android boot logo ?
How can I set my app to be the default application? May I need to set it as launcher?
how can I disable all other android UI tools like launcher and action bar permanently? (even my application close they should not be shown)
May I need a rooted android ? and witch version has these possibilities ?
I've found my answers and share it to others.
How can I change the android boot logo ?
In some devices there is a file in system/media/bootanimation.zip
can be edited and replaced.(When creating zip file should choose
Store in compresstion type.)
In some devices there is a file in system/etc/bootvideo thats in
MP4 file format simply can be replaced.
How can I set my app to be the default application? May I need to set
it as launcher?
Yes, simply add android.intent.category.LAUNCHER to first activity category in the manifest like this:
<activity android:screenOrientation="landscape" android:name=".ActivityStarter">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
How can I disable all other android UI tools like launcher and action bar permanently? (even my application close they should not be shown)
Uninstall all other launcher on the device. also for notification bar you can remove Android UI in system apps. Note that be sure your app is running correctly and does not crash, if not you will lose access to the device.(I installed ES Explore on the device and run it with a hidden button in my app to access my android system tools.)
May I need a rooted android ? and witch version has these possibilities ?
Yes. In this case I used Android 4.4.2 but think other versions would be so.
Android 5.0 supports pinning an app. There's also an app called AppLock that may be relevant.
Is seems like the current way to exclude apps from the recent apps-lists in android L is broken. Our app is using android:excludeFromRecents and it works just fine. Unless our app is the FIRST app to start when the device reboots.
This is how it looks when our app is exited as the first app on the device:
And here is how it looks if we first start the camera (or any other app), then our app and exit both:
Simply put: If an app with android:excludeFromRecents is started as the first app on the device, the directive android:excludeFromRecents isn't working. If another app has been started before the android:excludeFromRecents-app, it works as expected.
Is this a really weird edge-case bug or am i'm missing something very obvious here?
We build a very privacy cautious web browser (http://inbrowserapp.com), so we cannot have any screenshots from the app showing once the app is closed. But this should also affect banking-apps, password-managers etc since sensitive information will be screenshotted if the app is the first to start after a reboot.
Maybe we can go about the route and hide the sensitive information with a blank view when the user is exiting on Android L. But its seems like something is buggy here?
I'm happy to say that this is fixed for Android 5.1. Just confirmed it on a device running 5.1.
So the correct solution, for us anyways, is to deny screenshots with getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); for Lollipop with SDK version 21, anything below or above that should be fine.
You can at least prevent the screenshot in recents by setting this flag:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
But it's still a bug that never should have made it to release..
I'm developing an Android application in which I need support a USB keyboard. I haven't developed something to explicitly support the USB keyboard because I thought that every application can use a USB keyboard.
The problem is that when I'm trying to connect or disconnect a USB keyboard, my application crashes without an error trace from the application.
My device is a Lenovo with Android 4.1 installed. What can I do to resolve this problem?
An Activity configuration change occurs when the external keyboard is attached.
To resolve the crash, add the following element to the AndroidManifest.xml for all activities:
android:configChanges="orientation|keyboard|keyboardHidden"
Per the documentation, android:configChanges:
Lists configuration changes that the activity will handle itself. When
a configuration change occurs at runtime, the activity is shut down
and restarted by default, but declaring a configuration with this
attribute will prevent the activity from being restarted. Instead, the
activity remains running and its onConfigurationChanged() method is
called.
For me, adding "orientation|keyboard|keyboardHidden" to configChanges would still call onDestroy and onCreate of the activity. After a long research I found this article:
https://developer.samsung.com/sdp/blog/en-us/2017/12/07/samsung-dex-lifecycle-on-switching-between-mobile-and-samsung-dex-mode
Basically, if you use Lenovo's productivity mode or Samsung DeX, it would recreate the app nonetheless, so it's necessary to add all of these if you want for the app to not recreate itself when you add a physical keyboard.:
<activity android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|uiMode|density">
Also, add this for Samsung DeX inside your AndroidManifest:
<meta-data
android:name="com.samsung.android.keepalive.density"
android:value="true" />