Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unfolding Android 'O'

Unfolding Android 'O'

This presentation gives you a synopsis about the features in upcoming release of Android 'O'

Dhruva Shastri

April 04, 2017
Tweet

More Decks by Dhruva Shastri

Other Decks in Technology

Transcript

  1. What we are going to discuss.. 1. Font in xml

    2. Background Limits 3. Notification Channels 4. Autofill APIs 5. Picture in Picture Mode 6. Webview Enhancements 7. Adaptive Icons 8. Autosizing Textview 9. Pinning Shortcuts and Widgets 10. Wi-Fi Aware
  2. 1. Font in XML : Working with fonts • bundle

    fonts as resources by adding the font file in the res/font/ folder • compiled in your R file and automatically available in Android Studio • access the font resources with the help of a new resource type, font. For example, to access a font resource, use @font/myfont, or R.font.myfont.
  3. 2. Background Execution Limits • Apps and services running simultaneously

    result in a poor user experience To lower the chance of these problems, Android O places limitations on what apps can do while users aren't directly interacting with them. If an app targets Android O, it is restricted in two ways: 1. Background Service Limitations: 2. Broadcast Limitations: Note: These limitations apply only to apps that target Android O. Apps that target API level 25 or lower are not affected.
  4. 3. Notification Channels • When you target Android O, you

    must implement one or more notification channels to display notifications to your users. If you don’t target Android O, your apps behave the same as they do on Android 7.0 when running on Android O devices. • Android O deprecates the ability to set the priority levels of individual notifications. :( • What You can Do : ◦ Notification Priority and Importance ◦ Creating, Reading, Updating, Deleting a Notification Channel ◦ Creating a Notification Channel Group ◦ Creating a Notification
  5. 4. Autofill API • Aimed at making things easier for

    users, but also making it safer. • So copy/pasting that password won’t be susceptible to being hacked or available for others Benefits: ◦ Less time spent in filling fields ◦ Minimize user input errors • Users can enable or disable autofill as well as change the autofill service in Settings > Apps & Notifications > Default apps > Autofill app.
  6. 5. Adding Picture-in-picture • Allows activities to launch in picture-in-picture

    (PIP) mode • PIP is a special type of multi-window mode mostly used for video playback. • PIP mode is already available for Android TV; Android O makes the feature available on other Android devices. • To specify that your activity can use PIP mode, set android:supportsPictureInPicture to true in the manifest
  7. 6. Webview enhancement • The Android O Developer Preview provides

    several APIs to help you manage the WebView objects that display web content in your app. • APIs for managing WebView: ◦ Version API ◦ Google Safe Browsing API ◦ Termination Handle API ◦ Renderer Importance API
  8. 7. Adaptive icons • Displays a variety of shapes across

    different device models • For example, a launcher icon can display using a circular shape on one OEM device, and display a squircle on another device. • create alternative drawable resources in your app for use with Android O in res/mipmap-anydpi/ic_launcher.xml using <maskable-icon> attribute. <maskable-icon> <background android:drawable="@color/ic_background"/> <foreground android:drawable="@mipmap/ic_foreground"/> </maskable-icon>
  9. 8. Autosizing TextViews • Allows to instruct a TextView to

    let the size of the text expand or contract automatically to fill its layout based on the TextView's characteristics and boundaries. • Setting up TextView autosize: ◦ Granularity : By using granularity, you can specify a range of minimum and maximum text sizes and a dimension that specifies the size of each step ◦ Preset Sizes : By using preset sizes, you can autosize the TextView from a list of predefined sizes. Granularity : <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:autoSizeText="uniform" android:autoSizeMinTextSize="12sp" android:autoSizeMaxTextSize="100sp" android:autoSizeStepGranularity="2sp"/> Preset Sizes: <TextView android:layout_width="wrap_content android:layout_height="wrap_content" android:autoSizeText="uniform" android:autoSizePresetSizes=" @array/autosize_text_sizes" /> <resources> <array name="autosize_text_sizes"> <item>10sp</item> <item>12sp</item> <item>20sp</item> <item>40sp</item> <item>100sp</item> </array> </resources>
  10. 9. Pinning Shortcuts and Widgets • Allow your app to

    pin shortcuts and widgets onto the launcher • Pinned shortcuts, similar to app shortcuts, allow users to quickly start a specific task in your app • Unlike app shortcuts, however, pinned shortcuts appear in the launcher as separate icons. • Similar to pinned shortcuts, these pinned widgets give users access to specific tasks in your app.
  11. 10. Wifi Aware • Wi-Fi Aware, also known as Neighbor

    Awareness Networking or NAN • provides devices the appropriate hardware to discover and connect directly to each other via Wi-Fi Aware without any other type of connectivity between them, such as Wi-Fi Access Point or Cellular. • Using the Wi-Fi Aware APIs: ◦ Discover other devices ◦ Create a network connection
  12. Timeline Update for Android O The O Developer Preview runs

    from 21 March 2017 until the final Android O public release to AOSP and OEMs, planned for Q3 2017.