Android Real-world development of the home frame (first, the project structure of the building)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.