I have a question about Android Studio.
If I develop an app that I then upload to the Google Play Store, can I be sure that my Android Studio project runs well and looks good on all devices with an Android operating system?
So that the layout that I developed works well on all screen sizes? Will Android Studio do this for me on its own?
Or do you have to develop your XML layout for each individual smartphone with different screen sizes?
I would be very happy to hear from you.
best regards
However, applications created in android studio will be able to fit all api's that you define in your gradle, it is recommended to test in the emulator from the initial api defined in the gradle, but in general it works well on several devices. The test is ideal to check if there will be no crash in some API's but the layout is usually positioned according to the screen of each device.
Good luck on your project.
So that the layout that I developed works well on all screen sizes
For this, it depends on how you did your layout. Android has constraint layout which is the best to use
ConstraintLayout is a layout on Android that gives you adaptable and flexible ways to create views for your apps. ConstraintLayout , which is now the default layout in Android Studio, gives you many ways to place objects. You can constrain them to their container, to each other or to guidelines.
Or do you have to develop your XML layout for each individual smartphone with different screen sizes
For this, it will only base on your use case or if you have different UI design for phone and tablet devices, for example, you want your app to show a two-pane layout on a larger screen (or a tablet), then you have to create a new xml for this. So you'll have mylayout.xml placed in layout folder (for phone device screen sizes) and mylaout.xml placed on layout-600sd600dp (for tablet device screen sizes).
But if you only have on design for both phone and tablet devices, then you only need one xml layout.
Related
My android app looks different on the phone than android studio
look at screenshot
app in the phone screenshot
App in the Android studio screenshot
why is that? and how can I fix that?
Your preview shows what your layout would look like on a Pixel 3, which is quite a large phone. From what I saw on your screenshot looks like your device isn't quite as large so I'd recommend you to use ConstraintLayout for 2 reasons:
Consistency across different screen sizes - it's much more likely your layout will look the same on a large screen and a small one
Better performance, especially for your case since you'll be able to do everything with a single layout, without having to nest several layouts
For more information on ConstraintLayout, please check out this post I wrote on Medium
The screens in my app needs to be displayed in the same way on both type of devices, phones and tablets. Currently my app works fine on phones, but they behave weird when run on tablets. The problem occurs with the positioning and size of components in the screen.I have 9 patch images generated for all the images being used but still for some components that I use absolute size/margin values such as 30dp,50dp etc do not seem to be good measures that work well on a tablet. Some of my thoughts/questions are:
PercentRelativeLayout - is it the best solution to overcome this
problem?
Is there a way that layouts can be defined so as to draw
differently on phones and tablets. Please note that that I do not
have any complex menus or behaviour that needs to work differently
on different devices, they are same.
Do I have to develop 2 different apps?
you have to make different layouts for both android phone and tablet.
Look at this link
Read more on the Android developer documentation after reading answers above. Found this resource to be more explicit for someone who is totally unaware of supporting multiple screens. http://www.survivingwithandroid.com/2012/07/how-to-support-multiple-screen-in.html
I am newbie to convert android apps to bb10. I converted one app to bb10 compatibility. The app is compatible with both device and tablet in android.I successfully run it in bb10 simulator. But the app doesn't show the UI part completely. Why? I have one more doubt generally BB10 devices shape is rectangle but simulator shape is square. why?
BlackBerry Image
Android Image
That is because your UI needs more space than the resolution provides. If you would place your controls within a scrollable container, you would be able to scroll down to the missing parts of your UI.
If you choose that container to automatically show the scrollbar, this would only be seen on Q10 but not on Z10. Try to switch your simulator to Z10 resolution, then it will propably show all your UI elements.
The real solution would be really to define the UI in relation to the resolution.
To start with this, here is an excellent definition on how to cluster your layout resources for your Android app. Your problem will disappear, when defining an appropriate layout for the minimum height(!) of e.g. 600dp and one for 800dp. The one with 600dp will be used for the Q10 (because it has 720px physical height) and the other one for the Z10 (that has 1280px).
By the way: you should encounter the same problem on some Android device, since there are a few with nearly square display (I remember a "BlackBerry clone" by HTC?). But of cause, these devices are really rare...
I know this is not a technical related question.But i do not have any idea.I am going to develop a project which should be supported in both phone and tablet.Is it possible having one project working for both tablet and phone ?
Yes. The only thing you need to keep in mind where you keep your graphics. Because it will cause different problems if you do not treat and handle them depending on the screen size. Only thing matters is the android version. If you deploy your app in any phone or a tablet where the version is newer or equal to the target version it works. But of course you cant take a call or some other mobile functionality from a tablet if its not supporting that features.
You can use drawable-hdpi,drawable-mdpi and drawable-ldpi for the graphics(images which use in project) and also use layout with multiple screen by custom layout like layout-480x320 , layout-600x1024 etc. in layout you can custom screen xml file.
Is there a truefire way to make sure my app will display the same on my Motorola Droid 2 as it will on other Androids?
I use nothing more than basic Linear Layouts, Image Views, Buttons etc - is there a good checklist to go by before I even think about launching an app?
Clipping issues, What SDK I should launch my app in, etc...?
Make sure you are following the guidelines for supporting multiple screen sizes.
You can use the emulator to experiment with the different possible screen sizes and densities, as described in that document under how to test your app.
You can make emulator of different screen sizes to check your application.
One thing make sure you don't use "px"(pixels) anywhere in your application, use dp instead of px.