Screen optimization in android - android

I want to do screen optimization. That means once I develop the UI in android it should fit exactly the same in all android enabled phones.
So how do i do it?

It sounds like you want your UI to look exactly the same on all Android devices. As Daniel says, this is impossible, as Android devices differ hugely, due to different screen sizes, ratios and resolutions.
Fortunately, the Android UI system was designed precisely with different screens in mind. Given your UI design, it'll try it's best to make it work on the user's device, no matter what size or orientation it is. Buttons and labels and windows and images will adjust to fill the available space as specified by the UI designer.
Unless you have a specific technical reason to limit yourself to a rigid UI of specific dimensions, I'd advise you get to grips with Android's UI and components!

Related

Non-native resolution forced in the Android game. How to get native?

In order to give best experience to player, I want provide possibility to choose game resolution from low (best performance) to native (best quality). Sadly, some android devices forces game to run in decreased non-native resolution, and I found no way how to detect native resolution. For example - Samsung Galaxy Tab A 10'' (2016) - have native resolution 1920x1200, but game runs in 1440x900. Fonts and interface looks blurry and poor. It's strange, but our analytic show what about 40% this devices runs the game with native resolution. But not in my case.
So, I need solution.
First option - is to get (in some way) native resolution of the device. Screen.width/height, Screen.currentResolution - not helps. Screen.resolutions - alway empty. android.util.DisplayMetrics - also reports only decreased resolution.
Second option - restrict system (or Unity) to run the game in native resolution only. I checked Unity settings and manifest - found nothing..
Please help. Thanks
What you need is adaptive UI.
If you are using NGUI, see this thread. There are many examples on how to do that. The key component is UIAnchor.
You can either make your UI modular using UIAnchor components, set the UIRoot to be manually sized (and lose pixel perfection), or you can create different layouts. One layout for the iPhone, and another for iPad, for example.
If you are using Unity3D UI, see Designing UI for Multiple Resolutions.

Design android layouts suitable for large text users

I'm a visually impaired developer, and I'm trying to figure out how to design good layouts for users that have the largest text enabled on their android devices. I made a good app layout and it looked fine in the designer and the emulator and it looked fine, the tested it on my device with large text on, and everything was incredibly wonky: Text was wrapping onto multiple lines and noting scaled properly. I turn off large text and everything is perfectly fine.
How do I do this? Other apps with large text are fine. What measurement should I be using and what text style/Size is the standard?
If you are looking for standard design principles supported by a strong Case to case study the Material Design Documentation is the right place to look at.
This documentation itself is created by the great minds from Google. All the thing being presented here is the do and don't.
What measurement should I be using and what text style/Size is the standard?
In general, You need to test the different system font size on different screens to make it looks good, get the font size and test it(Read font size from Settings). In my practice, use wrap_content instead of fixed height in ViewGroups(LinearLayout), and there is no standard style/Size, only the product UI design matters. In some apps like WeChat it defined custom app fontSize which will NOT be affected by the system settings, and DO the multi-devices adapt with it's own font system.

Creating a 'universal' app in Android Studio for smartphones and tablets?

I've been using Xcode for a few months now to create basic iOS applications. Within the startup settings, it allows you to select 'iPhone', 'iPad' or 'Universal'.
I usually setup my applications so that they are locked portrait on iPhone and locked landscape on iPad.
Firstly, how can I setup my project so that it is available to both smartphones and tablets when pushed to the Google Play Store?
Secondly, is there a way to set the orientation to portrait for smartphones and landscape for tablets?
I think what you want is that the app should adopt its view according to whether the device is a phone or tablet. If so, Android provides a very good design called Master-Detail Flow. In a master/detail navigation flow, a master screen contains a list of items in a collection, and a detail screen shows detailed information about a specific item within that collection. And the beauty of it is that, in a phone it only shows the master view as a list and in a tablet it shows both master and detail in two panes.
Take a look at this and this
Also for other adaptive UI see this
The concept of Android O.S is entirely different from iOS. Primarily, think of all the Android devices that exists! Lot of manufacturers, in different screen sizes and with varied configurations. However, an Apple iPhone is designed and manufactured by Apple, and it comes like a brick in different sizes. So it offers more of a robustness to the developer.
But in Android, due to it's versatility, there comes a need to design apps that runs equally same in all devices even with different screen resolutions. As a result, Android uses a technique called DIP Display independent pixels to address while designing. [This] is the perfect place to get a structured knowledge on Android UI designing and scaling to different screen sizes.
Now coming to your second question, Android offers superior flexibility to the developers. And you can easily adjust the orientation programmatically:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); //<-- Landscape mode
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //<-- Portrait mode
Hope this clearly answers your query!

