From September 25 to September 27, DroidCon, the largest Eurasian conference for Android developers, was held in Moscow. Guests and speakers gathered at the Mail.ru office, which occupies one of the 27-storey towers of the business center. The conference itself lasted for three days, and the program of performances of each day was designed for different target audiences.


')
Tech day
The first and most interesting day. In order to register, it was necessary to pass a simple test that cut off people who are not directly related to Android-development. Two halls were opened - a cinema and a meeting room, in which reports were read in parallel.
Bussines day
On the second day, anyone could get to the conference, which led to an influx of a huge number of people, but the Mail.ru office could accommodate them all. Three halls were opened - the Atrium, the Cinema and the meeting room. Also on this day, opened an exhibition of various new products, one way or another related to Android. The exhibition lasted two days.
Sony showed TVs with the usual Android and told how to develop for them using conventional smartphones and special Android images created for the company's products. With the usual PS4 joystick, you could play Asphalt and win the new Sony Xperia Z5. To do this, it was necessary to pass the course for the best time during the day. Then they took the best players and held a match between them. ES Explorer looks very strange on a 40-inch screen :)
Epson showed off her augmented reality glasses. Of the minuses can be noted the following:
- the glasses are pretty bulky
- you need to carry around a “phone without a screen” that replaces the touchpad,
- outdated Android. Version 4.0.4 was on the demonstration device, but a company representative promised to upgrade to 5, and even 6.
Intel introduced a new hardware for watches, phones and tablets, which were made based on the Intel Atom x3 processor. We spent hours drawing with all the fashionable things, like sleep trackers, pulse sensors, etc.
3D.RU : their site had little to do with Android. They demonstrated the capabilities of 3D printing and talked about technologies that are now actively used in this area.

Voximplant talked about their development. Key product features:
- cheap calls
- the ability to call from any device to any device, including a regular phone, a page in the browser, etc.,
- Available native SDK for Android and iOS,
- SDK is available for React Native for Android and iOS,
- video conference.
Community day

Visitors were the least. Three halls were opened - the Atrium, the Cinema and the meeting room. Workshops, democamps and barcamps were held on this day.
Workshops : these are reports that involve the active participation of the hall. The speaker tells how to introduce a new technology and what needs to be done for this, students at this time try to introduce it into the project, and if something does not work, then the speaker helps to solve the problem.
DemoCamp : various startups were given two minutes to present their project. Further, the jury spoke and gave their advice on how to improve the project.
BarCamp : on the second day of the conference, participants were asked to write topics of interest on the wall in the meeting room with a marker. And the next day, holivars were arranged if there were both opponents and supporters of this topic.
During the conference, we attended the following reports:
Secrets of success on Google Play
Alexey Kokin began his report with general statistics about Google Play. The report was divided into three parts:
- New features in Google Play.
- New sections of Android for family and Android for kids.
- New section for corporate users of Google Play for work. The managers have the opportunity to install applications to their employees.
- The page with developer applications has changed. Now there is an opportunity to customize it a bit.
- Cloud test lab: the ability to test applications remotely on a large number of devices.
- There was an advertisement in Google Play itself. Now the search result will contain one promotional offer.
- Now you can find out where the user came from, where he learned about your application.
- Now you can test metadata.
- Payment for applications by means of a mobile operator (without using a bank card).
- Development of first-class applications. A company representative said that each application has a parameter that is visible only to Google employees. By this parameter, the system evaluates the application hosted on Google Play. It depends on the quality of the application, the design, the use of the new API, the support of the new SDK and various devices. This setting determines whether you get the Top developer badge and whether your application will be honored.
- Application growth.
- It is extremely dependent on the localization of metadata in Google Play and the localization of the price of the application. It is recommended to avoid automatic conversion and set the price without decimal separator. Also, it became possible to set the price for an application for less than $ 1, but so far in beta testing mode and only in India.
- It is recommended to use subscriptions as a means of monetizing the application.
The release of Android M is ready!
Denis Neklyudov told how to make existing applications compatible with Android M. The speaker also reported on the main innovations in Android M that will affect developers. Major changes:
- Runtime permission. Google redesigned permissions in Android. Now the user can manage permissions through the application settings. During installation, only the most necessary of them will be requested, and when executing code that requires a particular permission, it is necessary to check whether it was given. If not, request. The speaker advised to explain to the user why you need this permission and to be prepared for the fact that the user does not agree to give it.
- Doze. Google has proposed a new energy saving system. Now, after the device goes to sleep, many processes will be blocked. In Doze mode:
- network access is blocked,
- WackLockes are ignored,
- Sync Adapters are prohibited,
- JobScheduler is not allowed,
- AlarmManager works only partially.
In Doze mode, voice calls and push notifications are possible. Also, applications will be given a window of some duration in which they can do something important. In ADB added the ability to test the new mode. If necessary, you can add applications to the White list, this will give them the opportunity to work in the Doze mode. An application can get into the White list only if the user adds it there. - Apache HTTP Client is excluded from the SDK. If it is necessary for the application, then it can be connected as a library. Instead, it proposes using HttpUrlConnection.
- Managing Wi-Fi-network is possible only if it was connected by the application.
- When searching, you cannot get the MAC addresses of Bluetooth and Wi-Fi. The WifiInfo.getMacAddress () and Bluetooth.getAddress () methods will always return 02: 00: 00: 00: 00: 00.

