How to remove search button in AOSP Settings app - java

I am building AOSP for a custom device which is running only one app. The user of the device should be able to connect to wifi, but not to be able to make any other settings.
Unfortunately the settings app of Android 10 has this search button in the Actionbar (see screenshot). From here the user could jump to any other menu in the settings.
I want to remove the search button but i cant find the place where it is inserted. It looks like that it is dynamically created by PreferenceScreen.
Anyone knows where to find it.

Delete the searchbar from packages/apps/Settings/res/layout/settings_homepage_container.xml
<include layout="#layout/search_bar"/>

Related

Is there a way to detect when a popup window appears in Android

I started a project of a windows program that connects to an android phone and gives the user information
about it, so I want to display all of the popups that appere on the phone. to do this I need the app version of the program to catch them somehow and give me the name of the app that sent the popup and the popup's contant. is it possible?
it would be kind of security issue if any app could do that... you can try with AccessibilityService with some permissions for reading screen/running Activities and checking style of every Activity is this "popup", but note that some of them are just DialogFragments. So I doubt you can recognize "popups" this way in a reliable way. Look for AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED for more info

Please provide the path to the Android SDK: Android SDK path not specified [duplicate]

This question already has answers here:
Android SDK path not specified
(6 answers)
Closed 4 years ago.
When I run Android Studio, it says
Please provide the path to the Android SDK: Android SDK path not specified
I tried the to try the solutions that were already posted, but I didn't understand them.
Also, I already have java installed, but I want to word with kotlin.
Cancel the dialogue box asking for the Android SDK path and do the following:
Open Android Studio IDE. Find the down arrow icon, should be second last icon in the toolbar. Click that. You will see a path for Android SDK Location:. Click the edit link to the right of that. This will bring up the SDK Components Screen. If you can check the boxes there, check them. They may already be checked or they may be disabled. You can leave the path as is, for me its:
C:\Users\<user name>\AppData\Local\Android\Sdk
Depending on whether you had Android Studio before it may say it has detected a previous version and it will only download the components it needs. This is normal. Now click the NEXT button. A confirmation screen will come up with Setup Type and SDK Folder. If you want to change your SDK Folder this is your last chance, if not, click NEXT again.
It may bring up a Terms & Conditions screen, click the Accept radio button then NEXT. It will go and download the Android base SDK. When it's completed click FINISH.
You will then be taken to the Platforms screen where you can select which Android platforms you want to support. ie, Android 9.0 (Pie), Android 8.1 (Oreo). Select all the platforms you need then click APPLY.
The downloader will grab all those packages for you. Next, click the SDK Tools tab. Check the boxes of the tools you want and click APPLY. It may bring up a Terms & Conditions screen again, click the Accept radio button then NEXT. When completed just click FINISH and you're good to go.
This is an issue with the Android Studio Plugin for Kotlin. When you use the latest version of Kotlin, you also have to make sure to update the plugin:
Tools > Kotlin > Configure Kotlin Plugin Updates
If the answers mentioned above and at several other threads in Stack overflow did not solve your issue of Android Studio then probably you and I have the same issue. I was stuck here since last 20 days and was struggling over it. Finally able to resolve it.
Go back to the Android Studio download page. Bottom of the page contains download link to "sdk-tools-windows-4333796.zip". Just download the same and extract to a suitable location. Now mention the path to this folder in Android Studio. It will then install the suitable tools for Android Studio to work.
You can find the path going into Android Studio -> Configure -> SDK Manager -> On the top left it should say SDK Path.
Usually it is
C:\Users\<username>\AppData\Local\Android\sdk
Go to SDK Manager under Android SDK location provide the path which you gave during installation. If you had installed by default it should be in your
C>Users>USERNAME>AppData>Local>Android>SDK.
NOTE: AppData is hidden by default. So enable hidden items from View.
Took me a while to figure this out as the documentation is not clear on this at all. Cancel the dialogue box asking for the Android SDK path and do the following:
Open Android Studio IDE. Find the down arrow icon, should be second last icon in the toolbar. Click that. You will see a path for Android SDK Location:. Click the edit link to the right of that. This will bring up the SDK Components Screen. If you can check the boxes there, check them. They may already be checked or they may be disabled. You can leave the path as is, for me its:
C:\Users\<user name>\AppData\Local\Android\Sdk
Depending on whether you had Android Studio before it may say it has detected a previous version and it will only download the components it needs. This is normal. Now click the NEXT button. A confirmation screen will come up with Setup Type and SDK Folder. If you want to change your SDK Folder this is your last chance, if not, click NEXT again.
It may bring up a Terms & Conditions screen, click the Accept radio button then NEXT. It will go and download the Android base SDK. When it's completed click FINISH.
You will then be taken to the Platforms screen where you can select which Android platforms you want to support. ie, Android 9.0 (Pie), Android 8.1 (Oreo). Select all the platforms you need then click APPLY.
The downloader will grab all those packages for you. Next, click the SDK Tools tab. Check the boxes of the tools you want and click APPLY. It may bring up a Terms & Conditions screen again, click the Accept radio button then NEXT. When completed just click FINISH and you're good to go.

