I am familiar with android 2.2 and I have been developing for phones, now where to start from when developing for ICS tablets. The major thing I learned from quick-google that now I will have to use fragments for multi-pane layouts rather than mere Activity. What else do I need to look for before starting?
Some links would be helpful (for fragments too).
Here is how you can set up your Emulator to act as a tablet.
Here is a great guide on supporting tablets and handsets.
And lastly a very useful guide for fragments
You should learn about making UI's look good for different screen sizes, look into size specific drawables and resources, also making use of the screen. Look under training in developing on d.android.com
Related
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'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!
I'm looking forward to implement a process to develop and integrate user interfaces for mobile developments in for a mobile development team. Currently we are facing problems such as communicating user interface requirements such as screen sizes, etc... by the developers to the UI designers and when developers receive the designs from the UI designers there are alignments issues, low image qualities, font sizes are different and so on. How do the designers test whether their designs are appropriate for the respective screen sizes.
First, I would strongly recommend reading Designing for Multiple Screens documentation carefully as it describes very important aspects when designing your app for multiple screens
Second, Android Development Tools recently added very useful feature to preview your app on multiple screens at the same time. See the attached image, where I am highlighting the button where you can select Preview All Screens
Is there a way to make sure an application runs in a small screen on a tablet? I need to give a demo of my app with a beamer. I'm going to use my tablet with micro-hdmi... But the app is shown on fullscreen. And it's ugly. It is designed for smartphones only... Someone knows how to do this?
try to run in the app in Compatibility Mode
http://developer.android.com/guide/practices/screen-compat-mode.html
and try to fallow UI guideline to Supporting Multiple Screens to look it fine
http://developer.android.com/guide/practices/screens_support.html
Timon, I believe that, in general, there is no quick and easy way to do this, but it is possible. What you could do - and I am not sure if your demo warrants all this effort - is to root your tablet device and then finding and installing a custom ROM that allows a custom DPI value to be set on a per app basis.
Of course, the above assumes that this app is written by someone else and you do not have the source code. If, however, it is your own app, then I would follow Dheeresh Singh's recommendation.
Hope this helps. Good luck!
I have to program my Android app with the best compatibility to different screen sizes (tablets and smartphones) and to the versions 2.3, 3.2 and 4.0.
I know about the possibliy to name the folders of the layout like res/layout-sw600dp/. to match the layout exactly to different screen sizes.
So, cause I will use completely different layouts for Tablets / Smartphones, I would start with a "Load Screen", which tests which Android-version is used and if there is used a tablet-or smartphone-device, cause for example in the layout for the Tablet, there will be Buttons on some screens that won't be there on the smartphone.
So I will have to separate all this in packages, like this:
Common
2.3
Tablet
Smartphone
3.2
Tablet
Smartphone
4.0
Tablet
Smartphone
I would choose this separation, cause it's the best way, in my opinion, to be prepared for upcoming *updates*, if, let's say there should be added a Button in the ToolBar in Android 4.0.
Is this separation a good thing in your opinion or is this a complete overload?
Are there any other new features in 4.0 that I should be aware of?
You can also name your resource folders to indicate version number (like /res/layout-v11) or (/res/values-v13)
Regarding your question about separation - it really depends on your particular requirement. A common approach to this problem is a fall-back mechanism: You provide a few specific layouts (for example, an xlarge landscape v11 layout), and a few generic ones to fall back to.
Of course, this is an "idealistic" solution; and it doesn't always work that way. In other words, it is mighty difficult to practically implement an app that is compatible with so many versions of Android solely by providing alternative resources. Even if you use the compatibility libraries (which helps a bit in reducing version-specific code); you will still have to adapt your code based on the version at run-time.
You can find out the Android version looking at Build.VERSION.
The documentation recommends you check Build.VERSION.SDK_INT against the values in Build.VERSION_CODES.
And based on that version you can set your layouts in if else conditions