Wake up, Android developers actually only cv most comfortable, what you will?

As an Android developer, you now have developed many years?

The quality of your code there with experience and improve? If not, we need to reflect on.

Now share an experience in Android development for six years, what we've gained?

First, the ability to learn
want to grow, learning ability is particularly important

We have been saying goes, learning is like rowing upstream. As we advanced Android, you need to learn more advanced content

1) Java language and the advanced technology related to Android kernel
as a generic, multi-threading, reflection, JVM, Java IO, annotations, serialization, etc.

2) App development framework Knowledge System (app also objects)
Android 2013 ~ 2016 years of technology, online Copy the code we got used
to this often "use" code familiar and unfamiliar: the familiar is almost every day and deal with them, copy the code every day; strange that although every day and deal with these codes, has never been studied in depth the principles of the code, the connotation deep code.

We need a new perspective to analyze the knowledge, in-depth study them, to learn the source code, source code imitate, then hook source code,

So as to say that they understand this knowledge. These are doing Android development, a senior engineer of the foundation.
3) 360 ° Android app full tuning
writing code for good performance, and then tune

4) Android cutting-edge technology
such as hot upgrades, hot fixes, App Instant, update, component-based routing architecture Arouter, RxJava, IOC architecture approach, Hook technology,
these technologies you can not only use, you need to know his principles

5) NDK module development
NDK, which is about the C / C ++, jni, Linux is the foundation to learn, in addition to audio and video codec technology, streaming media protocols, ffmpeg audio and video which are essential skills development and OpenCV / OpenGl / image processing which is necessary knowledge

6) improve the development efficiency of the use of tools
you want to improve the efficiency of development, need to use tools, this below said lower

7) Mobile architect thematic project combat aspects of
learning technology will require a combination of combat training project

8) does not move architect learning micro-channel applet

9) mixed-use development Flutter
Flutter now has gradually become the mainstream of mixed development framework, in addition due to the strong presence of Ali, and Ali lead companies are using Weex hybrid architecture, which is an Android engineer broaden their horizons and will into the future basic skills essential

Second, take advantage of Studio Android
Android Studio provides the fastest tools to build applications for each type of Android device. 

Unfortunately, we have only explored a small part of the IDE. Android Studio comes with many tools, the following are the tools we use in our daily development.

Visual Layout Editor In this Layout Editor, we can design a UI element onto the visual editor, and in order to quickly build the layout, while eliminating the need to manually write the layout XML.

This can preview the layout design editor on a variety of Android devices and versions, but you can also dynamically adjust the size of the layout, in order to ensure normal work on various screen sizes. When you use this Layout Editor to build a new layout, in particular, you can feel the power of it.

APK Analyzer we can use APK Analyzer reduce the time spent debugging applications within DEX files and resources, but also reduce the size of your APK.

In addition, you can also use the APK Analyzer from the command line. APK Analyzer features include:

  • View APK files in absolute size and relative sizes, such as Android DEX and resource files.

  • Understand the composition of DEX files.

  • Side by side comparison of the two APK.

Wake up, Android developers actually only cv most comfortable, what you will?

Fast Emulator If you need to deal with various versions of Android, but also want to test your application on a variety of API level, then this simulator even better than the real equipment.

The simulator provides all the features included in Android devices. You can simulate phone calls and send text messages, specify the location of the device to simulate different network speeds, rotation, and other analog sensor hardware, visit the Google application store, and so on.

Compared with tests on physical devices, to some extent, the test application in the emulator faster and more convenient.

Profilers Android Profiler tool provides real-time data, can help you understand how apps use your CPU, memory, network and battery resources.
Wake up, Android developers actually only cv most comfortable, what you will?

Although we have all kinds of analyzers, analyzers such as CPU, memory analyzer, network analyzer and energy analyzer. But Android Profiler is compatible with Android 5.0 (API level 21) and later.

You can use Android Studio Advanced Profiler to monitor the consumption of CPU resources and memory status of the application session. Memory profiler can help us use Leak Canary debugging memory leaks.

Third, build configuration change

You can use the build changes create different versions of your applications, you can also manage dependencies and signature configured correctly. Most organizations have a test and production environments.

If you want to build a different application for each environment, you can use different types of different build to specify the basic URL.

Wake up, Android developers actually only cv most comfortable, what you will?
You can also change according to API level or other equipment to build different versions of applications for different devices

Fourth, the use of code improved Lint Checks

The lint tool can help you find bad structure of the code, and the code may affect the reliability and efficiency of the application.

Lint will tell you whether there is a name space take up a lot of space layout.

它还告诉你其他结构性的问题,例如使用了弃用的元素或目标API版本不支持的API调用。

它还会建议你使用所有库的最新版本。使用新的 SparseArray<String>(...) 代替 HashMap,可以获得更好的性能。SparseArrays 会将整数映射到对象。

