2015 is over, which means that it’s time to take stock. What is important, useful and interesting for Android developers happened in the past year - read our blog.
The year turned out to be rather saturated not only for ordinary users who received a large line of new devices, a new version of OS - Android Marshmallow and many changes in the design of most popular applications (Material Design continues the attack), but also for Android developers who have felt no less significant Changes in the work environment, libraries, and design patterns.
')
A library was finally released for
almost full-fledged support for the Material Design - Design Support Library guidelines. Developers received new components for implementing FAB, Navigation Drawer, SnackBar, Collapsing Toolbar and other elements. At first there were a large number of bugs, but at the moment the library has already been finalized for widespread use. Were also updated and added support-libraries, a complete list of which you can find
here .
Android marshmallow
The new version of the Android operating system brought not only new approaches to the design of the interface, but also made a significant correction in power saving and access rights for applications. The developers were presented with a new version of the SDK (API 23), which, along with innovations, brought many problems:
- Real-time permissions. Now, in order to carry out potentially “dangerous” actions, developers will have to ask the user's permissions while the application is running. More details can be found here . The latest versions of the support libraries provide a fairly convenient interface for working with permissions, but this solves only a small part of the problems related to the implementation of obtaining rights, but not to the logic of the application. For example, disputes about what to do if the user has not granted some kind of permission still do not subside.
- DOZE Mode. The Google team has taken a very important step towards optimizing battery life, which has previously caused a lot of criticism. Users, not seeing the history of battery consumption, blamed the OS directly, not realizing that more often the battery is eaten by questionable applications
from no less dubious authors . Now users do not need to take care of it. With the arrival of two new modes - Doze Mode and App Standby - the operating system blocks oxygen to all overly voracious applications. Doze Mode is a mode in which absolutely all devices on Android Marshmallow OS go after a certain time of inactivity and without charging. And the second new mode is App Standby - automatic deprivation of access to device resources of all applications that have not been used for a long time. Developers need to take into account changes in the JobSheduler and SyncAdapter classes: when switching to new modes, all current tasks are canceled, and new ones are postponed until awakening. More information here or here . An interesting schedule of transition in doze mode. - Apache For some people good, and for someone not very, was the news about the inaccessibility of Apache packages in API 23. If you used it in your applications before, then now you have to either refuse it, or connect it separately.
- System security using the system itself. Unlocking the screen, working with the sensor for third-party applications regardless of the smartphone model, shopping inside Google Play and authorization on sites using a fingerprint - all this has become a reality in the Android world. More details .
Google Play Services
With the new update of services to version 8.4, the developers have expanded the possibilities for using the previous modules:
- Google Maps - the opportunity to work offline. In addition, the implementation of maps on Wear devices became available.
- GCM . Please note that the module for push-notifications has been redesigned and, if you have previously used a WakefulBroadcastReceiver, it is recommended to switch to a new architecture, for details, see here .
Also, a number of new modules have been added to Google Play Services:
- Google Fit API - there is a whole industry of fitness applications that use various sensors of the device to collect data. Now it has become easier with the new module for working with sensors.
- Places API - also now has access to Google Places (previously, access was only possible via the web API). However, we note that Google has not yet implemented support for laying routes on Google maps (Directions API).
- Other modules such as Google Drive, Mobile Vision API, Marshmallow Permissions, Application Measurement, Nearby Messaging and many others can be found here .
Libraries and frameworks
Retrofit 2A very important was the update of the most popular library for working with the network - Retrofit - to version 2.0. So far, this version is in beta status, but this does not prevent developers from actively using it. The main changes are: encapsulation of the request in the Call object (allows organizing more flexible work, including canceling the request), splitting the library into components, support for various converters and adapters, and syntactic sugar in the form of new annotations. In more detail - the
performance of Jake Warthon on Droidcon.
RxjavaThis year was also marked by a tremendous increase in the popularity of the RxJava framework in Android. This library works closely with Retrofit and other libraries, such as
Realm . RxJava has many advantages for fulfilling queries with the possibility of combining, restarting and much more, which makes it convenient, among other things, to use it for work with a network. Today, a lot of resources are devoted to this framework:
blogs ,
habr and much more. Also, many developers diligently rewrite the standard functionality in a reactive style:
RxBinding ,
RxPermissions ,
RxLoader .
Dagger 2Also, Dagger 2 was marked by an increase in popularity. Here it is worth mentioning its main differences with Dagger 1:
- Lack of reflection, which increased the readability of the source code and increased performance.
- API for working with POJO.
- Validation of graphs at compile time.
Documentation and sample bundle
Dagger 2 + MVP .
KotlinThe promised release of this language almost took place, the current version is 1.0 Beta 4. Of course, problems can sometimes arise, including many complaints about the compilation, but JetBrains is actively working on it. And in general, Kotlin is already quite ready for use in combat projects. More
here and
here .
Established practices
If the previous year became some standardization in terms of interface design, then the current year was filled with attempts to standardize the “guts” of an application — that is, provide patterns that could be used to develop applications in a fairly universal way. Previously, it was difficult to talk about some kind of common architecture of Android applications, but now most companies are already diligently introducing practices and approaches for using well-established development patterns.
MVPThis is both the most popular and the most controversial pattern. Popular - because it successfully allows you to separate business logic and interface elements, which in turn provides convenience for testing. Controversial - because absolutely every developer has his own opinion on how to implement this pattern. You can look at some of its implementations
here . Also there is a good
article on Habré, which tells about a bunch of MVP and RxJava.
MVVMAnother fashionable pattern that is actively used in WPF. He gained popularity in the Android world thanks to the development of Google - Data Binding. It should be noted that this library is still insufficiently stable (it has beta status). However, Google without a doubt will bring it to mind, so you should study it
now .
Android Studio 2.0
The end of the year was marked by another significant event for developers - in November, Android Studio 2.0 became available to everyone in the Preview Channel. Obviously, the presented functionality makes this update the most significant of all:
- Instant Run. What so many developers have been waiting for. Now you do not need to deploy the application again every time after several lines of changes. So far, it is not very stable and only when using Gradle 2.0 alpha (which is also not very stable). We will wait for Google to stabilize the work, which we will all be very happy about.
- New emulator. Every developer knows about the speed of the native emulator, and there is nothing surprising that most prefer Genymotion. Surely Google didn’t like this situation, and now in Android Studio we see a great emulator, with all the necessary functionality: with a camera, GPS
and blackjack . - The Google team also paid enough attention to the build time of the projects . According to their assurances, the new version of the projects are going twice as fast. Naturally, this is good news.
More detailed information you can find
in the developers
blog .
Conferences
In 2015, a lot of decent conferences also took place, such as Google I / O and many Droidcons (of which Droidcon NYC stands out the most).
Google I / O 2015During Google I / O 2015, the speakers focused on new versions of operating systems and Google services, so the main topics of the conference were: Android M, updated Android Wear, Internet of Things, Google Now, Google Photos, offline services, new tools for developers, updated Google Cardboard. An overview can be viewed on the
GT .
Most of the news we have already reviewed separately, but something worth mentioning is:
- Web experience. The main update here is Custom Chrome Tabs . The problem that this tool solves is the following: more and more applications for Android somehow use browser functions, and often when using this or that program you have to constantly switch between it and the browser window with an open tab.
- Mobile payments. Finally, Google introduced its version of the payment system from a smartphone - Android Pay. A bank card is attached to a smartphone with an NFC chip, and users can pay with the device in places where they accept Android Pay.
- Google Maps and YouTube offline. Now, in Google Maps, when there is no Internet connection, you can not only view the map of the area that you previously downloaded, but also use the search, see the POI, and even use the navigation with voice prompts. This is really what Google Maps users have been waiting for. More details .
Droidcon nycThis conference was marked by a large number of reports devoted specifically to development, and it is not surprising that it enjoys well-deserved popularity. Enough to even watch the
program to stay there for a long time. Of course, you need to highlight the reports
Simple HTTP with Retrofit 2 ,
Detect all memory ,
Fresco: How it saved a day ,
Kotlin: New Hope in a Java 6 Wasteland and many others.
Android Dev SummitAt this conference, we saw many interesting reports on the most relevant topics, of which the following can be highlighted:
What awaits us in 2016
Undoubtedly, more and more projects will be developed in jet style using RxJava. Also, many companies and developers will try to adhere to such patterns as MVP and MVVM, due to which, in addition, an increase in test coverage is expected, as it becomes more accessible and less expensive (especially considering the latest testing frameworks).
We should expect potential new solutions in working with databases, since existing libraries still have many drawbacks.
We also hope to get closer to the
minSdkVersion 19 dream (and maybe 21).
And of course, every year the development for Android is becoming more interesting, so we will believe that 2016 will bring us all more great new ideas and solutions.
Acknowledgments
First of all, I would like to thank all the active members of the new
Android community of developers who helped in writing this article. I would like to thank some of them separately:
atetc iamtodor nexus700120