Android 8.0 Oreo: Features and Updates You need to know

divya

Android 8.0 Oreo is now OFFICIAL!!. It is said to be faster and powerful than ever. Let’s take a look at new features and enhancements with Android 8.0

Power Saving and quicker boot time

Oreo has put limits on app background activities which will increase users battery life and performance.These limits will include location updates, implicit broadcasts, and background services. This will minimize energy consumption and in turn longer battery life.

If multiple apps are running along with background services, more load is placed on a system which results in delay and poor user experience. To avoid this problem, Oreo has put restrictions on background work.

There are two types of limitations:

  • 1. Background service limitations
  • 2. Broadcast limitations

If multiple apps registered for many broadcasts, an event that triggers a broadcast causes all those apps to receive and consume resources which result in poor user experience. Apps that target Android 8.0 or higher can no longer register broadcast receivers for implicit broadcasts in their manifest.However, the manifest can be used to register explicit broadcasts.

Discuss your proeject

This means if any app launched from an implicit broadcast or any app launching services in the background then these implementations will break in Oreo. That is if any app calls, startservice() when that app is not foreground then Illegalstateexception will be thrown. These restrictions only apply to apps that target Android 8.0 (API level 26) or higher.But even apps target less than 26, a user with Oreo can enable most of these restrictions for any app from setting screen.

However, there are few services which are whitelisted and treated as foreground even if they are running background when are being triggered from high priority FCM/GCM notification, performing SMS/MMS delivery, acted from notification action etc. the Same concept goes for implicit broadcasts. Few implicit broadcasts are still allowed. Ex: BOOT_COMPLETED, LOCALE_CHANGED etc.

For detail explanation, you can refer to Google Developer Blog.

Picture-in-Picture

pip- picture in picture

System UI Tuner where user can enable Picture In Picture mode

Another awesome feature of Android Oreo is Picture-in-Picture (PiP). This allows the user to watch videos on a small screen while other apps will occupy full screen and the user can perform operations.Best example will be the user like getting directions on the map along with video call. Multitasking is now possible with this feature. This is one of the biggest and awesome features offered in Android, but there is a rule which we need to understand before jump in and use. In order to use this, video apps must be updated. For Youtube, a user has to subscribe youtube red or google play music to use new PiP mode.

Notifications

This feature provides detail control over notifications to the user. The user now can disable entirely or fine-tune according to his wish. Major changes as listed below.

1. Handling notification shade with extra actions: with O, the media control background color changes according to album artwork. With the partly swipe, a user can see options to snooze notifications for a specific time. This swipe also provides access to notification settings for that specific app.

2.notification dots:  User can press on dots to see what’s new and can be clear them by swiping away.Long press shows contextual menu actions.

notification

Notification dots keep users active in your app and let them jump directly to the app’s core functions

3. Notification channels: System to help the user manage notifications. If there are too many notifications, a user might completely block notifications. In order to avoid this, Oreo comes with notification channel concept. Apps targeting android O or later must implement one or more notification channels to get displayed to users.Each channel is for different type and can be set the way the app wants to alter device.

Autofill

Who wants to keep typing all details ?? Android O makes easy for the user by allowing the OS to autofill information across apps and webs.

Wi-fi Awareness

In Android O a new feature called Wi-Fi Awareness will allow Wi-Fi devices to talk to each other via an ad hoc local network.

Emoji’s

Notification dots keep users active in your app and let them jump directly to the app's core functions

Express yourself with all new round emoji in Android 8.0. Say goodbye to blob emojis.

Adaptive Icons

 

android adaptive emoji

Adaptive Icons

Oreo allows the user to choose between shapes for icons like square, round, rounded square etc. Developers will be able to use different shape app icons, according to manufacturer’s preference. Google introduced strict guidelines to adhere to icon designing that will help to create a unified visual style across more apps.

Google Play Protect

This left user know whether the app about to install has been certified safe by google play team. Play Protect scans billions of app in Playstore to ensure apps are free from the damaging device.

Autosizing TextViews

Oreo allows Textview to expand or contract automatically to fill its layout based on characteristics and boundaries. That is, if TextView has only a few words to display in the large area, it may scale your text up to avoid awkward empty space in layout whereas if TextView has a large amount of text, it will scale that text down rather than cut it off mid-sentence.

Example of Auto-Sizing Textview

Example of Auto-Sizing Textview

There are three ways you can set up the auto sizing of TextView:

  • 1. Default  
    Lets the auto sizing of TextView scale uniformly on horizontal and vertical axes.
     android:autoSizeTextType=“uniform” [ or none]
  • 2. Granularity
    we can define biggest ,smallest and scaling increment
    android:autoSizeTextType=“uniform”
    android:autoSizeMinTextSize=“12sp”
    android:autoSizeMaxTextSize=“100sp”
    android:autoSizeStepGranularity=“2sp”
  • 3. Preset Sizes
    Lets user specifies all the values that the TextView picks when automatically auto-sizing text. We can create an array of sizes and TextView will select most appropriate size from available values.
    android:autoSizeTextType=“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>

Fonts

Custom fonts are now fully supported resource type in oreo. There are two ways we can add custom fonts to app.

  1. Import fonts [ .ttf ] file into project
  2. Add code that will request chosen font from “Font Provider

If we go for the 2nd option, then once the app is installed on the device, it will request that specific custom font from “font provider” which will, in turn, fetch necessary files and caches locally. Happy right !!! This means we can use custom fonts without increasing our app apk size.

Oreo also introduced “Fonts in XML”. This lets developers use fonts as resources. Add font file in res/font folder and use it in the XML file. Yayyy !!!. To add fonts to the TextView or in styles, use the font-family attribute.
For example, to access a font resource, use @font/myfont, or R.font.myfont.
android:fontFamily=“@font/lobster”

Pinning shortcuts and widgets

Oreo introduces in-app pinning of shortcuts and widgets.i.e, you can create pinned shortcuts and widgets for supported launchers. Pinned shortcuts appear in supported launchers as separate icons. If you want your app to provide pinned shortcuts, then first verify whether default launcher supports pinned shortcuts.

Pic 6: In Android 8.0 your app can directly pin a specific app shortcut in the launcher to drive engagement

//Create an instance of ShortcutManager//
ShortcutManager myShortcutManager = getSystemService(ShortcutManager.class);
if (myShortcutManager.isRequestPinShortcutSupported()) {

If TRUE, then create shortcutInfo object and add properties

//Define the shortcut’s string ID//
ShortcutInfo pinShortcutInfo = ShortcutInfo.Builder(context, “shortcut-Id”);

//Set the short label//
 .setShortLabel(getString(R.string.short_label))

//Set the long label//
 .setLongLabel(getString(R.string.long_label))

//Define the action that you want this shortcut to perform//
 .setIntent(new Intent(Intent.ACTION_DIAL, mostFrequentContact))

//Set the icon//
 .setIcon(Icon.createWithResource(context, R.mipmap.ic_contactProfile))   
 .build();

Create Now pin shortcut to user’s home screen by implementing requestPinShortcut(). Once pin is created, we can update its content by using updateShortcuts().

The world is getting smarter, faster and even more powerful with Android Oreo. At this time mobile app development companies have opportunities to come up with the applications that make our work much easier.

Mobile App development

about the author

divya