📜 ⬆️ ⬇️

Android M and Developer Tools

Hi, Habrahabr! Last year, for the first time, we provided developers with a test version of Android L and received many useful reviews related to Material Design, as well as new Android Auto, TV and Wear platforms. Yesterday at the Google I / O conference, we announced the repetition of our successful experience: meet the test version of Android M.



The developers were pleased with the access to the new version of Android in the past year: it allowed to update and optimize applications for the new version of the operating system, in which many new things were introduced (including the design and guidelines for interface design). We want to continue to provide developers with the opportunity to qualitatively prepare for the release of the new OS version: as you requested, we will provide a clearer schedule of updates to the SDK and the test version of Android M.

')

The main thing in Android M: improving the basics


Android L brought with it a completely new user interface, a new ART program execution environment, increased work speed and responsiveness of the interface. In Android M, we focused on improving the basic user experience: eliminated various errors and made major changes to the main elements of the platform.

Application Permissions
We decided to give users more control over the access of applications to smartphone resources. Now requests will appear right while the application is running, in the appropriate context, and users can choose whether to give permission or not. In addition, users can easily manage the rights of installed applications through the system settings menu. This change simplifies the installation process and speeds up updates, since user intervention when changing the list of permissions is no longer required.

image


The number of devices on Android M will increase, and this change will require developers to create applications in such a way that access requests appear when required and take into account that some access permissions will not be obtained.

Build bridges
App Links is a new way to “build bridges” between various Android applications. Developers have previously had the ability to handle URLs within applications. In the new Android M, you can add the autoVerify attribute to the application manifest, so that users can click on specific links directly to the original application without additional requests, bypassing the browser opening and the selection window with the continuation in the native application. App links, as well as indexing apps for Google Search, makes it easy to navigate and return between your apps.

Energy saving
Android is getting smarter, and this also applies to power management systems. The new system of "deep sleep" ("Doze") will allow your devices to work even longer. To optimize power consumption, Android M will turn to motion sensors, determine when the device is not in use, and switch to maximum power saving mode. In this case, alerts and important messages will still come. Developers should prepare for innovations and the “deep sleep” mode: for example, when developing a messenger, you can use messages with high priority to get a response from your application even in the “deep sleep” mode.

We are also pleased to announce some of the larger innovations.

Google Now with one touch (Now on tap)
The new system of interaction with the assistant Google Now will make it even easier to get hints. Suppose you received a message from a friend in which he invites you to visit a new restaurant. You will be able to access Google Now without switching between applications. After analyzing the text of the message, the service will find the restaurant's menu and reviews about it, help book a table, get directions and provide links to suitable applications.

image


With Now, with one touch, you can find the information you need and perform various actions very quickly. To allow users to work with the application through Google Now, the developer will need to implement indexing of applications for Google search .

Android Pay and Fingerprints
The introduction of the Android Pay payment system required two components operating at the system level: NFC, an embedded version of Android 2.3, and bank card emulation, which appeared in Android 4.4. Yesterday we presented the Fingerprints API, another component of a secure and simple system that allows you to work with biometric data at the OS level.



Together, Android M and Android Pay allow users to confirm purchases (both in retail networks and on Google Play) with one touch of the fingerprint scanner. With the addition of fingerprints at the system level in Android M, users will be able to protect themselves from unauthorized purchases, unlock the phone and individual applications; and developers - to use universal system APIs for working with biometric authorization in their applications, and it will work on all devices and scanners supported by the system.

image


This list of innovations Android M does not end there. To learn more about all the changes and improvements of the new version of Android, please follow this link .

Android Developer Tools


It would be strange to release a test version of Android M with new features, but not provide appropriate development tools that support the new features. Therefore, we are pleased to introduce Android Studio 1.3. Now developers can adapt their applications to the latest APIs supported by Android M.


Early access to Android Studio 1.3
In the new version of Android Studio, we have added a function that Android NDK and games developers have been asking for a long time: the ability to change and debug C or C ++ code.

image


The Android Studio NDK plugin is based on the JetBrains Clion platform and allows you to refactor and compile C and C ++ code and work with your application's Java code. Support for these programming languages ​​is incorporated into a single development environment, free for Android application developers. Install Android Studio 1.3 via Canary update channel today and share your opinion with us.

