Android 8

Android 8

Android 8.0 (API level 26) introduces behavior changes as well as new features and APIs. The key changes that impact NAO SDK are Android background execution limits. If you are using NAO SDK only in a user-app interactive way, there will not be much changes; however if your app uses NAO SDK for background purpose, you need to make some changes.

Background service on Android 8.0

Service is an application component that can perform long-running operations in the background, and it does not provide a user interface.

  • A foreground service performs some operation that is noticeable to the user. For example, an audio app would use a foreground service to play an audio track or a NAOLocation based task may use a foreground service to receive location whatever the user is doing. Foreground services must display a status bar icon and continue running even when the user isn’t interacting with the app.
  • A background service performs an operation that isn’t directly noticed by the user. For example, if an app used a service to compact its storage, that would usually be a background service

Due to services background limitations on android 8.0, developers have to bring services to foreground if the application is in the background with a call to Context.startForegroundService() method.

Configure a notification

 

After the system has created the service it will show a new service’s user-visible notification. It is mandatory to have a notification when you have a running ForegroundService which will be displayed as long as the service will be running. By default, Android will show a notification informing the user of your application background activity. (see default Notification below)

However, this notification is configurable as any Android notification.

 

 

Notifications on Android 8.0

Android 8.0 (API level 26) introduces a variety of new features and capabilities for users and developers. Among others, they have redesigned notifications to provide an easier and more consistent way to manage notification behavior and settings.

One main change is the notification channels that allow you to create a user-customizable channel for each type of notification you want to display. If the notification you’ve created is not visible enough, Android will display the default notification. In order to have only your created notification, set the parameter “importance” of the NotificationChannel to either: (see notification example below)

– IMPORTANCE_DEFAULT

– IMPORTANCE_HIGH

– IMPORTANCE_LOW

 

Links:

https://developer.android.com/about/versions/oreo/android-8.0-changes.html

    • Related Articles

    • Android 12

      Intro Android 12 introduced new features and behaviors, from permissions to security, that affect directly the NAO® SDK. All the changes are described on Android 12’s documentation. NAO® SDK Release 21.02 (v4.10.x) will still work as expected with ...
    • Android

      NAOMAPSDK is a mobile map tool that allows developers to integrate indoor maps into Android and iOS applications using map data from NAO Cloud. This SDK simplifies the process of adding indoor mapping functionality to mobile apps, making it easier ...
    • Android 9

      Android 9 (API level 28) introduces a number of changes to the Android system. The following behavior changes apply to all apps when they run on the Android 9 platform, regardless of the API level that they are targeting. All developers should review ...
    • Android 11

      Location Permissions If your app targets Android 11: Like Android 10, you need location permission called ACCESS_BACKGROUND_LOCATION to allow location information even if the app is in the background. If you request a foreground location permission ...
    • Android 10

      Device Location If your app targets Android 10 (API level 29) or higher: App cannot access the location unless said app is in the foreground. This feature is enabled by default . There is, however, a new location permission called ...