Android Studio perfectly modifies the application package name

We usually create a new project, some friends may just write a package name at will, and then in the process of the project, I feel that the package name is not very good, so we need to modify the package name. According to our normal modification method, it is like this .

In this case, only the outermost name can be modified. 
If we need to modify one of the middle ones, it will not work here. 
So let's take a look at how to modify it to the package name you want in the end. 
The operation diagram is as follows: 
Studio modify package name

If you see no, we only need to remove the option of compact empty middle packages in the setting, so that the hierarchy of our packages will be separated. At this time, we can make corresponding modifications according to our own needs.

Another point is that in Studio, our getPackageName corresponds to applicationId, and the package in the manifest is actually used to reference internal resource files and ensure that the path of source files such as Activity is correct. Therefore, modify it in Studio. To publish the package name, you only need to modify the applicationId in the build file.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326111237&siteId=291194637