Hide application from menu and show when we want to - android

I want to hide my app from main menu, when user want to, s/he can see their app.
To hide the app I've removed the launcher category, and for now the app get hidden but now I don't understand how can the user launch the app. I've read somewhere that using a key combination (on the DialerPad) one can show the main screen of activity. How is this done?
Any other ideas of launcher an app when a launcher is not present?

Yes you can hide your application icon but only on rooted devices or system signed apps.....the solution will be to first disable your application using shell command pm disable com.yourapppackagename and then enable it back using **pm enable com.yourapppackagename** this will first disable your app removing app icon from device and then enabling back your app will bring back the app icon only in device menu and not on homescreen. if you want to disable and then enable on user choice then you may create a toggle button such as when off then disable your app and when on then enable your app.It will definatly work i have already worked on something similar

Related

Launcher Application to block settings from notification bar and home button long press

A previous developer for my company created an application that serves as the launcher for multiple types of android phones. These phones are given out to employees to use for business purposes so the application limits access on the phone to applications that are allowed by us.
The application works fine on all versions of Android up until Lollipop. On phones that have lollipop on them a user is able to access the settings from the notification bar (something that the app blocks on previous versions of Android) and also by long pressing on the home button, the google app is launched (that was also blocked by the application on phones that have versions less than lollipop. Package name for this application is com.google.android.googlequicksearchbox).
I have been researching this for a couple of days and I cannot figure out what has changed with lollipop to make the app stop working. I tried it on a motorolla turbo 2 and a galaxy s5 that are running lollipop and the problem exists on both.
I tried multiple solutions:
Override or disable settings menu
this link does not work for because it would basically run my application every time the user tries to access settings, which is a feature that we still give as administrative privilege to some people
Detect home button press in android
I tried this link, as well as other links to override the functionality of the long press on the Home button but I couldn't capture the press on the Home button.
Question:
Q1:
Is there a way to disable access to settings from notification bar, like hide the settings icon from the notification bar or even disable notification bar completely?
Q2:
Is there a way to intercept long presses on the Home Button or to change what the long press on the home button does?
Any help would be much appreciated. Thank you
Problem Fixed.
The application logic was to get the foreground application package using
getRunningTasks(int maxNum) which does not work after the lollipop update, so I added the code from the answer to this question: How to get recent tasks on Android "L"?
Thank you Marcin Orlowski .

Disabling the home button on a bluetooth keyboard programatically in an android application

I'm making an Android app using Xamarin and C#. The app will always be running in Kiosk-mode in which the bottom navigation bar of the device will be removed and navigation outside of the app is blocked.
However, when the user connects a bluetooth keyboard they can hit the physical home button and return to the android home screen which should not be accessible.
I'm aware that there are ways to disable the home button, but I haven't been able to get any of them to work properly as they're generally hacks since Android doesn't directly allow developers to intercept the home button.
Is there anyway I can remap the home key of bluetooth keyboards connected? Are there any other solutions to this that I maybe overlooking?
You can't intercept Android Home Button due to security of device, however if you have rooted device you can experiment with Android Key Layout Files https://source.android.com/devices/input/key-layout-files.html
But that requires root on device
Another method with root is to find the correct /dev/input/eventX device, get exclusive access to it, and then use the /dev/uinput interface to create a new device. Then write all events from the keyboard other than home key to the new interface. I haven't tested this, but in theory it should work.
You could perhaps create a dummy launcher that simply exits as soon as it starts. But it would disable the home button altogether, not just on the BT keyboard.

Android application which you cannot close

Is there any programming tricks that makes your application unclosable?
For example: You touch the back or the home button, but they don't do anything.
Or at least is there a way that your application blocks some applications to open?
I don't think you can stop user from moving your application to background unless it's some kiosk mode app. And the method to do that is to become device administrator and override all possible callback methods - home, back, settings, notification area etc.
If you just want to prevent your app from getting closed due to user activity you can show a persistent notification. This will allow you app to run in background even if user presses home button.
Make a launcher/Home screen app:
When users click the home button, your app will show.
You control ALL apps that can be started
On devices running android lolipop, you can use the screen pinning option available in your ROM.
NOTE: This is ROM feature, you don't have to do anything in your app.
See this great article about it.
yes its to get set the on backpressed method to.
moveTaskToBack(true);
finish();
Are you trying to hack in android OS ? Let me tell you that android apps are sandboxed, which isolates your app data and code execution from other apps.

Reset default launcher when app is closed

I have created a children's app that has a child lock using a custom launcher, however I have one small problem. When the app is closed and the home button is pressed the dialog to select the default launcher is displayed. Is there are way to reset the default launcher when the app is closed?
You cannot make any particular app be the default. However, you could use PackageManager and setComponentEnabledSetting(), to disable your activity that has the HOME category. Re-enable that when the user wants to have the choice of using your home screen again.

Adding an item in existing frameWork setting option list android

Hie all,
I created one homeScreen Application and it working fine for me . one thing what i am seeing is every time i click on the HOME button it list me the native home application and the third party application which i installed in it . the below figure explains the context
this is somewhat an extra work to user to select the home screen every time he presses the home screen. so what i was thinking is that to give the option for user in the settings->display seetings-> so that he can choose the application which he want .
as i ve access to complete android file system and i can create my own image and test in the development boards . The problem here is i am unable to add item to the existing settings code . or u can suggest me the other solution. i tried with the Display settings class in mydroid.
You can not change system settings (i.e. alter the menu) via code on normal (non-rooted) Android devices.
User can set the default action by ticking "Use by default for this action." on selector screen. From then on user will not be asked to select the action, instead the default action will be invoked.

Categories

Resources