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?
This article is a simple popular science about br...
2016 was the first year of the VR industry. Inter...
In the vast natural world, there is a kind of bea...
The Juyi Thinking Collection Course, Instructor: ...
Tencent has brought bad news to the entire Chines...
The Qixi Festival, a festival for begging for cle...
With the development of mobile Internet, many res...
There is no clear definition of operation and spe...
User behavior data is a foundation that can help ...
The operation of many public accounts has become ...
[[210174]] Today, when I was browsing Zhihu, I sa...
On the afternoon of December 16, 2023, accompanie...
62 films directed by Tsui Hark (1979-2018) HD col...
199it News July 5, 2017, is perhaps the most impo...
Popular Science Times reporter Chen Jie This is n...