I need to launch appliaction in fullscreen mode (or just not leavable) on Wooky Reader tablet (it is most likely the same as Archos 70b), which runs on Android 2.1.
I've made some tries that did not work:
in manifest:
android:theme="#android:style/Theme.NoTitleBar.Fullscreen
i've add permission:
uses-presmission android:name="android.permission.STATUS_BAR
just for the case.
In code i tried:
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(R.layout.main);
And combinations of these.
I know that removing status bar is "prohibited" on tablets, but i've found some ways for Android 3.0+ versions. So is there any way to do that on this specific tablet?
I will be glad for any ideas.
EDIT: now i tried:
uses-permission android:name="archos.permission.FULLSCREEN.FULL"
-> did not work
Related
This is my code for onCreate():
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(new GameView(this));
getSupportActionBar().hide();
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
For some reason, some of the phones I've tested this app on cause the app to crash when it is opened in portrait mode. The app is supposed to and is set to be played in landscape mode. If, however, you open the app while holding the phone landscape style, it does open and will not crash.
I need the app not to crash when opened in portrait mode, and then it needs to go to landscape mode.
Thanks.
give screen orientation in manifest file
<activity android:name=".LoginPage"
android:screenOrientation="landscape"/>
Add this in your manifest file in your activity.
android:configChanges="keyboardHidden|orientation"
I'm trying to hide the title bar on my app by putting the following code in the manifest file
android:label="Sound Board" android:theme="#android:style/Theme.NoTitleBar"
It looks to be working on my tablet, but not on my smart phone. My tablet is version 3.1 and the smart phone is 2.2
-Ted
I am not sure if that theme was available in api level 8 (2.2), but having following code in your Activity will provide the same result:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_layout);
...
}
I've successfully got my application compiled into an apk file, and deployed to my Android devices.
But when I run it there, the notification bar is present and I'd like it to be fullscreen, without the notification bar.
This is the bar at the top of the screen, with the battery usage, wifi/3G connection, new email icon, etc.
How do we hide this in our compiled apps with Sencha Touch 2?
I have set fullscreen: true in the config of the first view which is loaded (the log in screen), and have also set:
Ext.application({
viewport: {
autoMaximize: true
}
});
You could change this in your AndroidManifest.xml:
<application>
<activity
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
...
</application>
You can actually modify the AndroidManifest.xml template in the SenchaCmd to get this, as explained in the Sencha forums.
That file will be in Sencha/Cmd/<CmdVersion>/stbuild/st-res/android/AndroidManifest.xml. You need to set the theme property on the application tag like this: android:theme="#android:style/Theme.NoTitleBar"
with the whole tag looking like:
<application android:icon="#drawable/icon" android:label="%s" android:theme="#android:style/Theme.NoTitleBar">
However, this solution is still extremely crappy and I'd love to see something that works without patching Sencha's code.
Simply add this to make the screen fullscreen this.setTheme(android.R.style.Theme_NoTitleBar_Fullscreen); before super.onCreate(savedInstanceState);
OR
add this.requestWindowFeature(Window.FEATURE_NO_TITLE); and
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) before setContentView
For example:
#Override
public void onCreate(Bundle savedInstanceState){
/**sets Theme and Style (must be set BEFORE super.onCreate)*/
this.setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
OR
#Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
/**Changes Window. Removes title and/or notification bar (must be set BEFORE setContentView)*/
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
(Or you can do it via the Manifest as what homer_simpson said.)
Got this app running in kiosk mode and would like to run it on full screen.
Already got rid of the application's grey title bar, but still got the home, volume, back and other buttons on the top bar as you can see in the picture.
The device is running android 2.2 firmware.
Any help is greatly appreciated!
So there is more approaches:
First, you should specify this feature in your Manifest.xml
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
Or in your onCreate method work both these approaches:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
or
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
The tablet you are running on is running a hacked version of Android, one that does not comply with the Compatibility Definition Document. As a result, you probably cannot get rid of that bar, unless you replace the firmware with something else.
The recommendations that the other provided is the right answer for compatible Android devices.
Make Your activity to look something like this in manifest
<activity
android:name=".HelloActivity"
android:label="#string/laptop"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
In android manifest use this line
<activity android:name=".yourActivityName"
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen">
and in your class use this line in oncreate method
requestWindowFeature(Window.FEATURE_NO_TITLE);
this code works fine for android 2.2 i have tested and its working.
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity);
I'm trying to do an Android-Tablet app for presentations on trade fairs etc. I don't want to upload the app to the app store, only use it on my tablet.
I try to run the app in ful screen mode (without status bar) with:
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
Works great. I try to disable the home button with:
#Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
}
in my OnCreate-Method. Works great.
But if I try to use both in one app, only disabling the home button still works, any idea what i can do about this?
Thank you!
Try declaring the activity as fullscreen in AndroidManifest.xml, and then doing what you already do to capture the home button
<activity android:name="..." android:label="..."
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen" />