Full screen not so full

mbisso

Member
Licensed User
Longtime User
Good day everybody, I have been developing an application on two different tablets. On the first one, with Android 2.2, I select full screen from the project activity properties and it works fine. There is no title bar or status bar. But on the second tablet, which is Android 2.1, there is no title bar but the status bar remains. I have read forums that this is common on some tablets, the status bar won't go away. Does anybody know how to remove the status bar from within basic 4 android.

Thanks.
Mike
 

mbisso

Member
Licensed User
Longtime User
Yes, the Include Title IS unchecked and the full screen option IS checked. The fact that the two tablets react different ways to the exact same apk leads me to beleive that this is a build issue in the Android OS. I have read on different forums that with honeycomb or eclair (which is the build of the second tablet) you could not hide the status bar, only dim it...
 
Upvote 0

mbisso

Member
Licensed User
Longtime User
I need to try this

Hello, I figured out that on the particular tablet, I need to add this to the main.java

getWindow().setFlags(
WindowManager.LayoutParams.NO_STATUS_BAR_FLAG, WindowManager.LayoutParams.NO_STATUS_BAR_FLAG);

Can you tell me how to do this. I know that the main.java gets re-generated when I re-build so there is no use is adding it after.

thanks
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
If you can't write a library you can do it with version 1.7 of my Reflection library which I haven't yet posted but will do so tomorrow after I have added some documentation comments.

I can't find a value for NO_STATUS_BAR_FLAG, apparently it has been replaced by FLAG_FULLSCREEN. This works on my ZTE Blade.

B4X:
   Dim Obj1 As Reflector
   Obj1.Target = Obj1.GetActivity
   'Msgbox(Obj1.TypeName, "Activity")
   Obj1.Target = Obj1.RunMethod("getWindow")
   'Msgbox(Obj1.ToString, "Window")
   Obj1.RunMethod3("setFlags", 1024, "java.lang.int", 1024, "java.lang.int")
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Actually I overlooked that you can already do it with version 1.6. It's my age you know. :(

Use the name of the Activity

Obj1.Target = Obj1.GetMostCurrent("Main")

instead of

Obj1.Target = Obj1.GetActivity

EDIT:- Sorry, I just realised my own copy of Reflection is now two versions in advance of the posted one as I never posted 1.6. I'll post it tomorrow.
 
Last edited:
Upvote 0

mbisso

Member
Licensed User
Longtime User
No joy in mudville

I tried the library by Andrew and both suggestion, no cigar. I also tried to hide it from the manifest using:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

still I struck out. I contacted Archos, makers of the Arnova 8 tablet (which is giving me the pain in the @$$) They told me that it there build of Android, eclair, that does not allow the status line to be removed. Oh well, I guess I'll have to live with it.

Thanks for the hand guys...
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
FWIW, I have an Archos 70-250G. In full screen mode, I don't get the title bar nor the status bar, but I do get the menu keys. Even the menu keys must be removable because there is a Clock app that comes with the A70 which hides the A70's menu keys.
 
Upvote 0

biometrics

Active Member
Licensed User
Longtime User
I've tried the above suggestions but my full screen app still shows the Android toolbar at the bottom.

I tried adding the following to the manifest: SetApplicationAttribute(android:theme, "@android:style/Theme.NoTitleBar.Fullscreen")

It's a Samsung Galaxy Tab 7.0 Plus running Android 3.2.

Any ideas on how to get rid of the toolbar?

If it's via the manifest can you give me the exact format? Or your Reflection library code?

I'm using Basic4Android 1.8 and the Reflection 1.9 library.

Thanks in advance.
 
Last edited:
Upvote 0

biometrics

Active Member
Licensed User
Longtime User
Erel,

If I root the device is it possible to terminate the toolbar process from B4A? That would have the effect of hiding it, not so?
 
Upvote 0

biometrics

Active Member
Licensed User
Longtime User
I used the info here: How to programmatically remove/hide the system bar in Honeycomb (requires root) | Using Android in Industrial Automation combined with www.b4x.com/forum/basic4android-getting-started-tutorials/6886-running-shell-commands-superuser.html and it works! Yay.

B4X:
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
Dim Result As Int
Dim Ph As Phone

StdOut.Initialize
StdErr.Initialize
Runner = File.Combine(File.DirInternalCache, "runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "service call activity 79 s16 com.android.systemui" & CRLF & "exit") 'Any commands via crlf, and exit at end 
Result = Ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
Msgbox(StdOut.tostring, "")

Note the device needs to be rooted.
 
Upvote 0
Top