Google App Indexing
Timur Akhmetgareyev told about one more way of application interaction. Google App Indexing itself offers several interaction options:
- In the search results Google. Now if your application can display information on a user query, then it will be displayed first in the search results.
- Tips on entering a query. If the user has already passed to your application by a similar request, then in the tooltip it will be displayed last.
- Some feature in the form of carousel from apps on Google Play that can handle a user's request.
To use this technology, Google requires:
- When you click the back button in the application, return to the search results (optional, but strongly recommended to ensure a good UX).
- Immediately open the requested content.
- Provide free access to the requested content (otherwise Google will not be able to index it).
- Enable search console for the site.
- Specify the site in the Developer Console.
- Do not abuse this technology.
This Build should do 3 things: build, check and deploy.
Kirill Kharkiv spoke about his experience in using Gradle-build applications.
First, he set up a team with Git:
- Git flow is an ideology in which for each change a separate branch is created in the repository. Upon completion, it is merged with the main development branch, and then from it is already merged with the master branch. This ideology is recommended to use in any project.
- Use Branch updater. When uploading to a development branch, all changes are pulled into its child branches. This is necessary to minimize conflicts when merging after the feature is completed.
Next, Cyril told about the build-script on the example of their project. The assembly collects three different applications (each has its own package, resources, etc.), which can be simultaneously installed on one device. It is implemented through flavors. There are also 8 different buildType (usually two):
- Debug
- Release
- Alpha
- Branch
- Beta
- Corp beta
- Unit test
- UI Test
After running the full build, 24 different apk-files are obtained. They differ in application settings, resources, tests, disconnection, or those or other features.
For example:
- Analytics for the debug version is not needed.
- Logs in the release version are not needed.
- Any kind of prefetcher is not needed for unit testing.
Resource utilization is also quite an interesting idea. The problem is that some resources can be used in Appendix A, some in B, and some of the resources can be used in several applications at once. The following folder structure is proposed:
- res - common files for all applications.
- res_a - resources that are intended only for application A.
- res_ab - shared resources for both applications.
But there is a problem here. Since resources for application A will be formed from res + res_a + res_ab, resource identifier conflicts are possible, this should be closely monitored.
In addition, Cyril made recommendations on the use of static analyzers. The point is to write the rules for the same lint-a as far as code review. In the future, it will help to spend less time on code analysis and will guarantee compliance with the overall code style throughout the application.
Also, the speaker briefed on the new Test Support Library. According to the author, now you can use all the convenient solutions without having to select one specific framework. An example is push testing.
The final build phase is deployment. In the example given during the presentation, the build itself is deployed at different sites: Google Play, Hockey App, social networks, forums, corporate sites, etc.

