Cong Yang
Cong Yang

Reputation: 127

Change default path

When I create a project in android studio, the default path is java/app/com/example/myName/myProjectName. Can I change it to something like java/app/myName/myProjectName or just java/app/myProjectName? Can I delete the folder direcly in my workplace? What's the use of com/example?

Upvotes: 2

Views: 161

Answers (1)

Zoe - Save the data dump
Zoe - Save the data dump

Reputation: 28229

The major part of that path is the package name. In your case it's com.example.myName.myProjectName.

Packages are essentially folders in the workspace.

If you only want to use the project name, there's one major disadvantage: if you upload to google play there may already be an existing app with that package, meaning you can't upload it.

com.example is meant as the domain in the naming convensions, though there's no reason to follow these. You could remove that part completely and end up with a package name that's just myName.myProjectName. So if you want, you can rename the package to exclude com.example

If you want to shorten the package name, just rename it in the IDE (so you don't need to deal with folder moving in the file explorer in your OS). Because it's android though, renaming the package isn't just right-clicking and pressing refactor and that's it. It's slightly more complicated, but it's all explained here

Upvotes: 3

Related Questions