Android Design Support Library
Developing applications on the principles of Material Design has become even easier! New library Android Design Support Library contains a set of core components, backward compatible with API 7, for example, a floating action button, status bar, navigation bar, toolbars. Do not waste time on the invention of the bike, add them to your application to match the design of the system.

Google Play Services Update
Google Play Services version 7.5 contains many new features, starting with the Smart Lock password store, as well as new APIs for Google Cast and Google Cloud Messaging, and access to the Google Maps API on Android Wear devices.

One more thing


Mobility has become a synonym for everyday life: checking emails on the way to work, sharing a photo right in the park, arranging a video conference while in the car - now you won't be surprised by this. However, these applications have one problem, which in most cases is simply not solved by the developers due to its complexity and enormous effort. As you understand, we are talking about the termination of work due to the loss of the Internet connection or the need to re-download a large amount of data when you re-open the application.

Today we are happy to present you a set of functions for the SDK on Android and iOS , allowing you to create applications that run offline without problems. Meet the Firebase Offline !

Work with Firebase Offline
The new SDK supports saving your synced data to a local disk. Thus, they become available to your application immediately after its launch. You can enable synchronization mode with just one line of code:
// Android Firebase.getDefaultConfig().setPersistenceEnabled(true); // Obj-C [Firebase defaultConfig].persistenceEnabled = YES; // Swift Firebase.defaultConfig().persistenceEnabled = true 

With the help of new tools you can determine for yourself what data you need to download in advance and save to work without an Internet connection. To do this, use the keepSynced function:
 // Android ref.keepSynced(true); //Obj-C [query keepSynced:YES]; 

Designed specifically for mobile networks
For the exchange of information between the client and the server in the Firebase database, instead of the classical request-response system, synchronization is used. All read and write operations are first performed on the local version of the database stored on the device; then there is a mutual exchange of information between the servers. All this allows Firebase to compensate for an unstable connection: local write operations are combined with local read operations before the server confirms them.

image


But that's not all. A nice bonus of this design is the higher-quality offline operation of the application as a whole. Since all data first passes through the local version of the database, the SDK "selects" the most optimal source: network or local disk. Later, when the network becomes available, the SDK automatically sends local changes to the server and receives the latest updates from it.

Firebase: everything is already checked and works
From the very beginning, we created Firebase to support the work of applications in the offline mode - it took the team several years to complete the job. Since 2013, Citrix has been beta testing offline support functions for its iOS-based Talkboard application. When working in this mode, user actions in the application are saved on the device, and when connected to the Internet they are synchronized with servers. For example, you drew something on the “canvas” in the Talkboard, and even if you were not connected to the Web at that moment, the drawing will not be lost, but will be saved and transmitted to the server as soon as the connection resumes.

The key to start


Android M for developers includes an updated SDK with tools and system images intended for testing on the official Android emulator, as well as on Nexus 5, Nexus 6, Nexus 9 and Nexus Player devices. We’ve expanded our testing program, so you’ll have more time to prepare for the final launch of Android M this fall. Your feedback will help us update system images more often. The sooner you share your impressions with us, the more effective your testing will be!

To get started with the test version of Android M and prepare your applications for the final launch, follow these instructions:

  1. Install the test version of Android Studio 1.3+;
  2. Visit the Android M website for developers ;
  3. Check out the new APIs and Permission Changes for applications ;
  4. Visit the Android Design Reference Library and check out the Google Play Services APIs ;
  5. Get system images for testing via the SDK Manager or download system images for Nexus devices ;
  6. Test your applications on a Nexus device or emulator;
  7. Share your impressions with us.


Getting started with the new offline service Firebase is also very simple: go to the section with tutorials on offline mode for iOS or Android , everything is described in detail here, besides there is a great example of offline drawing on iOS and Android devices. We welcome your feedback! Email us at Google Groups or mention @Firebase on Twitter.

We are waiting for your feedback.


Early access to Android L allowed us to obtain invaluable information, correct many shortcomings, and prepare for the release of a new version of Android to thousands of developers around the world. Install the SDK, test Android M and applications, embed new features, and most importantly, share information. A complete list of developer communication resources can be found here . We care about every opinion, every error report, every comment and suggestion. Together, we can make Android M even better.

Source: https://habr.com/ru/post/259123/


All Articles