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
Ford recently said that the cumulative orders for...
How to manage well and enhance the core competiti...
【Halal Date Paste Mooncake】 raw material: Crust: ...
Super users are users who are willing to pay for ...
As the size of public accounts grows, with the in...
Since the opening of the Winter Olympics, all com...
Many people feel that they are getting older, so ...
Now more and more people love to play Tik Tok. “W...
Recently, a video of a Tibetan brown bear chargin...
Being able to organize a perfect hit event is def...
[[410960]] July 13 news Google held a game develo...
[[151069]] Large companies October 3: Google offi...
[[313780]] On February 3, on the first day of wor...
A few days ago, I wrote an article about transsex...
How to spend less money? When we talked about bra...