How can I fix low resolution of my custom soft Keyboard View? - android

I am developing a custom softkeyboard using softkeyboard sample of android SDK for 10 inches tablet PCs.
First question: I noticed that the resolution of my keyboard is very low on tablet that is obvious in the following images. Actually in my keyboard area, the resolution is same as Pocket PCs resolution.
How can I change its resolution to normal resolution of tablet PCs (10in)?
In my softkeyboard getMaxWidth(); returns 545 that is very low for tablet.
Second question: how can I change the font size of key labels?
Thanks a lot,
My keyboard View:
My desired View:

I found the answer of my first question:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
</manifest>
My reference is this link.

Related

My Android Studio keeps ignoring Large Layout and picks Normal for ALL screens

I'm using the Layout Variants tool to create differents sizes for my layout.
the problem is that when i pick any large Device to preview my layout..
it keeps using the normal size
how can i force it to pick the right layout for the screen ?
by the way i already did the AndroidManifest support screens
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
but still having problems!
also my app icon looks so small too in my phone!
any idea?

Android single screen layout for all devices

I created an Android app and tested it on Nexus6 Emulator. Everything seems fine on Nexus6 Emulator but when I ran that app on real devices (Samsung S6 and S5) the layout was all messed up. How can I fix this?
Do I have to create separate layout for each device?
Does Android have something like 1 layout for all screens?
I dragged and dropped all images in drawable folder instead of using "add image asset". There is nothing in hdpi, mdpi folder. All images are in drawable folder. Is this the cause of my issues?
Please advise.
It is all about the design of your xml. When designing your pages, try to use 'match parent' and ensure that you are making a layout that fits across all screen resolution. Look into AFAIK...
https://developer.android.com/training/multiscreen/screensizes.html
https://developer.android.com/training/multiscreen/screendensities.html
https://developer.android.com/guide/practices/screens_support.html
How to define dimens.xml for every different screen size in android?
For example:
In your xml
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />

Different view of XML Layout in different devices

I have an app currently in the Store "CalculateMe". Tab seems to be working fine with the equal gap separated with each other rather than lying in the home screen on my Galaxy S3 but when I tried on Galaxy S1. It looks all messed up. I am currently making another app, again the layout seems fine on S3 but in S1 the buttons are lying on each other. I wonder why that is and how they can be stabled?
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
Add this to your manifest file of app and try to run on different devices.

Android application for Tablet

I have developed an application that is to be run on android Tablet as well. It is working on android phones perfectly. When I ran it on Tablet, it did not expand on whole screen. It just covered a area equal to a mobile device. I want that it also runs on Tablet and cover the whole screen as running on mobile device. Do I have to create two different designs for each type and at run time before using design, I would have to check it whether it is android phone or table?
Add below code in android manifest
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
Add the following block of code in your manifest file after the <uses-sdk>tag:
<supports-screens
android:xlargeScreens="true"
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
Note: Add the android:xlargeScreens="true" attribute if and only if your minSdkVersion is equal to or more than 9.
In addition to adding this block of code, follow this link. Also suggest you to go through the following links:
Supporting Multiple Screens
Supporting Different Screen Sizes
Supporting Different Densities
Hope this helps.
please try
<uses-sdk android:minSdkVersion="8" android:maxSdkVersion="11"/>
<supports-screens android:anyDensity="true" />
in Manifest.xml before tag.
I hope it may be help you.
Yes, ideally you'll design layouts targeted to tablets. You don't have to, but you can. See here for details. Your app is running in "screen compatibility mode". See here for info about that.
I think you used fixed width and height for any view or layout in your app, to support a fixed resolution of your mobile device.
If you use fill_parent, wrap_content and weight property, such things in your app, the app will fill entire screen of any android device. Once review your code.
Small example
Assume device has no rotation. Your device has resolution 320 X 240. you have to fill 3 buttons horizontally, you can put each button width=100 and remaining as margin/padding of layout. If you run same app on device with resolution 640 X 480, some space will come after 3 buttons. If you use width=fill_parent and layout_weight=1 for these 3 buttons and parent's layout_width=fill_parent, on any resolution these 3 buttons will fill the entire width of screen.
I hope it may help you.

Android Application not fit to screen correctly

I have found a problem in Android Emulator,
when i run application on Emulator on android 2.3.3 WQVGA400 it runs fine,
but screen width size is so small
so i check the Built in Resolution to make width size to 800" something and height t0 600"
Now my problem is when i run application on this, then it shows only in a short portion of Emulator screen, extra space on below is always remain
And one thing is that when I run on Actual device is runs very perfectly
You should probably read this: http://developer.android.com/guide/practices/screens_support.html
Add to your AndroidManifest.xml
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
How do you add the text in the green buttons? Is this button a nine patch image? Is the text separate from the image?
Use nine patch images. Then add the text using Button control, where you put the image as background and the text as caption/title/text so on. And when you run the application on larger screen, the image + text will be resized correctly.
Add next line to your AndroidManifest.xml:
<supports-screens android:resizeable="true" />
More information about this attribute can be found in documentation.

Categories

Resources