A busy time ago, always want to take a time to write a blog, and then dragged to the present, really feel a little guilty ...
This period of time to buy a few books are looking, want to let oneself sink down, and go to MU class net to see some video, really found that they have left a lot of knowledge points, or a little harvest,
Therefore, in this appeal, dry our line, need to continue to learn, only in learning, to understand how much water they have, to make themselves constantly become stronger!
OK, get to the point, this time to prepare some very basic things, but also very important things, for our actual development really helpful
Knowledge Point one: The role of using basefragment/baseactivity: Abstraction to the parent class of thinking patterns
Knowledge Point two: fragment switch and the way to switch
Knowledge Point III: Project structure and naming conventions
The above three points of knowledge can be reflected in the following code
First, create a new Android application project
Then create some files and the package name, the project structure is as follows:
Activity package name strictly into the activity class, and, all inherit from Baseactivity, for abstract to the parent class of thinking mode can help us save a lot of code, use Baseactivity and Basefragment, You can put some activity or fragment
Unified operations into the parent class, such as the entire application of SD card business, unified UI modification operations, unified permissions operations, and so on, anyway, 10 apps have nine is this structure, there is a problem (MU class nets teacher said, haha)
Here a little bit about naming rules, if the company does not specify a set of naming rules, the above naming rules for practical development is really helpful, is actiivty, with the activity end, is fragment, with the end of fragment,
The layout file is the activity's layout, beginning with activity, end of layout, and the specific business name in the middle.
Fragment's layout is the same as activity, starting with fragment, ending with layout, and the name of the business in the middle.
This allows for a glance at the post-browsing
Time is late, tomorrow, then write the second part, the specific interface of the switch bar
The code is shared on the second part of Git.
Pay tribute to our continuous learning!
Android Real-world development of the home frame (first, the project structure of the building)