1. Project Structure The MVP model is becoming more and more popular nowadays. It is adopted by default.
If the project is large, the above method will definitely result in nearly a hundred files in the presenter and view. See the blind series. The following methods are recommended:
2. Configure the theme Ignore this step for projects that do not adhere to Material Design. 1. First write the required color in color.xml:
Note that color.xml is a color table. It should describe colors instead of defining font colors, background colors, etc. This can prevent similar colors from being defined repeatedly, which would lead to inconsistent interface colors. 2. Define the theme in style.xml:
In the res directory, create a values-v21 directory and then create a style.xml:
Then modify the theme attribute of application in the AndroidManifest.xml file to the AppTheme defined above to achieve the immersive status bar. Then refer to my other two blogs for detailed settings of Theme and Toolbar: 3. Dependent libraries and SDK Required libraries: Here are some libraries I wrote. If you have any suggestions, please feel free to communicate: I have tried many, and these are the ones I use most often. After relying on a lot of libraries and SDKs, it is recommended to initialize them at the right time, rather than piling them all in the onCreate() of Application. This will cause the startup time to be too long and the startup will be slow, although it will not affect the normal use of the functions. 4. Configure Gradle Some SDKs need to check whether the signature is correct when running. Therefore, you must sign with the official KEY in debug mode. It is not a wise idea to put the signature into version control. Therefore, the following approach is recommended:
Create a new signing.properties file in the same directory as the app's gradle file and fill in the corresponding information of your key
Add signing.properties to the ignored directory. 5. Establish development specifications In order to avoid different styles of code written in collaborative development, or multiple development modes are made. The following is an example. After all, it is formulated for efficient development. The one that suits your project is the best. layout naming, for example id naming, example Variable naming: Start with m. For example, mAdapter, when you use it, all the methods will come out after pressing one m. Method naming: It is better to write a good comment than a good name. = =. TextView uses the official standard font TextView.png
Button uses the Material Design standard style Button.png
Determine how to write network requests, how and where to store files, and how to use the class library framework used in the project. Okay, let’s start the official development! |
<<: What knowledge do you need to learn to be a programmer?
On May 30, payload specialist Gui Haichao flew to...
Recently, many places have held theme activities t...
On January 18, the American website medium.com pu...
What kind of platform is Zhihu? To study traffic ...
I have seen people ask why elements have no consc...
Popularize science and spread science to the publ...
With the advent of 5G in 2019, short videos, as t...
The most troublesome thing about operating a WeCh...
In the field of mobile application development, R...
Feng Xueying's baby massage course resources ...
The user life cycle of each product is a process ...
“ A universal and recognized indicator dictionary...
Preface This article mainly introduces some small...
"Little Red Book" is an emerging cross-...
Taking Ouyeel Cloud Commerce’s B2B growth practic...