I have an application not really designed for the tablets. However it works sufficiently well in zoom to fill screen mode. Is there a way to force an application to only be displayed in "zoom to fill screen" mode on android?
See the document on Screen Compatibility Mode.
An application can also explicitly declare that it does not support large screens such that screen compatibility mode is always enabled and the user cannot disable it.
And more detail:
If your application is functionally broken when resized for large screens and you want to force users into screen compatibility mode (rather than simply providing the option), you can use the android:largestWidthLimitDp attribute:
<supports-screens android:largestWidthLimitDp="320" />
Note that this is only when targeting 3.2 or higher. The zooming screen compatibility mode is only available on 3.2 and higher.
Related
I am developing an app, however, I have noticed on phones that have edge-to-edge screens, the black notch at the top blocks out some of the features I've added in (for instance, information on the action bar).
I know there are simple fixes such as using
<item name="android:windowLayoutInDisplayCutoutMode">
shortEdges <!-- default, shortEdges, never -->
</item>
within the activity style, however, I have noticed that the incision of this requires a minimum API level of 27, which is much higher than the minimum of 14 I have been trying to maintain, and I don't want to cut out that high of a percentage of the market.
Do any of you know how to deal with edge-to-edge screen layouts without compromising the minimum API level?
I would advise you to just use newer API, as since then new models with notch started showing up on market (thus Android introduced that API), keeping API 14 as min. You can still support older devices without calling non-existing methods from newer APIs. As you have here only one attribute in XML - these aren't resolved on older OS versions, but don't break nothing
PS. Note that before Android introduced this API there was some freshly introduced devices with notch and you don't have any option for proper handling layout on them (too old for API, device manufacturer didn't provide any API either). But most (all?) of them got update to API27, so your issue may occur only on never-updated devices with "experimental" notch
I have an application that just designed for handsets. I want this application be visible to just handsets in Play market. Based on my research I found that it's impossible. So the solution that I found is adding <support-screen> into manifest.
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15"/>
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="false"
android:requiresSmallestWidthDp="320"
android:largestWidthLimitDp="360"/>
Based on what supports-screens says for largestWidthLimitDp:
This attribute allows you to force-enable screen compatibility mode by
specifying the maximum "smallest screen width" for which your
application is designed. If the smallest side of a device's available
screen is greater than your value here, the application runs in screen
compatibility mode with no way for the user to disable it.
Since size of GS3 is 720*1080px then I found 720px = 360dp.
However, the problem is Note from document:
Note: Currently, screen compatibility mode emulates only handset
screens with a 320dp width, so screen compatibility mode is not
applied if your value for android:largestWidthLimitDp is larger than
320.
Therefore it shows android:largestWidthLimitDp is useless at the moment.
I think I have two ways:
1- Filter out phablet/tablets from Play console which is not easy (it says your app is compatible with 3030 devices).
2- Displaying gentle apologies! - to say sorry we don't support your device at the moment - in run time. I think this is horrible and brings us 1 starts :(
What you think?
Any suggestion would be appreciated.
Thanks
When you list your apk in the play store (developer console, you don't have to publish it yet) you can select what devices your app is compatible with. It may be a pain, but you can run through that list and only select the phones you'd like. This is the best way for what you are trying to do.
Otherwise you'd have to resort to options that you listed above such as telling the user "Hey, we don't support your screen size". And no one wants to see that.
All along I've been testing on an Android 2 version ported to x86 (which runs within VirtualBox), due to problems with the emulators. My application and layout appears fine on this port.
I am now finishing my development, and am testing on my real phone, a Droid Bionic.
However, my overall application layout does not take up the full size of my screen, even when I have my dimensions set to the below. There is a black outer box that it seems to reside within and I can't enlarge this window.
If I change the dimensions of my overall layout from fill_parent to say 1000px, I can see the layout being truncated as it still sits within this unchanged window size.
Can anyone advise me how to resolve this?
Thanks
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#layout/overall_background"
android:orientation="vertical"
>
<GridView
android:id="#+id/gridView"
android:gravity="fill_horizontal"
android:stretchMode="columnWidth"
android:horizontalSpacing="0px"
android:background="#layout/grid_background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
Edit:
I am fairly sure this is because of the screen compatibility mode you are running in because your android:targetSdkVersion in your manifest is set incorrectly. This should be set to the highest SDK version that you have tested your app with and it works on.'
Please see this link and in specific read the first few paragraphs.
There are two versions of screen compatibility mode with slightly
different behaviors: Version 1 (Android 1.6 - 3.1)
The system draws the application's UI in a "postage stamp" window.
That is, the system draws the application's layout the same as it
would on a normal size handset (emulating a 320dp x 480dp screen),
with a black border that fills the remaining area of the screen.
To disable this version of screen compatibility mode, you simply need
to set android:minSdkVersion or android:targetSdkVersion to "4" or
higher, or set android:resizeable to "true".
Edit: Please see the documentation on how you should be setting the target SDK attribute
These lines in particular are of interest:
To maintain your application along with each Android release, you
should increase the value of this attribute to match the latest API
level, then thoroughly test your application on the corresponding
platform version.
Given that your ran into this issue tells me your target sdk is set to 3 or lower. So Android 1.5 or lower. This means that anyone running your app on a phone with something newer then Android 1.5 is going to be running in compatibility mode. This leads to decreased performance and incompatible default graphics. I.E. the graphics will not look like what everything else on the phone looks like because of the compatibility mode.
Currently something like 95% of all Android are running a newer version then 1.5.
What you need to do is up your tarket SDK to 4,5,6,7 ... etc one at a time and fully test the App until you get to the current SDK release of 15. When you release the target SDK should be 15 to ensure it runs well on all OS versions.
I have upgraded my Motorola Atrix to Gingerbread (2.3.4), so far with no issues. When I go for my old apps and games which I developed previously, those are not displayed fully in the screen, it is only giving a 320x480-pixel display. Do I need to change my code or my phone settings?
Given that you currently use android:minSdkVersion="1", try setting minSdkVersion="4" or setting anyDensity to true.
Both should have the same effect of allowing your app to scale beyond Android 1.0 screen sizes of 240x320; before SDK 4 (Android 1.6 ) the default was not to scale as there was only a single resolution.
Hi im having problems getting an app i have written for the motorola xoom to fill the screen. When i run the app it runs it in the middle of the screen as if it was on a phone or something. When creating the main.xml at the top it is showing the screen as a 10.1in WXGA screen and the system at the right hand side is set to Android 3.1
Any idea what im doing wrong?
Screen sizes beyond phone screens was added in Donut (API 4). Thus to say that you know about different screen sizes, you need to set at least API 4 as the target SDK version in your manifest:
<manifest ...>
<uses-sdk android:targetSdkVersion="4" />
</manifest>
This allows the system to use the modern defaults for the supported screens that you can specify with this:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
The use of android:targetSdkVersion is very important, since it allows the platform to disable a variety of compatibility behavior for your app to allow it to run better on more recent versions of the platform. Some of the things it impacts can be found here:
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
I had the same problem with porting to Galaxy Tab. Make sure you specify the correct API Level. I used an old one and had the same behaviour.
Try adding this to your AndroidManifest.xml: <uses-sdk android:minSdkVersion="4" />