Andriod project Development Combat (1)--How to build a new package under one package in eclipse

Source: Internet
Author: User

The first is to classify the various categories of storage in different packages, so you want to create a few different functions in the project source package eg:utils, model, receiver, etc., the final result should be the left:

It is obvious that the structure after the establishment of the project is the right one, so it is a matter of course to choose the New-->package,name column to fill the activity, but the result is the following left ...

        

The results are obviously different from what we expected, and we see that activity and com.mukekeweather.app are parallel structures, and what we need is a tree-like structure.

After a lot of data to understand this problem, because the new package in Java is layered, is in the name of the "." To be layered , as you can see from the diagram on the right, Our original package was Com.mukekeweather.app, then we had a tree-like file schema, a COM folder under the SRC folder, and then a new Mukekeweather folder in the COM folder, and then the new app folder under it. So, the schema of the folder we envisioned should be the rightmost one ...

So according to such a folder structure, we in the new package when the New-->package,name column should be filled in com.mukekeweather.app.activity, com.mukekeweather.app.db, Com.mukekeweather.app.model, Com.mukekeweather.app.receiver and so on can achieve the effect we want, just like the following two pictures ...

     

Then we see that the effect is the following ...

OK, this way, in fact, understand the new package in Java in the name of the writing and the package in the file of the actual organizational structure of the relationship between the very easy, we have just the way to continue to add a few other packages to achieve the effect we have expected, is the left side of the picture, The corresponding file structure is the right way ...

Andriod project Development Combat (1)--How to build a new package under one package in eclipse

Related Article

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.