I am trying to make my app fill the screen for normal displays, but this is the result when I boot it up on my Samsung Captivate i897: http://oi39.tinypic.com/2qamhqd.jpg
The screen's width is filled correctly, but not the vertical side. When I set android:anyDensity to "true" in androidmanifest.xml, the app's screen is fully shown, but only on the bottom-left corner of my screen: http://oi44.tinypic.com/29w7n9v.jpg
Can someone tell me how to make the app fit to screen?
Also, when an animation that takes up the whole screen is played, I get blurred and stretched images around the screen, as seen in the first screenshot link. This does not happen when I run it through moai.exe's OpenGL simulator (I am using moai-sdk and rapanui-sdk to develop my app. I imported them both into eclipse to create the apk file). I don't understand what could be the problem.
Here is how my androidmanifest.xml looks:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0"
package="com.gamefromscratch.moai">
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens="false"
android:anyDensity="false"/>
<application
android:icon="#drawable/icon"
android:debuggable="true"
android:enabled="true"
android:persistent="false"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<!-- Moai -->
<activity
android:name="MoaiActivity"
android:label="#string/app_name"
android:screenOrientation= "portrait"
android:launchMode="singleTask"
android:configChanges="keyboard|keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ziplinegames.moai.MoaiMoviePlayer"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<receiver android:name="com.ziplinegames.moai.MoaiLocalNotificationReceiver"></receiver>
<!-- EXTERNAL DECLARATIONS: Placeholder (DO NOT MOVE OR REMOVE) -->
</application>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
<!-- Moai -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- EXTERNAL PERMISSIONS: Placeholder (DO NOT MOVE OR REMOVE) -->
<uses-configuration android:reqTouchScreen="finger" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="true" />
</manifest>
following attribute used for supports for multiple screen size, try this
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
To avoid image blurring problem you have to create separate images with more pixel for drawable-hdpi,drawable-xhdpi and drawable-xxhdpi folder.
you can create separate layout folder for different size layout-large,layout-xlarge.
try this also, this will solve orientation problem
android:screenOrientation="unspecified"
android:configChanges="keyboardHidden|orientation"
hope this will sove your problem.
Related
We are trying to submit a TV only android app to Google play store, but the opt-in for tv is rejected because:
No full-size app banner
Your app does not contain a full-size app banner or is it not visible in the launcher. We are targeting 1080P, which we consider xhdpi. Apps should include the banner in the xhdpi (320 dpi) drawables folder with a size of (320px × 180px). Please refer to our Home Screen Banner and UI Patterns documentation.
The title should help users identify apps in the launcher. Please refer to our Visual Design and User Interaction documentation for more information.
For example, your banner does not fill the entire banner space. You can refer to the attached screenshot for additional information
They provided a screenshot, although it doesn't display like this according to our tests:
The banner provided is exactly the correct dimensions, in the drawable-xhdpi directory, saved as 320dpi. Google are unable to help us past this point and we are unsure how to proceed.
Here is the AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackage">
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:name="android.software.leanback"
android:required="true"/>
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:allowBackup="false"
android:theme="#style/AppTheme"
android:banner="#drawable/banner"
>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".TvActivity"
android:label="#string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
What could be causing this? Any help appreciated!
i'm working on an Android/iOS Application. When the Keyboard opens up for the login (username and password) all gets shrinked together and it looks like this:
normaly it should not be compressed. It should move up, and give me a clear view on what i'm typing.
Yes, so i don't know, what to do. I tried to work with percentages in the whole app (width/height) - maybe this is the reason, why my View gets not moved up but shrinked?
I looked around here at stack and found some suggestions like:
<activity
...
android:windowSoftInputMode="adjustPan">
</activity>
or adjustResize instead, but nothing of that worked for me. On iOS all works fine. What i want the view to do is that he just moves a bit up, and nothing gets resized.
I hope you can help me and if you need more information, please let me know, i'll update or comment my Question then.
Cordova 3.5
jQuery/jQuery-Mobile
Plugins: Camera/Console/Device/Dialogs/File-Transfer/File/inappbrowser/Splashscreen/Statusbar/vibration/geolocation/network-information
Eclipse with Genymotion emulator
Devices: Galaxy Note 10.1, 4.4.2; Xperia Z2 4.4.2
This is what my Androidmanifest looks like:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0" package="de.*****************.de" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:screenOrientation="portrait" android:label="#string/activity_name" android:launchMode="singleTop" android:name="********" android:theme="#android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustPan">
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="20" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>
I was stuck with the same problem, few days ago.
As you said, you have given height and width in percentage.
When the android keyboard appears the window is resized and its height is the screen size excluding the keyboard size.
Giving height in percentage to the main container of your page, (i.e. to the body tag) will shrink the height of your page when the keyboard appears,
Setting the min-height for the body tag once on document.ready worked for me.
$(function(){
$("body").css("min-height",$(window).height())
});
Add this In your manifest .I hope it will works. For more information Do Click HERE
android:windowSoftInputMode="stateUnchanged|adjustResize"
I am targeting api 10. On my droid maxx (4.4) there is this clickable but empty bar that appears on the side of the screen as seen here: http://i.stack.imgur.com/TSjmk.jpg . On my Nexus S (4.1.2) the bar is not present. On my friends Nexus 4 (4.4) he has a bar, but it contains the phones main buttons, the nexus 4 doesn't have off-screen buttons as mine does.
If I target api19, the bar goes away on my droid maxx, obviously thats not really a solution.
The bar renders on top of my application, and is just visually undesirable, so it's a real problem. What this bar is called and how I can get rid of it? Thanks.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.logicaldreams.edensharbor2"
android:versionCode="1"
android:versionName="1.0">
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:allowBackup="true" >
<activity android:name="edensharbor2"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:configChanges="keyboardHidden|orientation"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
How can I change the launcher icon and its label from my application runtime in Android? (if it is possible)
I mean the properties defined in AndroidManifest.xml: android:icon and android:label. I want to replace it by the image I take from the camera.
This entire answer is from this post and it was taken from P-A and CommonsWare.
You cannot change the manifest or the resource in the signed-and-sealed APK, except through a software upgrade. or
Try this, it`s work fine for me but not sure for all devices:
Modify your MainActivity section in AndroidManifest.xml, delete from it, line with MAIN category in intent-filter section.
<activity android:name="ru.quickmessage.pa.MainActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"
android:label="#string/app_name"
android:theme="#style/CustomTheme"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />//DELETE THIS LINE
</intent-filter>
</activity>
Create <activity-alias> for your app, for each of your icons. Like this
<activity-alias android:label="#string/app_name"
android:icon="#drawable/icon"
android:name=".MainActivity-Red"
android:enabled="false"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
Set programmatically ENABLE attribute for necessary
getPackageManager().setComponentEnabledSetting(
new ComponentName("ru.quickmessage.pa", "ru.quickmessage.pa.MainActivity-Red"),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
Note, At least one must be enabled and above code perfect working up to 4.0 not tested into >4.0.
Edit: your original answer didn't specify you wanted to do it at runtime. Below the line is how to do it before it compiles. As for doing it programmatically at runtime:
From this answer:
You cannot change the manifest or the resource in the signed-and-sealed APK, except through a software upgrade.
But also, the accepted answer figured out a "hack" or some cheating way to do it (I presume). I haven't tested it, but there is a source for you to check out.
Or, this link apparently describes how to do this using the "widget" approach.
So lets say your manifest was like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="yourPackage"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
...
You would change the launcher icon by putting images into your drawable folders:
Project folder --> res --> all the drawables
Then you would change the android:icon="#drawable/ic_launcher" to be android:icon="#drawable/whateverTheNameOfTheImageIsYouPutInTheDrawablesFolders"
To change the label:
Open up your strings.xml file which is located:
Project folder --> res --> values --> strings.xml
And look for the string that looks like this:
<string name="app_name">Your App Name</string>
And just change Your App Name to be whatever you want the label to be.
Summary:
android:icon="#drawable/ic_launcher" determines your launcher icon, so just add images to the drawable folders and change ic_launcher to whatever the name of image is that you want to be the icon.
android:label="#string/app_name" determines your "label" so just look for app_name (because the label is referenced to #string/app_name) in your strings.xml file and change the contents of app_name.
Hello everyone I am new in Sherlock Actionbar I am having a very strange problem in my sample application. The problem is that when I rotate to landscape from the portrait its behavior is normal but when I rotate back to portrait mode the layout does not change back to portrait mode.
Below are the screen shot of the problem I am facing.
OriginalScreen
Did rotation to Landscape
Again rotated back to original orientation i.e. Portrait Mode
As you can see that on the third picture the problem I am facing.
I am using the latest version of ActionbarSherlock library.
Edited
My manifest File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.actionbar_sherlockexample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.actionbar_sherlockexample.MainActivity"
android:theme="#style/Theme.Sherlock"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks
This is an issue with emulator . If you will run it on real device , it will work fine .