Dagger2: practical educational program for working with daggers
The author of the report is Dmitry Polishchuk, developer of the Yandex.Taxi Android client. The presentation was devoted to the basics of Dependency Injection, used to reduce code connectivity. An example was considered with the Network Client, this class is often used throughout the application. Usually, when developing, we either create a new instance every time, or use singletone. We also encounter problems when we need to have different variations of the Network Client in the same application. For example, when our backend is not ready and we need to use mock'i.
Or to test the correct response of our code to certain responses from the API. As the author said, with this approach we have a snowball of strongly connected code, monolithic application code and obviously and not explicitly related code.
Problems using singletone:
- Strong dependence on the singletones themselves.
- Few opportunities to reuse code. The fact is that when reusing a code, you have to pull all dependencies along.
When using Dependency Injection, the dependencies do not know anything about the parent. This allows you to make the code modular, which, in turn, removes connectivity and simplifies code reuse.
To use this technology you need:
- Move reused code to modules.
- In the classes that use it, create a field and annotate
@Inject.
- Create an interface with all the classes in which
@Inject-.
will be used @Inject-.
The main advantages of Degger2 over other libraries for Dependency Injection:
- Using code generation The generated code remains readable.
- There is a plugin for Android Studio to jump on injection dependencies.
- A working obfuscation remains, without additional intervention in the proguard configs.
- The complete lack of reflection.
- Errors come up at compile time, not at run time.
Data Binding and Custom Views
In this lecture, we expected to hear about a novelty from Google - Data Binding, which allows you to fill the screen with regular Pojo-objects by specifying directly in XML which fields and where should be recorded. The technology also allows you to create handlers for actions and even execute small pieces of code written in XML.
The author turned out to be an opponent of this technology, arguing it this way:
- Quite a specific syntax. In fact, the syntax is not specific, simply because of the limitations of XML, it is necessary to use their codes instead of special characters.
- If during the development there was a need to first make the design of the application, and then screw the logic, then the programmer will still need to go into the markup files. Those. The display logic is in several places, and not in one. This somewhat complicates many processes, such as code review, refactoring, and development in general.
Instead, the author talked about his understanding of the MVVM pattern (Model-view-view Model). Using observers and custom views, you can implement the logic for filling types with data. The views are obtained completely self-sufficient, due to which we have a very unloading activity or fragment. It significantly reduces the amount of code.
Android SDK. Is the game worth the candle
In the autumn of this year, the release of Android Studio with NDK support finally took place. Part of the lecture was devoted just to this topic.
The report was divided into questions:
- Why use NDK.
- Parts of the application where performance is critical. Work with audio, video, pattern recognition and game writing. Since in Java and Android there is such a thing as heap size, the processing of the same video becomes a very big problem. It is solved with the help of NDK.
- Use already written libraries. Again, an example of video processing: there is a very popular ffmpeg library, most Android developers think about it when it comes to video integration.
- One code on multiple platforms. Quite an interesting approach, but requiring knowledge of the C / C ++ programmer. This offers many advantages: only one test is needed, the code will behave the same on all planned platforms. Before the release of the new Android Studio, this feature was hard to implement, because the process of integration, debugging, and working with native code as a whole was very laborious, which negated all the advantages of this approach.
- The mechanism of work.
- JDK is a set of tools for running native Java code.
- NDK is a toolkit for using JNI in Android.
- In the APK put so-files compiled under a specific platform.
- The application can be fully implemented on the native code, but it is very rarely advisable.
- Experimental Gradle plugin. Its features:
- NDK integration.
- Debugging native code.
- Refactoring (renaming in native code and in Java).
Not yet supported:
- Integration with external build systems.
- Build static libraries.
- Pure NDK modules.
- Performance.
- Google itself recommends using NDK only when you can't do without it. There is such a thing as Overhead. The time to call a native method is much longer than calling a Java method from Java code. It is necessary to minimize the number of calls to native methods.
- It is possible to use different compilers. For example, code compiled by the Intel compiler will show better performance on an x86 processor.
- Where to look for problems and how to deal with them.
- Be sure to free the memory allocated in the native code, and be sure to reset the listeners passed to the native methods.
- It is important to understand the difference between local and global links. The lifetime of local references is until the method ends. Global lifetime - until they are clearly not released.
- The number of local links is limited, they also need to be released if they are no longer used.
- By default, the garbage collector does not touch the native code. If it has a global reference to a Java object, then it will not be cleared until someone explicitly does. That is, we get two faces of memory from Java and from the NDK.
- Get less from native code in Java and back.
Native threads also have their own specifics:
- Local links are never cleared by themselves.
- The method for searching JNI classes does not work. Solution: cache classes or class loader during initialization.
- Crashes in native code. They usually bring a lot of problems, since we will most likely have a short-informative log, or it may not exist at all. To solve this problem several libraries have been written:
- Coffecatch - problem integration into the application.
- Breakpad - inconvenient integration, because very little documentation.
- Breakpad wrappers such as Crashlitics, Hockey App, etc.
- APK size and use Apk Splits to solve the problem of large apk-files. By default, when building an application, the APK contains libraries for all platforms. Accordingly, the application significantly increases in size. This problem can be solved with the help of Gradle, by describing splits with indication of a different versionCode for each platform.

