I am still working on my android application and I am facing once again an issue.
I have defined a small screen ressource and I noticed that the ADT automatically resize the Layout to support the small screen resolution, but while I am doing a test in the emulator, I don't have the result I expected, as shown in the following screen shot:
You can notice that the text displayed under some bouton are not totaly visible.
Here is the result when I test the application in the emulator whith a normal screen size :
I really need your advise to resolve this issue. Thank you !
Regards.
Related
I have been facing this issue while creating any android program/app using android studio. Whatever I design in android studio, it is not displaying properly as designed in android studio while running the app on my phone.
In short, sometimes size and the places of the controls get changed while running the app on my android phone. Please help. Thank you.
That's probably because of the difference in screen sizes of your preview and your physical phone . I've recently started using constraint layout and I think it's the best so far, a bit confusing at first but easy to understand it, it even has an option for percentage of width/height of the total screen for a view. Try that out.
In the Android Studio design preview, my layout fits perfectly on screen.
Even when I played it though AVD, it fits well.
But when I connect my phone with Android studio and run it, it doesn't fit in my phone screen. It seems like centerCrop is on the whole screen. all layouts have the same problem.
I'm using a Samsung s8+. Preview setting is also Samsung s8+ which Android Studio provides.
At first, I thought that this problem is caused by 18.5:9 ratio of my phone. But in that case, the screen should be cut only at bottom and top. But it seems like centerCrop is enlarging based on the center?
The screenshot on the left is what I see on the preview and on the right is what I see on my physical phone:
Two Solutions:
Go for Linear layout if you don't bother layout hierarchy and coding style, as it fits for the most number of screens.
The design which you saw in the emulator will not be same in Actual mobile device in all cases. So try to debug your app in actual mobile device and design accordingly.
Make sure that your custom emulator has the same settings ( Height, Width, RAM ) as your phone.
I am trying to develop an app, which support all mobile and tablet devices of every screen size and density, but every time i got some changes in UI for different screen sizes for example in image below i put three text on screen but it always change its location in different screen devices.
I tried smallest width screen(600,720,320,480) and screen size(S,N,L,X) but both are not working properly,
is there anyone who can help me with specific data. please dont refer developer android site because i looked so many website but they only describe android screen specification, they dont give any proper solution. please give me any proper solution or project sample will be better.
thanks in advance.
http://i.stack.imgur.com/R1uKU.png
I have been working on a app for sometime now. I have only been working and looking on my emulator and never put it on a android phone to see results along the way. But now I have, and i'v seen what it looks like. Some buttons are high and low here there,my text is all out of sink.So what I would like to know is how can I make my app fit to the size of the screen on most android phones.Because on the emulator it looks fine.
android:minSdkVersion="5"
android:targetSdkVersion="10"
Android Version 2.3.6
kernel version 2.6.35.7-1187001
Thank you.
How are you mentioning button sizes?
You will have to use dp and sp size rather than mentioning actual button sizes.
I am new to mobile development with Titanium Studio. I am developing an app for android. When I tried running it in WXGA720 screen emulator, which was looking good. But when I tried the same with WXGA800-7in screen emulator, it looks terrible. Below is the screenshot for your reference.
Screenshot from WXGA720:
Screenshot from WXGA800-7in:
Please suggest. Thanks in advance.
In Titanium when developing for Android, it uses same image for TabGroups. Bigger the image specified, bigger it will show up in the app. My solution was using different images for different devices.
Android let you do that automatically by different device profiles.
If you look at Resources/android/images, there are several directories like:
res-long-land-hdpi
res-long-land-ldpi
res-long-port-hdpi
res-long-port-ldpi
res-notlong-land-hdpi
...
Please check here for a complete description.
I found a way to rectify this issue, as i would like to have my application only for Galaxy S3 and Nexus 7.
I wrote code to detect the screen size of Nexus 7 (height=1216 && width=800)
and dynamically set the tab icon, i used smaller size tab icons for Nexus.