How do I provide "hidden" menu options in my Android app? - android

I'd like to add a "hidden" or "developer only" menu option to my Android app for debugging purposes — basically I just want a menu option which, when selected, copies the apps database out to a file somewhere on the users disk.
Is there an easy way to achieve this? I'd prefer something that's hidden normally but can be enabled "out in the field", but something that requires a quick and easy compilation flag would be OK too.

In my knowledge there is no developer only option to do exclusive things in Android. You can derive your own i.e. - 10 time click on specific View, specific gesture on any activity. Its up to you!

Related

Disable Bluetooth Tile in Quick Settings Panel

I want to disable Bluetooth tile from the quick settings panel. I am using android 9 and I want to do it on a system app. So if there are some changes to be made in source, I would be happy to know it.
I have found many solutions telling how to add a new custom tile via TileService, but I need to disable tiles that are already present (like Bluetooth tile).
Note: I do not want the feature itself to be disabled, i.e. the user would be able to enable disable feature from the settings app itself. I just want to disable the qs tile.
Searched a bit on cs.android.com and this seems to be the relevant class.
frameworks/base/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
From there you can handle click ( or not handle it actually), or show a "disabled" icon etc.
If you want to "remove" it, then frameworks/base/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java seems to be the class that adds them. It reads from Settings.Secure.QS_TILES
frameworks/base/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java
yes, This file we can edit and remove unwanted tiles.

Android Quick Settings Tile Drop Down Menu

I want to make an application that does something in the background, and to control its behavior, I wanted to have a quick-settings tile.
I managed to get the toggle working just fine, but now I want to know if it is possible to have a 'drop down' menu for the user to be able to choose an option out of 3 possible options. (3 different modes for the 'on' state)
Something like the wifi and bluetooth tiles here, that have that little arrow
Is this a feature only for system apps, or is there a way to do it?
It seems from here that unfortunately third party apps cannot use this feature.
Quote:
Note: You’ll notice some of the system tiles have an additional UI that replaces the whole quick settings pane with a custom UI. Unfortunately, this isn’t available to third party tiles.

react-native - Handling android options menu button click?

I'm developing an Android-/iOS-App with react-native.
I want to allow my customers to select between options upon clicking the "options menu hardware button" in Android (you know, the button usually at the bottom left of the android devices with 3 lines on top of each other, often triggering a menu in the app providing additional options).
Question: How can I listen to the options menu button click?
To clearify, I mean that button:
I know that the button does not exist under iOS and not under all Android phones and I will have to implement another solution for there, but that does not matter at the moment, as I want the button primarily to provide debugging functionality for my customers/testers (e.g. sending me the state of an erroneous screen).
Strangely, I did not find any resources on google regarding this problem, although I would assume wanting to use hardware buttons in react-native is a common task. Maybe I used the wrong search terms - if someone could link me to better terms describing this problem, I'm thankful as well :D.
Only thing I could find is the BackHandler for handling back-button-clicks.

Enabling my application to show up in the Android Global Search

I have an application that I have made searchable, and I want to include it in the Google Search bar by default, or give my users the option of enabling it from within my application. I have already exposed it by adding android:includeInGlobalSearch into my searchable.xml, but how would I enable it from my settings within the application?
I know I can also launch the Settings.ACTION_SEARCH_SETTINGS activity and have them select it, but how would I shift the focus/scroll to my application if it is below the initial fold?
AFAIK, you can't. The user has to enable it, you can't force them to. You can' control the focus scroll either, best you could do is experiment with different names and see how this affects sorting.

How do I write a combined CheckboxPreference / PreferenceScreen?

I would like to have a checkbox preference that takes the user to a new (sub)preference screen if the user presses on the actual text (and not on the checkbox to the right).
Just as the control under Settings -> Wireless -> Mobile Network Settings -> Access Point Names.
Two possibilities:
1) You can get android source code and see how they do it.
2) Check options in this question.
I was trying to move to an specific DialogPreference.
I your particular case I think it's better to create and show a new Dialog.
On my Nexus One, there is no checkbox on the Access Point Names preference. It is also not on the Android 2.1 emulator, the Motorola CLIQ, the Google Ion, or the T-Mobile G1.
The pattern that you describe would seem to violate the way the preference UI is set up.
That being said, if you do find a preference built into Android that behaves the way you want, you can go find it in the open source code. Many of the preferences used by Settings are not part of the public API, but you can clone their implementation into your own project.

Categories

Resources