Shannon
Shannon

Reputation: 87

How to create new packages in an Android project

I have too many activities in my Android app project and I'd like to manage them using packages.

How can I do it?

Upvotes: 2

Views: 5997

Answers (4)

bmavus
bmavus

Reputation: 892

in android you have a package name like com.your.package.name. this is your master package. you must create other packages as asub-package of this.

To use this packages in manifest use: ".subpackage.Activity" android os will handle the rest.

Upvotes: 2

Vipul
Vipul

Reputation: 28103

I Enjoy creating Package in separate Way.

If you are working in Eclipse Just mention the desire package name at top.

Eclipse will automatically do trick for you.

enter image description here

Upvotes: 1

Graham Smith
Graham Smith

Reputation: 25757

If you are using Eclipse:

Right click on the project and choose new => "package".

Eclipse: Creating new package

Eclipse: New package wizard

You may need to update your references to other classes once reorganised. I find ctrl+shift+o can help you there too.

Upvotes: 2

AkashG
AkashG

Reputation: 7888

Right click to src folder in your project->New->package.write the name of the package there->Finish.you will see the package what you named under src folder of your project.Add class files into that package.While using the clsses of different packages you have to import the classes as they belong to other package and you also have to declare it in manifest file.

Upvotes: 1

Related Questions