Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project Name Issue when Importing Android Projects into Eclipse

This is a small issue with Eclipse when dealing with the ADT.

Question:

When importing projects into Eclipse, the name is not coming up correctly. Even though it should just be the name (ex. "HelloWorld"), the name is actually tied to the package name (ex. "com.blah.HelloWorld"). I personally like the smaller name for the "Project Name" as it is easier to deal with in the Project Navigator. This happens when using the "android" option under the import window. If I use the "general" option, the issue does not happen.

I can just stick to using the general option when importing, but I feel the android option should work just fine. Any ideas??

like image 301
orion Avatar asked Jul 08 '12 14:07

orion


2 Answers

You can browse to menu Window > Preferences, select tab Java > Appearance. In box Abbreviate package name, replace the package name with a short string you prefer.

For example:

com.example.android={a}

Then all package names starting with com.example.android will be replace by {a}.

like image 59
Lincoln Hawk Avatar answered Oct 19 '22 12:10

Lincoln Hawk


In my case, the project name is imported as MainActivity , always.
So I find some trick.
On AndroidManifest.xml, change activity name .MainActivity to the project name you want.
Then, import. You will success.
And re-change your manifest file.

like image 27
Jehong Ahn Avatar answered Oct 19 '22 11:10

Jehong Ahn