Nearby: new interaction opportunities near
The possibility of interaction between the two devices appeared in Android 4.0. This technology was called Wi-Fi P2P, the interaction was carried out via Wi-Fi. Then came Network Service Security. It used Multicast DNS and DNS-SD. The technology allowed to avoid interaction at a low level, but there were problems with the need to maintain a permanent connection.
Nearby is a library in Google Play Services that solves the problem of interaction in rather interesting ways. The library itself consists of two parts:
- Nearby Connections API. It appeared in early 2015 and allows devices to connect over a local network. For example, for co-editing files, for games over a local network, or for games on several screens, when one device is used for control, and the second for displaying the game itself.
There are two types of devices - hosts and clients. On one device, we create a server, while others connect as clients.
After establishing a connection using the Connection API, you can send messages. They are of two types:
- Messages with guaranteed delivery. Their transfer takes more time, so it is advisable to use them only when it is impossible to prevent data loss.
- Messages without guaranteed delivery. They are good to use when streaming audio / video.
Advantages of this technology:
- The ability to provide a good UX.
- No internet connection required.
- Low latency.
- A large number of supported devices.
- Easy integration.
- Support reliable and unreliable messages.
- The ability to simultaneously be a server and a client.
- Ability to connect multiple clients.
Disadvantages:
- Devices must be on the same local network.
- It is necessary to take into account that the devices can be far enough (the main thing is to be in the same local network).
- Ability to intercept data in unprotected networks.
- Nearby Messages API. The technology appeared in September 2015. This is another way to solve the problem of transferring information between devices by sending broadcast messages over a short distance.
The main disadvantage of technology: the data does not go from device to device, but through the Google cloud service. First, there is a request to the cloud to receive the token, then with its help the data is sent to the cloud, and then a broadcast request is sent to other devices 3-5 meters from the sending device. The token is transmitted via Bluetooth, Wi-Fi or ultrasound. At the last, the author drew attention. Ultrasound token transfer is a key feature of this library. Sound is not heard for people and most devices support this technology. Data is sent cyclically with a period of 3 seconds and a pause of 1 second between cycles.
Recommendations for use:
- Do not transmit anything secret, even in encrypted form.
- Give the user a clear understanding of what he is sending.
- Add an explicit button on / off Nearby.
- Please note that the use of this technology greatly reduces the battery charge.
- Use the new permissions system.
The main disadvantage of technology is the small size of the message - three kilobytes.
Clean Architecture and MVP
Using the logical breakdown of the code into peculiar layers, the congestion of activity and fragments is reduced. It also solves the problem of reusing the code due to strong dependency. The pattern itself implies a breakdown of the entire application into three modules, which are weakly interconnected:
- Model - here is stored the logic of receiving data.
- View - implements the logic of displaying data.
- Presenter - this module manages all the processes associated with receiving, processing and displaying data. A good practice is to embed them in view through Dependency Injection.
Advantages of using this pattern:
- Modularity.
- Ease of testing.
- Weak connectivity
- Easy labor distribution during development.
- Easy reuse code.
- You can additionally use many other patterns.
The author during the report stressed that the MVP pattern is understood by everyone in different ways.
#Beyond Install. User Acquisition & App re-engagement @Twitter
This report discussed the feasibility and impact of adding social networks to your application in general, and Twitter in particular. Suppose we have a game in which we can reach a certain level. If you give the user the opportunity to publish his achievement on Twitter, then his followers will see a tweet like "I scored 500 points in the # such and such game." You can also add a picture so that subscribers are more likely to pay attention to this tweet.
After they saw him, there is some chance that the game will interest them. This way you can receive more and more new users who will be coming because of the tweets of satisfied players. It also gives us some free features.
The report also talked about Twitter’s paid features as a platform for customizing its application. The problem is that the user is likely to find out about your application from another user's tweet, and not from an advertisement. And, accordingly, it is more likely to install it. Therefore, thanks to the well-thought-out system of rewards and UX, you can get a pretty good promotion of your application without much effort.
Facebook for Android: Developing mobile applications for slow and congested networks
The author of the report did not go deep into the subtleties of implementation, rather stressed that their client works well in slow networks. For this, they:
- Well thought out the process of starting and canceling the request.
- Use progressive scan of images (visually it seems that the image loads faster).
- They try to predict user actions and load data in advance.
Much attention was paid to testing applications. Of the key features, I remembered that they sent developers and testers to different countries, where they had to communicate with users on the topic of UX to make the application better.
During these trips, it was found out how the target audience of a country is using the application, and on the basis of these data the application has been refined.
It was told about an interesting approach to fixing bugs and crashes. Facebook collected statistics on all Android devices (of which there are more than 20,000) and concluded that, in development, it is often not necessary to have all devices. They divided all devices into 4 main groups according to the year of production and filling of the device.
And the phone, released in 2015, could easily get into the group of 2013 due to the fact that for the first time a device with similar characteristics appeared in 2013. From all this, it was concluded: each developer only needs to issue 4 devices on which and for which he can develop. It is assumed that if the application works normally on the phone released in 2013, then it should work on all devices from this group too.
Using the low-level multimedia API in Android
The developer of the official mobile client VKontakte talked about what problems there are now when using the current API, and how to solve them:
- There are different implementations of the MediaPlayer class, depending on the device manufacturer. For example, in some cases, an audio file may not be loaded sequentially, but by random parts.
- The scarcity of features MediaPlayer.
- As a consequence of the first two problems - the impossibility of caching data.
- The inability to connect different codecs.
- The inability to catch errors associated with a bad connection.
There are such problems when playing both audio and video.
The problem of caching could be solved by raising the local proxy server, but then there remains the problem of different implementations of MediaPlayer.
Recently, Google introduced ExoPlayer - a framework for working with media files. For audio, it has three levels:
- MediaExtractor - deals with networking, buffering and sharing.
- MediaCodec - unpacking media.
- AudioTrack - inference.
VKontakte implemented its MediaExtractor, which also allows you to cache data. Customization allows you to:
- Use OkHTTP as a means of interacting with the network.
- Implement the ability to resume.
- Predict buffering.
- Reevaluate links when changing IP.
Previously, the video was very bad, especially if you had to play files with unsupported codecs out of the box. Has the situation improved with the release of ExoPlayer? again, due to the possibility of customizing the MediaExctractor. VKontakte can now reduce the video size by changing the resolution. This can be useful, for example, when downloading videos, for which quality does not play a significant role.
Learn to accelerate - hardware acceleration in Android

