background preloader

Android Design

Facebook Twitter

Distributing to Specific Screens. Although we recommend that you design your application to function properly on multiple configurations of screen size and density, you can instead choose to limit the distribution of your application to certain types of screens, such as only tablets and other large devices or only handsets and similar-sized devices. To do so, you can enable filtering by external services such as Google Play by adding elements to your manifest file that specify the screen configurations your application supports. However, before you decide to restrict your application to certain screen configurations, you should understand the techniques for supporting multiple screens and implement them to the best of your ability. By supporting multiple screens, your application can be made available to the greatest number of users with different devices, using a single APK.

Declaring an App is Only for Handsets The <compatible-screens> element must contain one or more <screen> elements. Providing Resources. You should always externalize application resources such as images and strings from your code, so that you can maintain them independently. You should also provide alternative resources for specific device configurations, by grouping them in specially-named resource directories. At runtime, Android uses the appropriate resource based on the current configuration. For example, you might want to provide a different UI layout depending on the screen size or different strings depending on the language setting. Once you externalize your application resources, you can access them using resource IDs that are generated in your project's R class.

How to use resources in your application is discussed in Accessing Resources. Grouping Resource Types You should place each type of resource in a specific subdirectory of your project's res/ directory. MyProject/ src/ MyActivity.java res/ drawable/ icon.png layout/ main.xml info.xml values/ strings.xml Table 1. Providing Alternative Resources Figure 1. <? Supporting Different Densities. This lesson shows you how to support different screen densities by providing different resources and using resolution-independent units of measurements. Use Density-independent Pixels One common pitfall you must avoid when designing your layouts is using absolute pixels to define distances or sizes. Defining layout dimensions with pixels is a problem because different screens have different pixel densities, so the same number of pixels may correspond to different physical sizes on different devices.

Therefore, when specifying dimensions, always use either dp or sp units. A dp is a density-independent pixel that corresponds to the physical size of a pixel at 160 dpi. An sp is the same base unit, but is scaled by the user's preferred text size (it’s a scale-independent pixel), so you should use this measurement unit when defining text size (but never for layout sizes). For example, when you specify spacing between two views, use dp rather than px: When specifying text size, always use sp: 80 Beautiful Typefaces For Professional Design. Every now and again designers stumble upon the very same problem: the choice of a unique and beautiful typeface which manages to fulfill three basic tasks. Support the corporate identity, enrich the visual appearance and is compatible with the overall design. However, usually there are simply too many options you can consider, which is why you need time to find the option you are most comfortable with.

Although the choice usually depends on clients’ requirements, it is necessary to have some pretty starting points for your font decision. Every now and again designers stumble upon the very same problem: the choice of a unique and beautiful typefaces which manages to fulfill three basic tasks. Support the corporate identity, enrich the visual appearance and is compatible with the overall design.

However, usually there are simply too many options you can consider, which is why you need time to find the option you are most comfortable with. So which typefaces are “bulletproof”? 1. 2. 3. 4. Designing For Android. Supporting Different Screens. Android categorizes device screens using two general properties: size and density. You should expect that your app will be installed on devices with screens that range in both size and density.

As such, you should include some alternative resources that optimize your app’s appearance for different screen sizes and densities. There are four generalized sizes: small, normal, large, xlarge And four generalized densities: low (ldpi), medium (mdpi), high (hdpi), extra high (xhdpi) To declare different layouts and bitmaps you'd like to use for different screens, you must place these alternative resources in separate directories, similar to how you do for different language strings. Also be aware that the screens orientation (landscape or portrait) is considered a variation of screen size, so many apps should revise the layout to optimize the user experience in each orientation. Create Different Layouts Note: Android automatically scales your layout in order to properly fit the screen.

Iconography. An icon is a graphic that takes up a small portion of screen real estate and provides a quick, intuitive representation of an action, a status, or an app. When you design icons for your app, it's important to keep in mind that your app may be installed on a variety of devices that offer a range of pixel densities, as mentioned in Devices and Displays. But you can make your icons look great on all devices by providing each icon in multiple sizes. When your app runs, Android checks the characteristics of the device screen and loads the appropriate density-specific assets for your app. Because you will deliver each icon in multiple sizes to support different densities, the design guidelines below refer to the icon dimensions in dp units, which are based on the pixel dimensions of a medium-density (MDPI) screen. Launcher The launcher icon is the visual representation of your app on the Home or All Apps screen.

Sizes & scale Launcher icons on a mobile device must be 48x48 dp. Proportions Style. Dashboards. Google Play Install Stats The Google Play Developer Console also provides detailed statistics about your users' devices. Those stats may help you prioritize the device profiles for which you optimize your app. This page provides information about the relative number of devices that share a certain characteristic, such as Android version or screen size.

This information may help you prioritize efforts for supporting different devices by revealing which devices are active in the Android and Google Play ecosystem. This data reflects devices running the latest Google Play Store app, which is compatible with Android 2.2 and higher. Each snapshot of data represents all the devices that visited the Google Play Store in the prior 7 days. Platform Versions This section provides data about the relative number of devices running a given version of the Android platform. For information about how to target your application to devices based on platform version, read Supporting Different Platform Versions.