A Mobile Phone App API without these limitations

I have been developing Mobile phone apps in Mosync(Cross Platform C++ API - can make apps in iOS, Android, Symbian & Blackberry) & I am looking to develop apps in something else because of the limitations of Mosync.
But I dont want to move to a different API to find they have the same or worse limitations. I am thinking of moving to native API's (iOS or Android) but am open to other cross platform API's aswell.
If I was to move to Android OR iOS OR insert API here would I experience these limitations:
Resizing images is expensive(in terms of RAM & speed). IE, so can Android, iOS handle resizing 10+ images(for eg .png) & display them on screen in a relatively fast amt of time? In Mosync doing such stuff depends on the phone RAM but on HTC Desire(512mb) it takes about 6 seconds which is unacceptable for my app.
Does the API come with its own fonts & layout managers? Mosync doesn't have its own fonts, you have to create & import it & you cant change the colour of a font. You also cannot make the text in a widget display centred or word wrapped, can Android/iOS/other do this?
Can you create your own skins(.png) for buttons(any widget) & set a default API button's skin? This is actually a strength of Mosync where you can change button skins BUT it divides the skin up into 9 sections & only the 5th section is scalable, the others stay the same size, so on small phones a lrg skin looks weird.
Is it a REAL headache designing your app layout because of all the different potential phone sizes there are, so the widgets placement & skins will be incorrect on small screens & images will be out of proportion on large screens? Does the Android/iOS/other API help you by automatically laying out your GUI no matter the phone size & does it automatically scale image widgets & fonts to suit phone sizes?
Any info would be really helpful to a Junior programmer(intern) who is developing mobile apps all on his own & finding the myriad of phone sizes so ANNOYING to compensate for
My experience with Android Code:
Image resizing - Many current android apps seem to meet your
performance requirements although you don't mention the size of the
images which is the key issue.
Android supports many fonts internally, allows full control of font size, type face, colour etc
Android supports a complex variety of 'Drawables' including standard simple
graphics, 9-patch pngs (similar to what you describe) and simple vector descriptions of shapes and colours.
Android was designed with the difficulties of multiple screen sizes in mind; It supports multiple layouts for different screens sizes and orientations. This problem is intrinsically difficult and imho Android takes a lot of the trouble out the process - but it is always going to be a little bit of headache.
I am just reaching production on my first serious android app and have found the development experience pleasant and the learning curve easy.

Best way to test Android layout before submitting to market

reading about all these different resolutions and hardwares for Android I am a little unsure if the layout I created for an Samsung Galaxy will actually work the same way on all (most) Android devices.
I did not use anything fancy or complicated. However I had to use fixed width in several places to align text and buttons nicely. ALso there is some text with linebreaks that could look differntly if on narrower screens
How can I be sure that my layout will work on other devices? Or is this actually a no issue? Testing in the debugger is sooooo slow, that I actually never got it to work properly.
Thanks very much!
You can set up multiple emulators with different screen sizes, that simulate the possible targets.
In the emulator Ctrl-F11/12 (thanks #ccheneson) allows you to change the orientation, so that you can test that as well.
The emulator may be slow, but to see how the layouts look like it should be fast enough - you may still test the logic on a real device.
Also emulator speed seems to be highly dependent on the screen size.

Categories

Resources