Open Wonder introduces Android Oreo 8.0. Smarter, faster, more powerful and sweeter than ever. The world’s favourite cookie is your new favourite Android Release.
- Picture In Picture (PIP)
- Notification Dots
- Notification Channels
- Auto Fill Framework
- Multi Display Supports
- Auto Sizing Text View
- Fonts in XML
- Downloadable Fonts
- Adaptive Icons
- Behaviour Changes
- Media Features
- Wide Gamut Color
- Web View Features
- Java 8 Language API’s
Picture In Picture (PIP):
- PIP is a special type of multi-window mode mostly used for video playback.
- PIP mode is already available for Android TV; Android 8.0 makes the feature available on other Android devices.
- When an Activity is in PIP mode, it is in the pause state, but should continue showing content.
- To Specify that your activity can use PIP mode, set android:supportsPictureInPicture to true In the manifest.
- No need to set android:resizeableActivity to true if you are supporting PIP mode
- Apps can also display notification badges on app icons.
- Users can also long press on an app icon to glance at the notifications associated with the notification badge.
- Starting in Android 8.0 (API Level 26), notification channel allows you to create a user – customisation channel for each type of notification you want to display.
- Notification channel provides you a unified system to help users manage notifications. When you target Android 8.0 (API Level 26), you must implement one or more notification channels to display notifications to your users.
- If you don’t target 8.0 (API Level 26) but your app is used on devices running Android 8.0 (API Level 26), your app behaves the same as it would on devices running Android 7.1 (API Level 25) or lower.
Auto Fill Framework:
- Users can save time filling out forms by using auto fills in their devices.
- Less time spent in filling fields. Auto Fill saves users from re-typing information.
- Minimise user’s input errors Typing sis prone to errors, especially in mobile devices. Removing the necessity of typing information also removes the errors that comes with it.
- Before apps can work with the Auto Fill Framework, and auto fill service must be enabled in the system settings.
- Your app can help an auto fill service classify the data correctly by providing the meaning of each view that could be auto fillable, such as views representing usernames and passwords.
- Android 8.0 (API Level 26) allows you to instruct a TextView to let the text size expand or contract automatically to fill its layout based on the TextViews characteristics and boundaries. This setting makes it easier to optimize the text size on different screens with dynamic content.
- The Support Library 26.0 provides full support to the Autosizing TextView function on devices running Android Versions prior to Android 8.0 (API Level 26). The library provides support to Android 4.0 (API Level 14) and higher. The android.support.v4.widget package contains the TextViewCompat class to access features in a backward compatible fashion.
- To define the default settings programmatically, call the setAutoSizeTextTypeWithDefaults (int autoSizeTextType) method. Provide AUTO_SIZE_TEXT_TYPE_NONE to turn off the autosizing feature or AUTO_SIZE_TEXT_TYPE_UNIFORM to scale the horizontal and vertical axes uniformly.
- To define the default setting in XML, use the Android Namespace and set the autoSizeTextType attribute to none or uniform.
Fonts in XML:
- Android 8.0 (API Level 26) introduces a new feature, fonts in XML, which lets you use fonts as resources. You can add the font file in the res/font/ folder to bundle fonts as resources.
- These fonts are compiled in your R file and are automatically available in Android Studio.
- You can access the fonts resources with the help of a new resource type, font.
- For example, to access a font resource, use @font/myfont, or R.font.myfont.
- To use the fonts in XML feature on devices running Android API Version 14 and higher, use the Support Library 26.
- Double click a font file to preview the file’s fonts in the editor.
- Android 8.0 (API Level 26) and Android Support Library 26 introduce support for APIs to request fonts from a provider application instead of bundling files into the APK or letting the APK download fonts.
- The feature is available on devices running Android API versions 14 and higher through the Support Library 26.
- Reduce the APK size.
- Increases the app installation success rate.
- Improves the overall system health as multiple APK’s can share the fonts through provider. This saves users cellular data, phone memory and disk space. In this model, the font is fetched over the network when needed.
You can use the downloadable fonts features in the following
- Via Android Studio and Google Play Services
- Via the Support Library
- Android 8.0 (API Level 26) introduces adaptive Launcher icons, which can display a variety of shapes across different device models.
- For example, an adaptive launcher icon display a circular shape on one OEM device and display a squircle on another device.
- Each device OEM provides a mask, which the system than uses to render all adaptive icons with the same shape.
- Adaptive Launcher icons are also used in shortcuts, the Settings App, Sharing Dialogs, and the Overview screen.
- A ColorSpace is used to identify a specific organization of colors. Each color space is characterized by a model color that defines how a color value is represented (for instance the RGB model color defines a color value as a triplet of numbers)
- This implementation provides a pre-defined set of common color spaces describes in the ColorSpace.Named enum. To obtain instance of one of the pre-defined color spaces, simply invoke get(Named).
- Starting in Android 7.0 (API Level 24), users can choose among several different packages for displaying web content in a WebView project.
- Android 8.0 (API Level 26) and later versions include an API for fetching information related to the package that is displaying web content in your app
- This API is especially useful when analyzing errors that occur only when your app tries to display web content using a particular packages implementation of WebView.
- This API handles cases where the render passes process for a WebView object goes away, either because the system killed the renderer to reclaim much needed memory or because the renderer process itself crashed. By using this API, you allow your app to continue executing, even though the renderer process has gone away.
Java 8 Language API:
- Android 8.0 (API Level 26) brings runtime and other optimizations to the platform that result in a number of performance improvements.
- This optimzations include concurrent-compaction garbage collection, more efficient use of memory and code locality.
- This optimizations result in faster boot times, as well as better performances in both the OS and apps.
- Android 8.0 (API Level 26) adds supports for several additional OpenJDK Java API’s:
- java.time from OpenJDK 8.
- java.nio.file and java.lang.invoke from OpenJDK 7.
- To learn more about the classes and methods within these newly-added packages, see the API reference documentation.
- Beginning with Android 8.0 (API Level 26), the platform offers enhanced support for multiple displays.
- If an activity supports multi-window mode and is running on a device with multiple displays, users can move the activity from one display to another. When an app launches an activity, the app can specify which display the activity should run on.
- Only one activity at a time can be in the resumed state, even if the app has multiple displays. The activity with focus is in the resumed state, all other visible activities are paused, but not stopped.
- When a user moves an activity from one display to another, the system resizes the activity and issues runtime changes as necessary. Your activity can handle the configuration change itself or it can allow the system to destroy the process containing your activity and recreate it with the new dimensions.
- ActivityOptions provides two new methods to support multiple displays.
- setLaunchDisplayId(): Specifies which display the activity should be shown on when it is launched.
- getLaunchDisplayId(): Returns the activity’s current launch display.
- Share the feels with a fully redesigned emoji set, including over 70 new emoji.
Android 8.0 Behaviour Changes for all Apps
Background Execution Limits:
- To improve device performance, the system limits certain behaviours by apps that are not running in the foreground.
- Apps that are running in the background now have limits on how freely they can access background services.
- Apps cannot use their manifests to register for most implicit broadcasts. (that is, broadcasts that are not targeted specifically at the app.)
- The startService() method now throws an IllegalStateException if an app targeting Android 8.0 tries to use that method in a situation when it isn’t permitted to create background services.
- The new Context.startForegroundService() method starts a foreground service. The system allows apps to call Context.startForegroudService() even while the app is in the background. However, am app must call that service’s startForeground() method within 5 seconds after the service is created.
- Prior to Android 8.0 (API Level 26), if an app requested a permission at runtime and the permission was granted, the system also incorrectly granted the app the rest of the permissions that belonged to the same permission group and that were registered in the manifest.
- For Apps targeting Android 8.0, this behaviour has been corrected. The app is granted only the permissions it has explicitly requested. However, once the user grants a permission to the app, all subsequent requests for permissions in that permission group are automatically granted.
- For example, suppose an app lists both READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in its manifest. The App requests READ_EXTERNAL_STORAGE and the users grants it.
- If the app targets API Level 24 or lower, the system also grants WRITE_EXTERNAL_STORAGE at the same time, because it belongs to the same STORAGE permissions group and is also registered in the manifest.
- If the App targets Android 8.0 (API Level 26), the system grants only READ_EXTERNAL_STORAGE at that time, however , if the app later requests WRITE_EXTERNAL_STORAGE , the system immediately grants the privilege without prompting the user.
Android Background Location Limits:
In order to preserve battery, user experience and system health, background apps receive location updates less frequently when used on a device running Android 8.0. These changes affects the following API’s:
- Fused Location Provider (FPS)
- Geo Fencing
- GNSS Measurements
- Location Manager
- Wi Fi Manager
Behaviour changes for Apps targeting Android 8.0
Apps that uses SYSTEM_ALERT_WINDOW permission can no longer use the following window types to display alert windows above other apps and system windows:
Apps must use a new window type called TYPE_APPLICATION_OVERLAY
- An App’s alert window always appear under critical system windows, such as the status bar and IME’s
- The system can move or resize windows that use the TYPE_APPLICATION_OVERLAY window type to improve screen presentation.
- By opening the notification shade, users can access settings to block an app from displaying alert windows shown using the TYPE_APPLICATION_OVERLAY window type.
- The framework can perform automatic audio ducking by itself. In this case, when another application requests focus with AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK, the application that has focus reduces its volume but usually doesn’t receive an onAudioFocusChange() callback and will not lose audio focus.
- New API’s are available to override this behaviour for applications that need to pause instead of ducking.
- When the user takes a phone call, active media streams mute for the duration of the call.