Israeli developer Royi Benyossef talked about hardware acceleration in Android.
What it gives us:
- Great opportunities for the implementation of the interface.
- Smoother animation.
- Reducing the load on RAM and CPU.
Hardware acceleration for drawing and calculations uses a GPU, which is much faster than a bunch of CPU and RAM. Due to this, we get better performance than using software acceleration.
Hardware acceleration for the first time became available for developers from version 11 of the API. Starting with version 14, it is enabled by default for all components.
When developing it is necessary:
- Reduce the amount of view. The fewer they are, the less layers need to be updated.
- Use thumbnails of images. No need to draw an image that is several times the size of the screen.
- Manage blending and deleting layers.
- Monitor transparent pixels in pictures.
- Never create objects in the
onDraw().
method onDraw().
- Avoid changing objects. For example, every change in bitmap entails reloading it into the GPU.
- Be careful when using transparency. You need to make sure that all views are rendered on hardware.
The report concluded with the following:
- The use of hardware acceleration is not always justified.
- Create only what you really need, and avoid creating in drawing methods.
- Analyze and adapt your custom view.
What should be the application to qualify for a feature on Google Play
Here it was told about the experience of feature for the Chaos Control application. In Google Play in all categories there are all kinds of tops, recommendations, thematic collections. A developer may have a Top Developer icon.
How do apps get into all of these ratings? Everything is very simple. To get there, you must:
- Develop the best applications using the capabilities of the latest SDKs.
- Implement the latest design guidelines.
The feature itself has several steps:
- Nomination of an application to be featured by someone from Google who works with the developer community.
- Passage application Quality Review.
- Changes to the application and its metadata on Google Play based on the results of the Quality Review.
- Repeat review and feature if all comments are eliminated.
In reality, this happens like this: somehow, a Google employee finds out about your application, say, heard at some of the conferences, or found it on Google Play. He then nominates him for a feature within Google. Reviewers are gathered and evaluate your application by the following criteria:
- Functionality and demand.
- Design.
- Use the latest chips Android SDK.
- Supports maximum number of devices. Special attention to tablets and wearable devices.
- Metadata in the description of Google Play: pictures, description, localization.
After evaluating the application by the reviewers, an e-mail will be sent to you, indicating all the points that must be eliminated in order to qualify for a feature.
After correcting all comments, you must write a response to the letter. Then there is a re-evaluation, and so on until all the comments are corrected. After this, Google starts putting your app in various tops.
But do not hope that you will write a great application, observing all the best practices, and guaranteed to get a feature. The application must grow and develop without hope of it. Fichering can only be perceived as an additional promotion, and not as the main one, since even comments and user ratings can play a role when nominating for fichering.Honey-Money (6.0): Android as an ideal ecosystem for corporate mobile applications
Corporate applications are those that are written to reduce or optimize costs in a company. Such an application does not have to be shared.Suppose we have a gas station repair company. There are masters who repair them, and there are operators who accept applications for repairs. Using a simple application, you can:- solve the problem of proper scheduling for the tanker,
- solve the problem of tracking repair performance status,
- view the repair history of a particular gas station for more accurate diagnostics.
Thanks to all this, you can save on:- Simple masters.
- Communication between the masters and operators.
- Loss of time with incorrectly compiled routes.
- Preventive expansion or reduction of the staff of masters on the basis of statistics of breakdowns in a particular region.
- Introduce online repair requests.
When writing such an application, you must strictly observe the following rules:- The application should really improve the performance of the company.
- The application should be as simple as possible.
- The application must have a good UX for a specific user.
For example, an application for the same master should be understandable and, if possible, be able to control using voice, gestures, eye movements, etc.Conclusion
In conclusion, I would like to note the usefulness of such events. Thanks to the conference, we have been enriched with knowledge of how the development process in other companies is organized, what technologies they use, what rakes have come, what progress they have achieved. We also learned how certain development teams organize their work. Such information helps in future projects, because it is better to learn from the mistakes of others. Due to the variety of materials and the skill of the speakers, the conference motivated to learn, which is also important.