Enabling my application to show up in the Android Global Search - android

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.

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.

Overloading bottom menu keys

I'm making a toddler game and trying to prevent them from accessing the rest of the phone from within the app. I know you can overload the back key on the menu but how about the other 2 keys? I just want to add a confirmation screen that only adults can deal with so toddlers wont be able to mess with the phone and get out of the app.
Hi you should use the "kiosk mode" features present on Android sdk. Take a look here.

how to permanently override android soft keys behaviour and display through

I am relatively new to android and want to create an application that permanently overrides androids basic softkey behaviour and view (for devices with soft keys).
Some functionalities I want to implement are changing the size of the softkeys window at the bottom, change its images, and possibly change its functionality.
For example, the user can set the size to of the softkey to be "large", "medium" or "small". And I can change the functionality of the back button to open say a particular application instead of going "back".
I'm basically looking for a high level answer as to how to do this, a basic direction of what I should read/study in order to be able to accomplish this. I realise this may require root access.
Please note that I want this behaviour to change not only in my application but I want the effect to exist on all applications. If this requires the application to be running atleast at the backend, that is fine.
After doing some decent amount of search, it seems I will have to make changes in the systemUI.apk, or possibly get its source code and modify it. Is this correct?
Thanks in advance.
I don't think even root is going to be enough for the type of changes you are describing. You're going to need to edit the Android source code and build your own system image.
Well you can't override system resources because they are part of the system image.
What you are looking for is called Home Application which can be developed like any other android app no need for root , you can find an example for it in your sdk samples.
Home Sample Application.
your app would be responsible to have UI components to send the user to all of the phone functionalities which includes:
Place for wegits
Place for apps listing (menue)
Access telephony functionality (call, phone history ...)
Access settings.

Is it possible to block Android market programatically?

I want to enable/disable the Android market programmatically for my kids app (with a checkbox). Is this possible? How?
Generally, no. You cannot affect the behaviour of other apps from your app. There are tricks that allow you to monitor what has been stated and you can bring your own app in the foreground to sort of 'block' it, but this is neither supported, nor guaranteed to work on all devices and Android versions.
To disable the play store, do as you would with any other app if you were going to delete it, however in replace of the delete buttin wil be a disable button.
If you do not want to disable it all together, you can open the app, click menu, and then settings, and then half way down on the list you are abe to set a passcode for purchases.
EDIT
I know hat you said programmatically, however this could still be a solution as to what you may be looking for instead as a workaround.

How to detect which application is set as default in android?

I am stuck with a problem. In the past, i set an application as default launcher on my android phone when the dialog popups up for selecting the default application and now i have forgot which application it was?
How can i detect which application has been set as default?
Any help appreciated.
Unless your aim is to do this programattically(I don't think you can, but I could be wrong) This would be a better fit at Android Stack Exchange
The easiest way will probably be to go into manage applications and find all of the home screen ones, select each of them and scroll down until you see the "Clear defaults" button. The one that is not greyed out is the one that is currently set for default.

Categories

Resources