Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
420 views
in Technique[技术] by (71.8m points)

android - What is the difference between changing package name vs applicationId

What is the difference between changing package name vs applicationId to the final apk.

I know it is different for aspect of keeping source code, but lets say I got some app with package name a.b.c.d. What will be the difference in the builded apk file

  1. if I rename the a.b.c.d into q.w.e.r and then build the apk file

vs

  1. change the applicationId into gradle with q.w.e.r
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The package name is just to organize your code.

The applicationId, on the other hand, is used to identify your app in the Play Store. You will change this only if you plan to generate another app based on same code.

From docs (https://developer.android.com/studio/build/application-id.html):

When you create a new project in Android Studio, the applicationId exactly matches the Java-style package name you chose during setup. However, the application ID and package name are independent of each other beyond this point. You can change your code's package name (your code namespace) and it will not affect the application ID, and vice versa (though, again, you should not change your application ID once you publish your app). However, changing the package name has other consequences you should be aware of, so see the section about modifying the package name.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...