Prevent home button action (system app) - Java for Android App Development

Hi,
I am developing an application for a specific tablet which have two physical buttons, the home button and the back button and have a simple launcher which launch a web browser. My launcher has system permissions, but I couldn't change or modify the android Rom , I am not root, and I can't be. Do you know if there is a way to prevent the home button to be pressed or to catch the event. I tried to overdrive onKeyPressed, it worked for the back button, but not for the home button.
If you have any idea, I am listening.
Thanks for your help.

How are you going to change system app without root?
Anyways, there is no documented method for it. There was a hack during GB times but it was fixed in higher versions so its useless now.
What you can do is make your own instamce of a launcher and catch the home button action to do whatever you want after that. You won't be able to do it without setting up your own launcher.

This is not a phone or a usual tablet, the tablet is created just for our usage, but the manufacturer don't want to produce tablet with root because we will sell those tablet for the public. I created my own launcher, this launch install my main application if it's not installed or launched it if it's present on the device. When I am in my main application for example browsing the web or playing a video, we don't want customers to be able to quit it or finishing it by clicking on the home button

ghostwan said:
This is not a phone or a usual tablet, the tablet is created just for our usage, but the manufacturer don't want to produce tablet with root because we will sell those tablet for the public. I created my own launcher, this launch install my main application if it's not installed or launched it if it's present on the device. When I am in my main application for example browsing the web or playing a video, we don't want customers to be able to quit it or finishing it by clicking on the home button
Click to expand...
Click to collapse
If you want the customers to be able to access only a single app, you can do something as simple as just setting it up as the home screen. Put this in your intent filter in your manifest.
Code:
<category android:name="android.intent.category.HOME"/>
This will always bring up the main activity of your app whenever the home button is pressed.

Related

[REQUEST] hardware keys remaper

i search forthis long time so let me know if there are some application that allows what i want. I know it can be only for root users.
I have an idea to application that allow user change function hardware keys.My idea is change search button to bring up app switcher.Be couse i really never used that button. I know many situation when we hold "HOME" to bring it up but it take me back to home+show preview screens +bring up app switcher (i know previews can be turned off by launcher but i want previews, they are cool).You dont need hold anything.It will be much faster switching betwean applications.
So you push menu to back to menu or bring up previews
and push search button to bring application switcher.
it is good idea?
sorry for bad english.
I was ready to start a thread with a similar recquest, so I do it here.
I've using a lot an application on my previous wm devices, called AE Button plus (http://ae.inc.ru/aebplus.php).
With this you could map any of hardware buttons of the device. And you could assign 4 actions to any button(click, doulbe click, triple click and click&hold) and it had many of system functions(reboot, bluetooth, wifi, gps on/off....).
On android I haven't seen any similar app(except button shortcut, which is very limited)
Is possible to have such an app on android? I hope that a developer start a project for a similar program. I found this app very useful.

Multi-tasking interface improvement

I was just reading about webOS and how good its interface is when dealing with multi-tasking and I realised how poor androids multi-tasking interface is. The only way I know to switch between running apps is to hold home button for a few seconds...
I personally think this can be improved by having thumbnails of open apps popup when the home button is single pressed on a home screen. Just as at the moment previews of all the home screens popup I think this should be switched with open app previews. I rarely ever use the home screen preview thing so i think its wasted, but I definitely would use app selector if little thumbnails showed.
Anybody have any thoughts on this? Im not a developer so I have no idea if this is possible but I think it would be a good feature to add and improve android. Do any devs think they can implement this??
Moved to general as not ROM development.
This would be a feature for a launcher app, so might be worth suggesting to someone like Fede who develops Launcher Pro, or cyanogenmod people that make ADW?
yes you are right. thanks. I was too lazy to find the relevant section to post under. will try contacting anderweb. or fede.
There are a couple of apps which overlays a screen on top of the current app you are in by tapping home twice, you can then open apps/access widgets without having to go back to homescreen first.
Currently im using 'smart taskbar', you can set the activation mode to be (1) tapping on a half-circle spot on either side of your screen or (2) swiping from one side to another. You can then open from a list of 5 'pinned' apps or choose from the mini apps drawer below, or click a tab called 'running' which seems the same as the current holding on home button behavior.
check out power strip. allows you to get a popup window where ever you are by doubble tapping home button (ore long press search button). there you can have quick access to widgets, shortcuts etc. really cool.
smiskkissen said:
check out power strip. allows you to get a popup window where ever you are by doubble tapping home button (ore long press search button). there you can have quick access to widgets, shortcuts etc. really cool.
Click to expand...
Click to collapse
just downloaded both power strip and the one mentioned above. Will try them both out and report back on whether its what i was suggesting. Thanks for your suggestions.

[Q] Stock 1.2: All apps showing up in app drawer?

