Java Package Agreement

I am developing an Android project that currently has 4 packages:

com.myapp.app.activities
com.myapp.app.db
com.myapp.app.ws
com.myapp.app.utils

Can I create an additional package that just

com.myapp.app

?

Eclipse does not allow me to create this package. This tells me that a package with that name already exists.

If I start a new project and create a package called "com.testing.app" and then create a new package called "com.testing.app.activities", it works fine.

For Android Developers:

What I want to do is extend the Application class and use it in a separate package. Suppose com.myapp.app cannot be used, what is a good name for this new package?

+5
source share
4 answers

Eclipse , .

Java : com.myapp.app.activities com/myapp/app/activities. com/myapp/app , .

Eclipse, juste , "" com.myapp.app. .

+12

com.myapp.app . com.myapp.app.MyClass, app.

, , - :

Example


:

+3

Eclipse hides empty packages by default. In the package explorer view, click on the small arrow in the upper right: the "View" menu. Select Customize View. On the Filters tab, uncheck the "Empty packages" boxes. Now empty packages will be visible in the package explorer.

alt text

+3
source

It seems that if I manually placed the file in the directory and updated the package explorer in Eclipse, a new com.myapp.app will appear

0
source

All Articles