更改程序包名称与applicationId之间有什么区别 [英] What is the difference between changing package name vs applicationId

查看:84
本文介绍了更改程序包名称与applicationId之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将软件包名称与applicationId更改为最终apk有什么区别.

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

我知道在保留源代码方面有所不同,但是可以说我得到了一些名为a.b.c.d的应用程序.生成的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. 如果我将a.b.c.d重命名为q.w.e.r,然后构建apk文件

vs

  1. 通过q.w.e.r将lily更改为gradle

推荐答案

程序包名称仅用于组织代码.

applicationId 用于在Play商店中标识您的应用.仅当您计划基于相同的代码生成另一个应用程序时,您才可以更改此设置.

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.

从文档中( https://developer.android.com/studio/build/application-id.html ):

在Android Studio中创建新项目时,applicationId与您在安装过程中选择的Java样式的软件包名称完全匹配.但是,应用程序ID和程序包名称是彼此独立的其他超出这一点.您可以更改代码的包名称(您的代码名称空间),并且不会影响应用程序ID,反之反之亦然(不过,再次,您不应更改您的应用程序ID您发布您的应用).但是,更改程序包名称还有其他您应该注意的后果,因此请参阅有关修改程序包名称.

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.

这篇关于更改程序包名称与applicationId之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