How to add Android Device Monitor to Main Toolbar in Android Studio?

I'm following Udacity's Developing Android Apps class, and in their video it shows an icon at the top of Android Studio for a shortcut to Android Device Monitor. My shortcut icon is not there so I had to search to find it.
I'm trying to add it to the toolbar by right clicking and going into "Customize Toolbars and Menus" but I can't find anything. I googled multiple different things and can't seem to find the answer. Not sure if this is a recent change from Android Studio updates.
Is there a way to add this to the top toolbar? Thanks!
fortunately it is :)
open the customize menu and toolbars by right clicking the toolbar.
Navigate to Main toolbar-Android.MainToolBarSdkGroup and then click Add after... (in fact you can choose whatever position you like most).
Then simply choose All actions-Main menu-Tools-Android-Android device monitor
Profit – robot is there :)

Settings activity

I am making an new android app and I would like to make a settings activity where the use can see about info and settings.
So on android devices you have buttons for settings or else it is presented on screen, when I click that button I do get a menu with the name settings (which I guess eclipse once made automatically) and I do have a activity_settings (as a launcher activity, I don't know if that has any influence or what it means actually) but how can I link the menu tab and the activity?
I mean that when in the menu is clicked on the settings-tab the activity opens.
Can you help me out?
Thanks in advance,
Ide
Yes, what Samarth is saying is true. Read the developer guide before you post questions here. A simple google search will give you links as well.
Here's a complete explanation on how to implement Menus and how to do it: http://developer.android.com/guide/topics/ui/menus.html
Also a similar question on how to create an option Menu: Android, How to create option Menu

android google maps button on popup

Okay. What I have so far is an Android app with a Google map on which I've placed a bunch of icons that, when clicked on, create a popup with some text on it. Is there any way to place a button on that popup? If this is not possible, is there some way to make a button appear when an icon on Google Maps is selected?
In case you're wondering, the code I'm using now looks like this.
itemizedOverlay.addOverlay(new OverlayItem(point, title, text));
//actually a whole bunch of OverlayItems, each with their own location and text
//but this is the general shape of it.
mapOverlays.add(itemizedOverlay);
Edit:
There are different kinds of popups used with different versions (check yourself in the emulator versions) of the GoogleMaps app. The first popup simple displays the title of the location (Android 2.3.3).
The second popup shows the title and arrow indicator. (Android 4.0.3)
Interesting enough: I noticed that both popups are clickable and start another activity that shows details about the location.
The mapviewballon project https://github.com/jgilfelt/android-mapviewballoons/ allows you to use your own custom layout for these popup.
I did not test with buttons on it but I do not see why I would not work.
The example projects shows the following types of popup balloons.
Here is another project that creates a custom popup balloon. The project can be downloaded at the end of the article.

Categories