Year was issued quite saturated not only for ordinary users who received a big line of new devices, the new OS version — Android Marshmallow and it is a lot of changes in design of the majority of popular applications (Material Design continues approach), but also for Android-developers who felt not less essential changes in a working environment, libraries and patterns of design.
At last the library for
The new version of the Android operating system brought not only new approaches to design of the interface, but also entered essential correction to energy saving and access rights for applications. The new SDK version (API 23) which together with innovations brought also many problems was submitted to developers:
- Real-time permissions. Now for commission of potentially "dangerous" actions developers should ask permissions the user directly during application operating time. It is possible to look in more detail here. The latests version of support of libraries provide rather convenient interface for work with permissions, but it solves only small part of problems relating to implementation of receipt of the rights, but not to logic of operation of application. For example, to these disputes on what to do if the user did not provide any permission do not cease.
- DOZE Mode. The command of Google took very important step towards optimization of operation of the battery which caused a lot of criticism earlier. Users, without seeing battery expense history, accused directly OS, without understanding that more often the battery is eaten by doubtful applications
from not less doubtful authors. Now users do not need to care for it. With receipt of two new modes — Doze Mode and App Standby — the operating system blocks oxygen to all excessively gluttonous applications. Doze Mode is the mode into which pass all devices to Android Marshmallow OS later certain time of lack of activity and without charging. And the second new mode is App Standby — automatic deprivation of access to resources of the device of all applications which were not used long ago. It is important to developers to consider changes in work of the classes JobSheduler and SyncAdapter: upon transition to the new modes all current tasks are cancelled, and new are postponed until awakening. It is more than information here or here. Interesting diagram of transition to doze mode.
- Apache. For someone, and for someone not really, news about unavailability of Apache of packets in API 23 became. If you used it in the applications earlier, then now you should or refuse it, or to connect it separately.
- Safety of system by means of the system. A screen unblocking, work with the sensor for third-party applications regardless of model of the smartphone, purchase in Google Play shop and authorization on the websites by means of a fingerprint — all this in the world of Android became reality. In more detail.
Google Play Services
With new updating of services to version 8.4 at developers opportunities for use of the previous modules extended:
- Google Maps — an opportunity for work offline appeared. Besides, there was available implementation of cards on Wear devices.
- GCM. We pay your attention that the module for push-notifications was processed and if earlier you used WakefulBroadcastReceiver, it is recommended to pass to new architecture, details here.
Also a number of new modules was added to structure of Google Play Services:
- Google Fit API — exists the whole industry of fitness-applications which use different sensors of a device for data collection. Now it became simpler with the new module for work with sensors.
- Places API — appeared also now access to Addresses of Google (earlier access was possible only through API web). However we will notice that Google still did not implement support of laying of routes on Google Maps (Directions API).
- With other modules such as Google Drive, Mobile Vision API, Marshmallow Permissions, Application Measurement, Nearby Messaging and many others you will be able to examine here.
Libraries and frameworks
Updating of the most popular library for work with a network — Retrofit — to version 2.0 became very important. Meanwhile this version is in the status of beta, but it does not prevent developers to apply it actively. From the main changes: encapsulation of request in object of Call (allows to organize more flexible work, including canceling of request), splitting library into components, support of different converters and adapater and syntax sugar in the form of new summaries. In more detail — performance of Jake Warthon on Droidcon.
This year was also celebrated by the grandiose growth of popularity of a framework of RxJava in Android. This the library works in close cooperation with Retrofit and other libraries, for example with habr and many other things. Also many developers diligently rewrite standard functionality in reactive style: RxBinding, RxPermissions, RxLoader.
Also growth of popularity noted Dagger 2. Here it is worth mentioning its main differences with Dagger 1:
- Lack of a reflection that increased readability of the source code and increased performance.
- API for work with POJO.
- Validation of graphs at a compilation stage.
Dagger 2 + MVP.
The promised release of this language almost took place, actual version 1.0 Beta 4. Of course, there can sometimes be problems, including there are many complaints to compilation, but JetBrains actively works on it. And in the whole Kotlin it is already quite ready for use in fighting projects. In more detail here and here.
If previous year became some standardization in respect of design of interfaces, then the current year was filled with attempts to standardize application "interiors" — that is to provide such patterns by means of which it would be possible to develop universally applications. It was difficult to speak about some general architecture of Android-applications earlier, however now the majority of the companies already diligently implement practicians and approaches for use of the settled development patterns.
It at the same time both the most popular, and most disputable pattern. Popular — because it successfully allows to share business logic and elements of the interface that in turn provides convenience when testing. Disputable — because each developer has the opinion into the account of how to implement this pattern. You can look at some of its implementations article on Habré which tells about a linking of MVP and RxJava.
One more fashionable pattern which is actively used in WPF. It gained popularity in the world of Android thanks to development of Google — Data Binding. It should be noted that this library is still insufficient it is stable (has the status of beta). However, Google without doubts will lick it into shape therefore it is worth studying already now.
Android Studio 2.0
The end of the year was celebrated by one more significant event for developers — in November Android Studio 2.0 became available to all in Preview Channel. It is obvious that the provided functionality does this updating to the most significant of all:
- Instant Run. What many developers so long waited for. Now it is not necessary to deploit the application again every time after several lines of changes. Meanwhile it works not really steadily and only when using Gradle 2.0 alpha (which does not differ in stability too). Let's wait when Google stabilizes work what all of us will be inexpressibly glad to.
- New emulator. Each developer knows about the speed of the native Android Studio emulator, and there is nothing surprising that the majority prefers Genymotion. For certain such situation did not suit Google, and now in Android Studio we see the excellent emulator, with all necessary functionality: with the camera, GPS
and a blackjack.
- Also the command of Google paid enough attention to an assembly time of projects. On their assurances, in the new version projects gather twice quicker. Naturally, it cannot but please.
You can find more detailed information in the blog of developers.
In 2015 also there took place many worthy conferences, such as Google I/O and a set Droidcon-ov (from which Droidcon NYC is most of all selected).
Google I/O 2015
During Google I/O 2015 all attention of speakers was concentrated on new versions of operating systems and Google services therefore the main subjects of conference became: Android M updated Android Wear, Internet of Things, Google Now, Google Photos, offline-services, new tools for developers updated Google Cardboard. It is possible to look at the high-level overview on GT.
We already considered the majority of news separately, but it is worth mentioning something:
- Web experience. The main updating here – Custom Chrome Tabs. The problem which is solved by this tool consists in the following: more and more applications for Android anyway will use functions of the browser, and quite often when using this or that program you should switch constantly between it and a window of the browser with the tab opened by the application.
- Mobile payments. At last and Google provided the option of system of payments from the smartphone – Android Pay. To the smartphone with the NFC chip the cash card is linked, and users can pay off with the device in those places where for payment accept Android Pay.
- Google Maps and YouTube offline. Now in Google Maps in the absence of Internet connection you will be able not just to browse the map of the area which was loaded in advance, but also to use search, to see POI and even to involve navigation with voice hints. It is valid what users of Google Maps very long waited for.
This conference was noted by a large number of the reports devoted to development and there is nothing surprising that it enjoys deserved popularity. It is enough even to look at program to remain there for a long time. Of course, it is necessary to select reports of Simple HTTP with Retrofit 2, Detect all memory leaks with LeakCanary, Fresco: How Facebook saved a century a day, Kotlin: New Hope in a Java 6 Wasteland and many others.
Android Dev Summit
At this conference we saw many interesting reports on the hottest topics from which it is especially possible to select the following:
- Fight against Android 6.0: App Standby vs. Doze: Understanding System Sleep, "Mother, May I?" Asking for Permissions and Keep it SecretKeep it Safe and
- Support Library: Guts and Glory
- Android Testing
- Android Application Architecture
- Data Binding — Write Apps Faster
That waits for us in 2016
More and more projects will be undoubtedly developed in reactive style with use of RxJava. Also many companies and developers will try to adhere to such patterns as MVP and MVVM thanks to which besides growth of a covering tests as it becomes more available and less costly is expected (especially taking into account the last frameworks for testing).
It is worth expecting potentially new solutions in work with databases as the existing libraries still have many shortcomings.
Still we hope to approach dream of minSdkVersion 19 (and maybe 21).
And of course, every year development for Android becomes more and more interesting so we will believe that 2016 will bring to all of us still big new ideas and solutions.
First of all it would be desirable to thank all active participants of new community Android of developers who helped with writing of this article. It would be desirable to thank some separately: atetc iamtodor nexus700120
This article is a translation of the original post at habrahabr.ru/post/274223/
If you have any questions regarding the material covered in the article above, please, contact the original author of the post.
If you have any complaints about this article or you want this article to be deleted, please, drop an email here: email@example.com.
We believe that the knowledge, which is available at the most popular Russian IT blog habrahabr.ru, should be accessed by everyone, even though it is poorly translated.
Shared knowledge makes the world better.