How can I use the space above the navigation bar on Android? - android

I have the following problem: in all activities of an Android app there is a blank (black) space above the navigation bar at the bottom, on specific devices (Pixel 3a and Redmi Note 8T):
I have tried many things, most search results have to do with setting the app to full screen, which basically only takes care of the status bar (either hiding it or making it translucent). The devices I have tested this with are on Android 9.0 and 10.0.
Now, it is important to note that on the Redmi Note 8T (Android 9.0) there is this button in the navigation bar:
If I tap this button, app needs to be started again, but the gap is gone (correct):
How can I get rid of this gap programmatically?

Related

Android Emulator Not clickable on Top

I'm using:
Mac OS High Sierra 10.13.4
Android Studio 3.1.1
Nexus 5X emulator with API level 27
On its top, the emulator is not clickable or draggable, I just cannot drop down the notification bar or click the back button in app. This is not happening at the bottom of the emulator...anyone experiencing the same issue? I don't know if this could be useful, but I'm using a double monitor (macbook + led panel).
EDIT: I think there's a problem with smaller devices. same problem with Pixel 2 (NOT XL).
Works fine with Pixel 2 XL.
EDIT 2: Pixel 2 works fine on API level 25 (Nougat).
I thought that experienced exactly this issue with the Pixel 4 API 31 emulator running in AndroidStudio 2021.1.1 on Ubuntu today; however, it turned out to be user expectations of older APIs combined with a barely-readable notification icon in the bar.
I wanted to open the device settings; my own devices are older Android 9 and to do this, I just tap the notification bar, it expands, and I click on the gear icon which immediately appears in the notification bar area once the pane expands to show quick settings.
The API 31 UI acts differently - first of all, I thought there was a permanent settings gear already in the notification bar. I thought that was odd, but, okay, I'll click it to open... turns out that this is not the case: it's an actual notification icon that looks like a settings gear from the Google Setup program trying to complete the initial setup on the phone (this was a new emulator). Tapping it did nothing, of course, but was frustrating because I thought it was a setting gear. Strike one, and had me googling for "Emulator top bar not responsive" leading me here.
Secondly, clicking to "tap" on the notification bar in API 31 doesn't immediately expand it like it does on my API 28-based Note 8: I had to "click and swipe" down (awkward with the mouse) to open notifications. And in API 31, even this is not sufficient to see the actual phone settings gear either! You have to swipe down one more time to further expand the notification pane and finally you can see the gear to open settings.
These two things combined to make me believe that the emulator was non-responsive when clicking the notification bar at the top.
I hope this helps someone else realize what might be happening - took me more time to write this up than the actual "problem" cost me, but I was so annoyed at this "broken" emulator which wasn't opening the settings for me that I had to write it up!

How to remove black bar menu from the bottom of android screen?

Device: HTC One mini
Android OS: 4.3
app minSdkVersion="8"
app targetSdkVersion="11"
I'm building apps for old Android 2.2 phones and higher and have duplicated my menu into a popup window in case newer Androids have issues with it. The black bar bellow shows the lone menu button on a specific device (HTC One mini), but my benefactors want it removed/hidden from the final version.
I wish to keep using the phisical menu button normally on older phones, so it would be best to disable it for specific OS versions or models of phones.
How do you hide/remove the useless bottom black bar? Preferably without raising the targetSdkVersion?
How do you hide/remove the useless bottom black bar?
Set your targetSdkVersion to 14 or higher.
Preferably without raising the targetSdkVersion?
Chop the bottom portion of the phone off with a very sharp axe. Note that this may void your warranty on the phone.

Samsung galaxy not displaying menu

I have created an android program.It has a menu button and I published it in Google play.But in my phone Samsung Galaxy not showing that menu .I tried it in LG Nexus 4 it works fine .Then I tried in different tablets and works fine .Micro max ninja not showing menu.
Also I want to know about menus of different style .How to enable horizontal scrolling?
What kind of Menu button? The one that is displayed on the Action bar or digital buttons below? Because it might not be displayed because the phone might have a dedicated, physical menu button.
As from the Android docs:
The action overflow in the action bar provides access to your app's less frequently used actions. The overflow icon only appears on phones that have no menu hardware keys. Phones with menu keys display the action overflow when the user presses the key.

Android uiautomator - working with with bars

While trying Android uiautomator utility i face some problem working with bars. (such as bottom bar that display time, wifi status, battery etc...)
The issue is that the bottom bar seems to be not part of the display and when trying to click on it (using uidevice method click(x,y) ), i am getting return value of false - , clicking on pixel above it works just fine (with return value of true)
when using the uiviewer utility clicking on the bar does not update the right pane, e.g: the "display" does not seem to include the bar at all.
is there a known issue with bars and uiautomator ?
can bar be test/interact using uiautomator ?
Thanks in advance, Gal.
My initial investigations match your findings - neither the top notification bar (that displays the time, status indicators e.g. battery, network connectivity, etc) or the bottom bar with icons for the soft keys (back, home, etc.) are available in uiautomationviewer despite being contained in a FrameLayout.
(Note: I'm checking on a Nexus 4 phone, and a Nexus 7 tablet. Some tablet devices have the notification bar at the bottom of the screen e.g. my A500)
Based on my preliminary findings UI Automator will not be suitable. Perhaps monkeyrunner would be more suitable e.g. see the following question and answer Can monkeyrunner interact with android notifications?
When i tried to use the monkeyrunner touch method with a coordinate locate inside the bar it work fine.
I guess this is something that Google will fix in future releases in the UiAutomator.
Thanks again,
Gal.

android How to set Hidden this bar (in tablet Android 4.0.3)

I'm trying to make my app to Fullscreen (with no any bar) how I can coding to set it. (Android version 4.0.3)
Thx very Much
You can't hide that bar. On Honeycomb(3.0) there was a bug that would allow it to be hidden(on a rooted device), but it was fixed in ICS(4.0). (Note: see this answer for more techniques that worked on 3.0)As of now there is no way to do it on 4.0. Unfortunately, because devices no longer have physical buttons the navigation buttons (home and back) have to be put onto the screen. Because that bar contains the navigation buttons if you were to hide it, it would be possible to "lock" the user out of the device by not allowing them to leave your application(at least until they rebooted into safe mode).
So if you want to do that you'll have to make your own custom version of the OS to allow for it.

Categories

Resources