I really like the really simple menu and app drawer that the stock 1.2 has, but it only shows the built in apps or ones downloaded from the BN app store.
Is there any way to force all the other apps I have installed to show up? I would prefer to have the default "Home" launcher instead of Zeam, etc.
Any ideas?
It looks like B&N has the list of applications it installs through the Shop app. So until someone finds that database and how to manually add apps you will need to install a third part launcher. You can search the market for a home switcher application in the meantime if you like the stock launcher
Yeah, I have a home switcher installed already.
I really hope someone finds a way to override that list of apps that show up soon.
Romp said:
Yeah, I have a home switcher installed already.
I really hope someone finds a way to override that list of apps that show up soon.
Click to expand...
Click to collapse
A workaround was brought up in the Manual Rooter thread about this. Basically, the workaround (and I'm running it right now) is to push the old BN 1.1's applauncher.apk to your system/app (should probably back it up first) and when you press the "Extras" button choose "applauncher"... everything will show up. The upside is now you can use default "Home" button but the downside is that the "Extras" tab doesn't populate new apps you install until a reboot.
Here's the applauncher.apk from 1.1 that I'm using.
Go to "Apps"
Tap on the "Archived" button
While holding the volume up hardkey, tap on the image of the speaker that appears.
This brings up the 1.1 "Extras"
mucoww said:
Go to "Apps"
Tap on the "Archived" button
While holding the volume up hardkey, tap on the image of the speaker that appears.
This brings up the 1.1 "Extras"
Click to expand...
Click to collapse
Very nice! It worked for me. I tried volume down as well but volume up was the only one that did.

remapping keys - is it possible switch to launcher without button savior?

Hi,
I have found few topics about key mapping but I still don't know whether it is already possible to map any hardware button to a MENU (?) so it triggers the non-stock launcher. I mean, do I still need button savior to switch to the launcher?
I would like to root my nook but don't want to use TouchNooter. (I think it breaks some of the stock rom functions and it also brings apps I do not want).
I would prefer just the root with adb over usb (should be possible with a custom ramdisk attached in one thread here), 3rd party apps installation enabled (update sqlite db), and an external laucher of course. I think I can live without the market.
It would be great to have "small" (as less apps as possible) customized nook rom without "phone" related apps.
You can remap the buttons, and it's pretty easy. system/usr/keylayout, I believe, and then the file without the omap prefix. The last four lives are the side buttons. However, I find it quite handy to use the new n-button mod/app by XorZone -- http://forum.xda-developers.com/showthread.php?t=1289894
That mod/app changes the n-button to a home when pressed (returns to launcher), and a recent app pop-up when held for a few seconds. Very handy, especially if you don't intend to use the nook's onboard reader. (I'm using Aldiko instead, since the default reader doesn't refresh often enough to prevent ghosting...)
Remap the other keys to VOLUME UP and VOLUME DOWN (BACK and MENU can be handy too) if you don't plan on using the stock reader and you can then use your hardware buttons in Aldiko, the Kindle app, etc.
Personally, my left buttons are MENU and BACK, and my right buttons are VOLUME UP and VOLUME DOWN, and I don't use the stock B&N library/reader at all.
If you plan on using the stock reader, be sure to keep atleast one back and forward button at the default mapping...
On the topic of touchnooter, everything it comes with can be uninstalled when it's not needed. there really isn't much clutter there to begin with... As I recall, it may or may not break the B&N shop but I'm unsure if that problem still persists or what. Otherwise, it doesn't break anything.

mini [Guide] How to press menu key on your phone from ADB (no root needed)

While transitioning some old Apps (FuelLog Pro) from my other Android phones onto my S6 Edge, I discovered that some of the apps needed to use a 'menu' key to backup/export. Obviously no way to add a menu softkey without root, SO I figured out how to do it from ADB.
Once you connect your phone to ADB enter the following command for the 'menu' softkey:
Code:
adb shell input keyevent 82
The 'keyevent' relates to various keymappings, annoyingly, the keymappings for the Samsung are a little different from standard Android, which is why I'm making a record of it here.
So far it looks like HOME, BACK, CALL, and Volume follow standard keymappings. I'll update this list if I spend more time digging and find other differences.
You can find the complete list here:
http://developer.android.com/reference/android/view/KeyEvent.html
This is super useful for running batch commands on Apps from the computer as well.
Use wisely.
Thanks, can we replace the long press on the recent apps button from dual windows to menu key?
I really don't understand where the problem is with just pressing the menu overlay button?
For old Apps without the new Material UI I always get a round overlay button which is acting as a Menu button.
The new one don't have these as they integrate this button themself.
I have not found any app yet where I'm not able to open the menu.
There is no way (as far as I know) but also no need to replace the long press with the menu button.
Menu button is not needed anymore.
I have several apps that don't have the round overlay Menu button (including the aforementioned app, FuellogPro). Mostly it is apps that were written about 2 years ago that got stuck between KitKat and JB. I have quite a few paid apps, so I keep using them (and modifying them) even after support has ended.
You can only reassign the button to 'menu' if you have root.

Categories

Resources