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! |
<<: Why You Should Try Full Stack
For people who want to lose weight, the most frus...
The heart-wrenching copywriting creativity only s...
Why is it that with the same budget, the final re...
I know it's a weird blog title to use a negat...
According to statistics, the current number of sm...
An unforgettable olfactory experience What does s...
William Bernbach, a famous advertising guru, once...
In the past two years, following the trend of var...
The trend of the mobile Internet era is irreversi...
Wenchang Pagoda is the most commonly used ritual ...
According to the latest data from AutoForecast So...
Eat a delicious chicken leg! Who can resist the t...
Mixed Knowledge Specially designed to cure confus...
Training course content: A minimalist introductio...
Reviewer: Zhang Yuhong, Chief Physician, Departme...