与普通的对象数组不同,下标间可能存在间隙。它比使用 HashMap 将整数映射成对象的效率更高。

五,测试应用程序

测试驱动的开发(TDD)是确保你会测试每一行新代码的一种方法。

如果采用这种方式,那么在编写要实现的代码之前,你需要为添加的内容编写测试。由于时间和资源有限,大多数创业公司可能不会采用测试驱动的开发环境。但是它已被许多公司广泛接受。

Wake up, Android developers actually only cv most comfortable, what you will?
Android 有三种类型的测试。
1.单元测试单元测试用于测试方法和小模块。无需模拟器或真实设备即可运行这些测试,因为它们可以在JVM上运行。JUnit 和 Robolectric 是流行的 Android 单元测试框架,可以在JVM上快速运行测试。

2. 设备测试设备测试依赖于Android 框架。由于这种依赖性,你需要模拟器或物理设备才能运行这种测试。我们使用 Mockito 模拟设备测试中使用的对象。

3. UI测试我们可以利用UI测试活动的启动是否正确,或视图的存在是否正确。Espresso和UI Automater 是UI测试中广泛使用的工具。以下是应用当前所包含测试的软件包结构。

Wake up, Android developers actually only cv most comfortable, what you will?

Test:单元测试都保存在这个文件夹中。这些测试在JVM上运行,不需要 Android 设备或模拟器。

Android test:所有设备和UI测试都保存在这个文件夹中。这些测试需要 Android 物理设备或模拟器才能运行。

六,使用版本控制

Git 和 BitBucket 是最常用的版本控制系统。

版本控制可以跟踪文件的改动,可以记录完成的操作,并且可以根据需要恢复特定版本。

但给你与团队一起工作时,版本控制有利于协作,而且还可以将所有的更改合并到源代码中。如果没有版本控制,则你需要进行备份,并将代码存储到安全的地方。

有了Git以后,代码就安全了。你可以跟踪更改,还可以针对某次发布维护多个代码库。它可以简化两个人一起工作时合并代码的工作。此外,你也可以利用Git展示你的工作,并向许多开源项目贡献代码。

Git已成为许多公司筛选人才的地方,因为他们可以通过Git查看候选人的工作成果和个人项目。

七,发布产品的知识
无论你是否是将新版本发布到生产环境的主要负责人,我都建议你掌握将应用发布到应用商店的方法。

掌握使用密钥存储文件对APK进行签名的方法。记下你的密钥库密码和别名。

你甚至可以在Gradle文件中配置它们,以简化签名过程。

八,使用 Crashlytics

Crashlytics 是最强大,最轻便的应用崩溃报告解决方案。

Crashlytics 提供了深刻且可付诸行动的见解,甚至包括应用崩溃时确切的代码行号。

你可以使用 crashlytics 来减少识别故障和修复故障的时间。

此外,它还提供了各种分析报告,例如出现频率最高的崩溃,崩溃百分比等等。

Crashlytics 还包括 Crashlytics Beta,该服务可以让你轻松地将预发行的 iOS 和 Android 应用分发给测试人员,以便快速获得反馈。

九,选择正确的架构
如果你是从头开始开发应用程序,那么就会有许多优势。其中之一就是选择正确的体系结构。

通常,我们喜欢将所有内容都写在同一个activity文件中,因为这样做很容易。

但是,当你的代码量增多时,这就会成问题。你的代码库会变得十分庞大,每个文件包含的代码行数也会非常庞大。考虑到代码的性能和维护,在早期阶段选择正确的体系结构,才是明智的做法。

Many architecture MVC, MVP, MVVM and MVI and other help Android developers to easily maintain, test and develop new features.
Wake up, Android developers actually only cv most comfortable, what you will?
The figure illustrates the After designing the application, all modules should be how to interact with each other. Although it all depends on your organization, but you may also have the opportunity to choose the architecture for your application. However, we strongly recommend that you select a specific architecture to fit your needs. The best architecture on which this topic is controversial.

According Developer's Guide: "There is no method to write out the best in each case applicable to applications Having said that, for the most part and workflow, this recommendation is a good architecture. starting point.

Ten, learning ability
as an Android developer, after reading too wish to give you some inspiration, like the way a point to give me encouragement, I would often share concerns.

Do you have any experience, you can also share in the text, after all, we are a lot of open-source programmers, many hands make light.

After reading a lot of friends ask me learning content, then I have to share a wave, more content, first we look at the map released

Learn more concerned about me, private letters to send Andrews

Wake up, Android developers actually only cv most comfortable, what you will?

Wake up, Android developers actually only cv most comfortable, what you will?

Wake up, Android developers actually only cv most comfortable, what you will?

Guess you like

Origin blog.51cto.com/14606040/2460816