I have a custom home app a launcher
so i have control on home key back key and menu key i do what i need but on my tablet a 10.1" IPS Dual Core of Artview i have 4 button
-the back, one with a arrow
-the home, one with a little house
-the recent apps, who look like 2 superposed box (and who on press show recent app)
-the menu, 3 little point
My probleme is i wan't to do a custom think on the 3rd button but android systeme don't let me...
Anyway to do that? And if i have 4 button maybe i don't use the right keycode for the second one
I have finally found a way to do this
No doc about this do it on the onCreate of your activity
getWindow().getDecorView().setSystemUiVisibility(8);
But the 8 is a hidden flag to completly disable system UI with this your app is permanly in full screen(Be carefull if you use this bind power buton to exit app :P)
And don't forget
android.permission.EXPAND_STATUS_BAR
in your manifest
Don't k now if work in every version of android try on 4.0 4.1 and it's work for 3.x don't know.
Related
Quick question, Android related..
How do I display a working "THREE VERTICAL-DOTS" floating action button, to trigger same functionality as Android menu button that worked on Kitkat (Android-4), and all previous Android versions?
Details:
I have an Android app that uses Java Native Interface. It worked fine in Kitkat (Android 4.x series), but in Android 5.x, the menu-options button (three vertical dots) no longer responds. Originally, in Kitkat (Android 4.x), the standard Android menu button brought up the applications configuration menus. Now, in Android-5, the Menu button has been replaced with a "Recent Apps" button (this was a very poor design change - probably the worst basic re-design of a working interface I have seen in 30 years... ). Is there an easy way to use a "floating action button" or something like that, to restore functionality of the standard Android "Menu" button?
On Samsung tablets, one can tweak: "Settings / Accessibility / Dexterity and interaction / Assistant menu " to "On", and then a floating-action-button appears, which then has the three vertical-dots as one of it's optional push-buttons, if invoked. Pressing that three vertical-dots button (on the Samsung FAB (floating-action-button)), triggers the old Kitkat/Android4 menu, and at least Samsung users can alter set my app config parameters.
In my app's AndroidManifest.xml file, I have minSdkVersion="8" and the targetSDKVersion="8". I have tried setting the targetSDKVersion to higher levels, which results in a non-functional floating action button, showing three vertical dots, appearing on the screen.
There must be an obvious way to fix this damage that the Android "Material Girl Design" people did to Android Kitkat(and previous Android vers.) Android Menu Button. I've detailed a work-around for my user-base at this point, and released an new app version which offers details on the work-around - at least for Samsung phone and tablet users, but an in-app button really should just appear to allow the main app configuration menu to be triggered.
I have looked at this:
http://developer.android.com/training/appbar/setting-up.html#utility
Don't want an "Action Bar". My app is a DOS-emulator, and needs all the screen space.
I have also reviewed:
Android Options Menu in Fragment
This gets closer, but rather than trial-and-error, I would like to just jump to the solution, if possible. There must be some code or a feature selection that just fixes the little action button that appears (but does not work), when I set the targetSDKVersion="12" (or higher values), in the AndroidManifest.xml file.
My app uses SDL (Simple DirectMedia Layer) vers. 1.2 and 1.3 to control and draw the screen.
I will post the answer here when I find it. I know it is possible, because Samsung is already doing this, within its "Accessibility/ Dexterity.. /Assistant Menu" feature.
Since API 14, right mouse clicks should have been easy to detect via getButtonState().
However, when I right-click, then it acts as the Back button. The middle button acts like the Home button. (Android 4.4, Galaxy Note 3, mouse via USB adapter)
My question:
Does the (smartphone/tablet) device manufactor decide what to do with right button?
Or do different Android versions act differently?
What Android versions / devices support right/middle mouse button?
The default behavior for the middle and right button are as you described for most devices, as is defined by the OS.
Starting at API level 14, there is a way to handle the second and third button from the MotionEvent of a GenericMotionListener.
I suggest you have a look at the answers to this similar question for more details.
The answer is yes, the manufacturer controls how the secondary/tertiary buttons react, because it is compiled with the kernel. Generically the right click acts as a back button, however, on a couple of my non-mainstream tablets it uses one of the mouse's side buttons to go back. Usually the wheel button goes home, all tested on my collection of devices. If you want to know how to override the default behavior, whether it be for an app or as a mod, check out my answer here: Change Mouse Right-click behavior
Hope this clears up everything
The application that I'm developing must look like a launcher. I opened this topic because of I couldn't find the correct answer in whole topics that I looked at in Stack Overflow.
I want the application to disable or control whole buttons to exit this application. I disabled home and back button on Android 2.3 but it doesn't work on Android 4.0 (except for back button).
To conclude, I couldn't and I want to disable only home button on Android 4.0
Can you give an advice except the other answers?
There is no way to intercept the home button on Android, unless you make your app the home screen. This is for security reasons, so that malicious apps cannot take over your device by overriding all the buttons that can exit. The home button is the one sure shot way to be able to leave any app.
In short, no it's not possible, and even if it were, it is a serious disruption in what a user expects out of an app's behavior. You will have to go with making your app into a launcher if you want to achieve this.
This question already has answers here:
Are the 4 Android buttons standard? Ex. back button, menu button
(4 answers)
Closed 5 years ago.
Do all Android devices have "option" and "back" buttons? Or should my design have "back" and "option" buttons for making it more versatile?
The Android 4.1 CDD section 7.2.3 contains information on this:
The Home, Menu and Back functions are essential to the Android
navigation paradigm. Device implementations MUST make these functions
available to the user at all times when running applications. These
functions MAY be implemented via dedicated physical buttons (such as
mechanical or capacitive touch buttons), or MAY be implemented using
dedicated software keys, gestures, touch panel, etc. Android 4.1
supports both implementations.
The back button is going to bring back the previous screen on the stack regardless, much like the home button will pretty much always take you to the home screen. As for the option button, it's generally good practice to implement something for it if there are some settings to be changed or something like that, but that really depends on your application. Many apps don't utilize it and do just fine.
No, not every device comes with a back button. Amazon Fire phone do not have a back key.
On Android platform it is always better to be cautious as device manufacturer always do customization.
My app has code to go full-screen where sensible to do so -- it's sensible on most Android 1 and 2 devices, but under Android 3 for example going full-screen loses the app menu button, and at the moment I don't implement my own menu button so users can't (or at least can't easily) get to the app's menu.
At the moment I test for Android version < 3, and go full-screen if that's the case, but I have users with Android 2 tablets (Viewsonic view pad 10s for example) where this isn't sensible (the Viewsonic user tells me she has to hold down the back button to get app's menu to appear).
Is there a better way of testing whether going full-screen will lose the menu button? Or going full screen only if it's sensible to do so?
Thanks for any help you can give. Let me know if you need more info or if the above isn't clear.
Mark
Is there a better way of testing whether going full-screen will lose the menu button?
No. The Viewsonic device in question does not qualify for the Android Market, AFAIK, and all bets are off in terms of compatibility for devices that fail to meet the requirements for the Market.