Eager developers want to get their hands on “Android Oreo” as soon as possible, and the black-and-white Oreo is like binary code that fascinates tech geeks.
Since we launched Android Oreo a month ago, we’ve received a lot of inquiries, with typical questions from people who care about this important new feature.
To get you up to speed on Oreo’s features and how it differs from previous versions of Android, this month’s Android Developer FAQ answers some Oreo questions for developers.
Q: Do these new features provide backward compatibility, and if so, to which version?
A: For all API level applications:
-
Network connections and HTTP(S) connections
-
Processing of sets
-
Logs uncaught exceptions
-
Input and navigation
-
security
-
Background execution restriction
-
privacy
Apps for Android O:
-
Content change notice
-
View the focus
-
permissions
-
Processing of sets
-
The media
-
Class loading behavior
Q: One question about Android Oreo: In this version, system broadcast receivers can no longer be registered implicitly, except for specific system implicit broadcast receivers. So, can custom broadcasts be registered as implicit?
A: Custom broadcasts can be registered implicitly. If an application is registered to receive broadcasts, the application receiver consumes resources every time it sends A broadcast. This can cause problems if multiple applications are registered to receive broadcasts based on system events; System events that trigger broadcast can cause all applications to consume resources quickly and continuously, reducing the user experience.
Android 8.0 makes these restrictions even tighter
-
Applications for Android 8.0 cannot continue to register broadcast receivers for implicit broadcasts in their listings. Implicit broadcast is a broadcast that is not specific to the application. For example, ACTION_PACKAGE_REPLACED is an implicit broadcast because it will be sent to all registered listeners to let them know that some packages on the device have been replaced.
ACTION_MY_PACKAGE_REPLACED is not an implicit broadcast, however, because no matter how many other applications have registered listeners for the broadcast, it will only be sent to applications whose packages have been replaced.
-
Applications can continue to register explicit broadcasts in their listings.
-
Applications can use context.registerReceiver () at run time to register receivers for any broadcast, whether implicit or explicit.
-
Broadcasts that require signing permission are not subject to this restriction because they are only sent to applications that use the same certificate signature, not to all applications on the device.
In many cases, applications that previously registered for implicit broadcasting can obtain similar functionality using the JobScheduler job. For example, a social photos app may need to perform data cleansing from time to time and tends to do so when the device is connected to a charger.
Previously, the application had registered a receiver for ACTION_POWER_CONNECTED in the manifest; When the application receives the broadcast, it checks to see if cleanup is necessary. To migrate to Android 8.0, the application removed the receiver from its listing. The application schedules cleaning jobs to run when the device is idle and charging.
Q: How do I set up my Android 8.0 Oreo device for mobile printing?
A: With the release of Android 8.0 Oreo, you can print on Android devices without setting up. Mobile printing is now built in. You can use the default print service on Android 8.0 Oreo devices for core printing functions without having to install a print service or download a mobile print application
Q: What else is interesting about Android Oreo?
A:
Bring aboutSmart text selection
In applications that support it, you can tap anywhere on an address, URL, phone number, or email address. Android will recognize the content of the text and quickly select the entire string for you, figure out the appropriate start and end points for itself, and then give you one-click options to select the most logical location (for example, a new phone or address with a number).
Bring aboutEasier access to the local file manager
Android Oreo’s file manager has some new options, including the ability to display your full internal storage and open the native file manager inside the application. It’s almost as powerful as a third-party file manager, and it allows basic browsing and file manipulation, which is adequate for most people.
Bring aboutSmarter Wi-Fi switching
Being deeply immersed in the Pixel phone’s network Settings menu is one of Android Oreo’s most delicious options: allowing your phone to automatically turn on Wi-Fi anytime, anywhere within a known high-quality network. Without the need for complex configuration in third-party applications to accomplish this additional choice. (This feature currently only works on Pixel phones.)
Q: Does Android O look any different than I do now?
A: Oreo isn’t A huge change in Android aesthetics, but it does introduce some significant tweaks and refinementsto the core user interface. The notification and Quick Settings panels are probably the most obvious examples. It is now a lighter hue, with more information and some rearranged elements.
Notifications themselves also work for Oreo’s specific themes: for example, in Play controls for Google Play Music and YouTube, notifications use a nice color scheme that matches the artwork of the currently playing song or video.
Q: Are there any new changes to Android O for multiple languages and countries?
A: Android 7.0 (API level 24) introduced the concept of specifying the default category Locale, but some apis still use the generic locale.getDefault () function with no arguments when the default DISPLAY category Locale should be used.
In Android 8.0, the following functions use locale.getdefault (category.display) instead of locale.getdefault () :
-
Currency.getDisplayName ( )
-
Currency.getSymbol ( )
-
Locale.getDisplayScript ( )
Locale.getdisplayscript (Locale) also falls back to locale.getDefault () when the displayScript value specified for the Locale argument is not available.
Other changes related to locale and internationalization are as follows:
-
Calling currency.getDisplayName (null) raises a NullPointerException.
-
The analysis method of the time zone name is changed. Previously, Android devices used a system clock value cache that was initialized at startup to analyze the name of the time zone for date and time. Therefore, if the system clock fails at startup or in other rare cases, it can negatively impact the analysis.
-
Now, in general, the analysis logic will use THE ICU and current system clock values when analyzing time zone names. This change provides more accurate results, which may differ from previous versions of Android if your application uses classes such as SimpleDateFormat.
-
Android 8.0 updates ICU to version 58
Q: I have been doing web development recently. Are there any special changes to WebView in Android O?
A: The Android Auto-fill framework provides built-in support for auto-fill. For apps installed on devices running Android 8.0, the following WebView object methods have changed:
WebSettings
-
The getSaveFormData () function now returns false. Previously this function returned true.
-
Calling setSaveFormData () no longer has any effect.
WebViewDatabase
-
Calling clearFormData () no longer has any effect.
-
The hasFormData () function now returns false. Previously, this function returned true when the form contained data.
Q: Which apis are affected by Android O background location restrictions?
A: Fused Location Provider (FLP)
-
If your app is running in the background, the Location system service will only calculate new locations for it at intervals defined in Android 8.0 behavior changes a few times per hour. This is true even if your application requests more frequent location updates.
-
If your application is running in the foreground, there will be no change in location sampling rate compared to Android 7.1.1 (API level 25).
Geofencing
-
Background applications can receive geofenced conversion events more frequently than they receive Fused Location Provider updates.
-
The average response time for geofencing events is approximately every two minutes.
GNSS Measurements and GNSS Navigation Messages
-
When your application is in the background, the callbacks registered to receive GnssMeasurement and GnssNavigationMessage output stop executing.
Location Manager
-
Location updates provided to background applications will only be provided at intervals defined in Android 8.0 behavior Changes, several times per hour.
* Note: You are strongly recommended to use the Fused Location Provider (FLP) if your app is installed on Google Play.
WLAN manager
-
The startScan () method performs a full scan of the background application only a few times per hour. If the daemon calls this method again a short time later, the WifiManager class will provide the cached results of the last scan.
Q: What changes did Android O make to contacts this time?
A: In previous versions of Android, the Contact provider component allowed developers to retrieve usage data for each contact. This usage data reveals information for each E-mail address and each phone number associated with a contact, including how many times the contact was contacted and when the contact was last contacted. Applications requesting READ_CONTACTS permission can read this data.
If applications request READ_CONTACTS permission, they can still read this data. Starting with Android 8.0, usage data queries return approximations rather than exact values. However, exact values are still retained internally within the Android system, so this change does not affect the Auto-complete API.
This behavior change affects the following query parameters:
-
TIMES_CONTACTED
-
TIMES_USED
-
LAST_TIME_CONTACTED
-
LAST_TIME_USED
Q: Hello, I pay more attention to the security of Android O. What improvements has Android O made in account security?
A: Unless the authenticator owns the user account or the user grants access, the application cannot access the user account.
With GET_ACCOUNTS rights has not only access to the user account, for account access, application should use the AccountManager. NewChooseAccountIntent () or specific to the authenticator function. After winning account access, application can invoke the AccountManager. GetAccounts () to access the account.
LOGIN_ACCOUNTS_CHANGED_ACTION is deprecated on Android 8.0. Now, the application at run time, you should use addOnAccountsUpdatedListener () for account update information.
These are some of the most frequently asked questions we’ve collected about Android Oreo and their answers. If you have a question about other aspects of Android development, feel free to leave a comment. When questions in some areas come up, we’ll put together a FAQ column for developers to answer their questions.
Recommended reading:
Android 8.0 Oreo available test platform online
Android Vitals gives your apps superior performance
Android Oreo downloadable fonts
Android O makes installing apps safer
With hundreds of millions of downloads worldwide, how does Libii Game, based in Chengdu, explore overseas markets?