Home | History | Annotate | Download | only in patterns
      1 page.title=Pure Android
      2 @jd:body
      3 
      4 <p>Most developers want to distribute their apps on multiple platforms. As you plan your app for
      5 Android, keep in mind that different platforms play by different rules and conventions. Design
      6 decisions that make perfect sense on one platform will look and feel misplaced in the context of a
      7 different platform. While a "design once, ship anywhere" approach might save you time up-front, you
      8 run the very real risk of creating inconsistent apps that alienate users. Consider the following
      9 guidelines to avoid the most common traps and pitfalls.</p>
     10 
     11 <div class="vspace size-1">&nbsp;</div>
     12 
     13 <div class="layout-content-row">
     14   <div class="layout-content-col span-5">
     15 
     16 <h4>Don't mimic UI elements from other platforms</h4>
     17 <p>Platforms typically provide a carefully designed set of UI elements that are themed in a very
     18 distinctive fashion. For example, some platforms advocate rounded corners for their buttons, others
     19 use gradients in their title bars. In some cases, elements may have the same purpose, but are
     20 designed to work a bit differently.</p>
     21 <p>As you build your app for Android, don't carry over themed UI elements from other platforms and
     22 don't mimic their specific behaviors. Review the
     23 <a href="{@docRoot}design/building-blocks/index.html">Building Blocks</a>
     24 section in this styleguide to learn about Android's most important UI elements
     25 and the way they look in the system default themes. Also examine Android's platform apps to get a
     26 sense of how elements are applied in the context of an app. If you want to customize the theme of UI
     27 elements, customize carefully according to your specific branding - and not according to the
     28 conventions of a different platform.</p>
     29 
     30   </div>
     31   <div class="layout-content-col span-8">
     32 
     33     <img src="{@docRoot}design/media/migrating_ui_elements.png">
     34     <div class="figure-caption">
     35       Sampling of UI elements from Android, iOS and Windows Phone 7.
     36     </div>
     37 
     38   </div>
     39 </div>
     40 
     41 <div class="vspace size-2">&nbsp;</div>
     42 
     43 <div class="layout-content-row">
     44   <div class="layout-content-col span-5">
     45 
     46 <h4>Don't carry over platform-specific icons</h4>
     47 <p>Platforms typically provide sets of icons for common functionality, such as sharing, creating a new
     48 document or deleting.</p>
     49 <p>As you are migrating your app to Android, please swap out platform-specific icons with their Android
     50 counterparts.</p>
     51 <p>You can find a wide variety of icons for use in your app on the
     52 <a href="{@docRoot}design/downloads/index.html">Downloads</a> page.</p>
     53 
     54   </div>
     55   <div class="layout-content-col span-8">
     56 
     57     <img src="{@docRoot}design/media/migrating_icons.png">
     58     <div class="figure-caption">
     59       Sampling of icons from Android, iOS and Windows Phone 7.
     60     </div>
     61 
     62   </div>
     63 </div>
     64 
     65 <div class="vspace size-2">&nbsp;</div>
     66 
     67 <div class="layout-content-row">
     68   <div class="layout-content-col span-5">
     69 
     70 <h4>Don't use bottom tab bars</h4>
     71 <p>Other platforms use the bottom tab bar to switch between the app's views. Per platform convention,
     72 Android's tabs for view control are shown in action bars at the top of the screen instead. In
     73 addition, Android apps may use a bottom bar to display actions on a split action bar.</p>
     74 <p>You should follow this guideline to create a consistent experience with other apps on the Android
     75 platform and to avoid confusion between actions and view switching on Android.</p>
     76 <p>For more information on how to properly use action bars for view control, see
     77 <a href="{@docRoot}design/patterns/actionbar.html">Action Bars</a>.</p>
     78 
     79   </div>
     80   <div class="layout-content-col span-8">
     81 
     82     <img src="{@docRoot}design/media/migrating_ios_dialers.png">
     83     <div class="figure-caption">
     84       Android dialer with tabs in an action bar vs. bottom tabs in iOS.
     85     </div>
     86 
     87   </div>
     88 </div>
     89 
     90 <div class="layout-content-row">
     91   <div class="layout-content-col span-5">
     92 
     93 <h4>Don't hardcode links to other apps</h4>
     94 <p>In some cases you might want your app to take advantage of another app's feature set. For
     95 example, you may want to share the content that your app created via a social network or messaging
     96 app, or view the content of a weblink in a browser. Don't use hard-coded, explicit links to
     97 particular apps to achieve this. Instead, use Android's intent API to launch an activity chooser
     98 which lists all applications that are set up to handle the particular request. This lets the user
     99 complete the task with their preferred app. For sharing in particular, consider using the <em>Share
    100 Action Provider</em> in your action bar to provide faster access to the user's most recently used
    101 sharing target.</p>
    102 
    103   </div>
    104   <div class="layout-content-col span-8">
    105 
    106     <img src="{@docRoot}design/media/migrating_intents.png">
    107     <div class="figure-caption">
    108       Link to other apps with the activity chooser or use the <em>Share Action Provider</em> in the
    109       action bar.
    110     </div>
    111 
    112   </div>
    113 </div>
    114 
    115 <div class="vspace size-2">&nbsp;</div>
    116 
    117 <div class="layout-content-row">
    118   <div class="layout-content-col span-5">
    119 
    120 <h4>Don't use labeled back buttons on action bars</h4>
    121 <p>Other platforms use an explicit back button with label to allow the user to navigate up the
    122 application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical
    123 navigation and the navigation bar's back button for temporal navigation. For more information,
    124 please review the <a href="{@docRoot}design/patterns/navigation.html">Navigation</a> pattern.</p>
    125 <p>Follow this guideline to provide a consistent navigation experience across the platform.</p>
    126 
    127   </div>
    128   <div class="layout-content-col span-8">
    129 
    130     <img src="{@docRoot}design/media/migrating_ios_galleries.png">
    131     <div class="figure-caption">
    132       Android action bar with up caret vs. iOS labeled "Back" button.
    133     </div>
    134 
    135   </div>
    136 </div>
    137 
    138 <div class="layout-content-row">
    139   <div class="layout-content-col span-5">
    140 
    141 <h4>Don't use right-pointing carets on line items</h4>
    142 <p>A common pattern on other platforms is the display of right-pointing carets on line items that allow
    143 the user to drill deeper into additional content.</p>
    144 <p>Android does not use such indicators on drill-down line items. Avoid them to stay consistent with
    145 the platform and in order to not have the user guess as to what the meaning of those carets may be.</p>
    146 
    147   </div>
    148   <div class="layout-content-col span-8">
    149 
    150     <img src="{@docRoot}design/media/migrating_ios_settings.png">
    151     <div class="figure-caption">
    152       Android settings without right-pointing carets in line items vs. iOS settings.
    153     </div>
    154 
    155   </div>
    156 </div>
    157 
    158 <h2 id="device-independence">Device Independence</h2>
    159 
    160 <p>Remember that your app will run on a wide variety of different screen sizes. Create visual assets
    161 for different screen sizes and densities and make use of concepts such as multi-pane layouts to
    162 appropriately scale your UI on different device form factors.</p>
    163 <p>For more information, read <a href="{@docRoot}design/style/devices-displays.html">Devices and Displays</a> as
    164 well as <a href="{@docRoot}design/patterns/multi-pane-layouts.html">Multi-pane Layouts</a> in this design guide.</p>
    165