Are these two treated as same package names in android - android

So I have published an app on google play, but unfortunately I forgot the alias password for the signing certificate though I remember the password with which I signed the certificate.
After searching a lot I have come to a conclusion that I can't retrieve the alias password by any means and now I am publishing a new copy of app on google play.
Also I went through this post by Dianne Hackborn,
things-that-cannot-change.html
and package name is one out of them.
So , now if I publish this new app with the same package name and un-publish the existing app and a user who has installed the existing app with the existing package name now installs this new app I think that would be an error according to the above post.
But according to the package name conventions I have named the package as,
com.mycompanyname.beta
and for this new upload of the app , I want to use the package name,
com.mycompanyname.android so would these packages conflict ?

com.mycompanyname.beta and com.mycompanyname.android are different package names, so no, they won't conflict.
If a user has the first app installed (com.mycompanyname.beta), and then installs the second one (com.mycompanyname.android), they will end up with both apps installed on their device.

The app is identified by the package name. Therefor the package name needs to be unique. Thats why everybody uses some domain names for that to create a unique package (domains are unique, too).
They wont' conflict
com.mycompanyname.beta
com.mycompanyname.android
but for the safe use-case, this will do the work
com.mycompanyname.clientname.android
Changing package name will not be issue , Android SDK will handle references efficiently
From Android package Specifications
A full Java-language-style package name for the application. The name
should be unique. The name may contain uppercase or lowercase letters
('A' through 'Z'), numbers, and underscores ('_'). However, individual
package name parts may only start with letters. To avoid conflicts
with other developers, you should use Internet domain ownership as the
basis for your package names (in reverse). For example, applications
published by Google start with com.google. You should also never use
the com.example namespace when publishing your applications.
The package name serves as a unique identifier for the application.
It's also the default name for the application process (see the
element's process process attribute) and the default
task affinity of an activity (see the element's
taskAffinity attribute).
Caution: Once you publish your application, you cannot change the
package name. The package name defines your application's identity, so
if you change it, then it is considered to be a different application
and users of the previous version cannot update to the new version
.

NO there will not be any conflict rather then made a copy of your app with different package

com.mycompanyname.beta and com.mycompanyname.android are different package names of your app.
It never be conflict each over. Both app can be installed in same device.
If it is conflict then better to check the manifest file of app package. May have same package. Then it make conflict. Your App package name should be like that
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompanyname.beta"
android:versionCode="1"
android:versionName="1.0" >
</manifest >
and other one
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompanyname.android"
android:versionCode="1"
android:versionName="1.0" >
</manifest >

Related

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
if I rename the a.b.c.d into q.w.e.r and then build the apk file
vs
change the applicationId into gradle with q.w.e.r
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.
Some Android API like google map and firebase ask for your package name when you create the key. That package name they refer to is actually your applicationId. Yup Google insist on using the term package name for these API key. Don't get it confuse.
Taken from doc (https://developer.android.com/studio/build/configure-app-module#set_the_application_id):
"Note: The application ID used to be directly tied to your code's package name; so some Android APIs use the term "package name" in their method names and parameter names, but this is actually your application ID. For example, the Context.getPackageName() method returns your application ID. There's no need to ever share your code's true package name outside your app code."
Application id mostly used for:
Change the application ID for testing
Change the application ID for build variants
In this case, each build variant should be defined as a separate
product flavor. For each flavor inside the productFlavors {} block,
you can redefine the applicationId property, or you can instead append
a segment to the default application ID using applicationIdSuffix, as
shown here:
Every Android app has a unique application ID that looks like a Java
package name, such as com.example.myapp. This ID uniquely identifies
your app on the device and in Google Play Store. If you want to upload
a new version of your app, the application ID (and the certificate you
sign it with) must be the same as the original APK—if you change the
application ID, Google Play Store treats the APK as a completely
different app. So once you publish your app, you should never change
the application ID.
And package name is:
Although your project's package name matches the application ID by
default, you can change it. However, if you want to change your
package name, be aware that the package name (as defined by your
project directory structure) should always match the package attribute
in the AndroidManifest.xml file, as shown here:
The Android build tools use the package attribute for two things:
1- It applies this name as the namespace for your app's generated R.java
class.
Example: With the above manifest, the R class will be
com.example.myapp.R.
2- It uses it to resolve any relative class names
that are declared in the manifest file.
Example: With the above
manifest, an activity declared as is resolved to be
com.example.myapp.MainActivity.
Know more from Source
Once you upload the app on Play store you can't change the application id for that project , if you want to do then google play store consider as a different application.
In case of package name you can change it as you want.

using 'in.' in the android app id (eg. in.example.myapp)

I wanted to know whether I can use 'in.' in in the app id.
For example.. can i create my app id like this
in.example.myapp
As I am unable to create it using cordova CLI. But I have changed it in the config.xml
here is the error i am getting
cordova create MyApp in.example.myapp MyApp -d
CordovaError: App id contains a reserved word, or is not a valid identifier.
at C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\create.js:106:19
at Promise.apply (C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1078:26)
at Promise.promise.promiseDispatch (C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:741:41)
at C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1304:14
at flush (C:\Users\USer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
Can I publish such app on play store?
Please reply guys..
thanks in advance
From official documentation:
A full Java-language-style package name for the application. The name
should be unique. The name may contain uppercase or lowercase letters
('A' through 'Z'), numbers, and underscores ('_'). However, individual
package name parts may only start with letters.
To avoid conflicts with other developers, you should use Internet
domain ownership as the basis for your package names (in reverse). For
example, applications published by Google start with com.google. You
should also never use the com.example namespace when publishing your
applications.
The package name serves as a unique identifier for the application.
It's also the default name for the application process (see the
element's process process attribute) and the default
task affinity of an activity (see the element's
taskAffinity attribute).
Caution: Once you publish your application, you cannot change the
package name. The package name defines your application's identity, so
if you change it, then it is considered to be a different application
and users of the previous version cannot update to the new version.
yes, you can use "in." on it... the "com." thing is like a domain ownership, that's all. Read: http://developer.android.com/guide/topics/manifest/manifest-element.html
EDIT: This is Cordova documentation
The element's id attribute provides the app's reverse-domain
identifier, and the version its full version number expressed in
major/minor/patch notation.
Is not an Android limitation neither Play Store limitation if is Cordova limitation there is nothing you could do... if not, post the error; but, again... is not an Android/Play Store limitation.
"in" is a reserved keyword in Javascript. Since Cordova is built using JS, you can't use it in your package name. As noted by Mariano above, it is not an Android/Play Store limitation.
Here's a list of all reserved keywords:
break case class catch const continue debugger default delete do else
export extends finally for function if import in instanceof let new
return super switch this throw try typeof var void while with yield

Error publishing app to the Google Play.

I have a problem while uploading .apk file. When I try to upload .apk file, I always get the same error:
Its says that I need to name the app file, something like this: com.example.myapp.
The .apk names that I tried (examples): com.rvislt.prosld.apk, com.rvislt.prosld2014.apk and I always got the above error.
I tried to use the different browsers, shutdown all background application and I always got the same error.
It makes me crazy!
What is the problem and how can I fix it?
You are simply renaming the APK file name, try to change your package name of your application.
Like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rvislt.prosld"
android:versionCode="1"
android:versionName="1" >
Renaming the APK file to com.rvislt.prosld.apk does not make any sense and it wont work for you.
Try to change Package Name into your manifest.xml file with com.rvislt.prosld and built again and for the naming conversation go to http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Its not necessary that it always start with .com.
Generally we android developer having practice to decide package name based on the domain name of a particular company.
For example:
1. Domain name: sun.com => Root package name something like : com.sun
2. Domain name: technotalkative.com => Root package name something like: com.technotalkative.android
3. Domain name: sun.org => Root package name something like: org.sun.androidapp
And for more information, What should be the package name of android app?
After having refactored your project to use new package name try to use a find-replace in your project and replace com.youroldpackage.app with com.yournewpackage.app with eclipse.
There are several places where your app page name is used: Manifest etc. java packages etc. make sure that everywhere is used your new package now.
BTW: a good practice for package naming is to use a domain that you own in it, that way you can be almost sure that nobody else uses the same package name, which is a problem, because you cannot upload apps with a package name that is already in use. so for example if you have the domain "mynewpackage.com" then your app packagename should be something like com.mynewpackage.mynewapp

com.example package name not allowed in Google Play

I'm new to android application development. I'm creating simple android application.
Export the android application and give the package name as AndroidManifestfile packagename as
com.example.zingyminds.apk
Now I got the apk file and upload to the google play at that time I got the below error message please anyone help me.
The package name of your apk may not begin with any of the following values: [com.android, com.google, android, com.example]
Packages are typically named using the following convention:
[org/com].[company].[product].[component]
By convention, package names should not contain capitals.
Google Play identifies all the applications on the basis of their package name, so some of the names are reserved for the default applications of the android, like you have mentioned in the last paragraph,
[com.android, com.google, android, com.example]
so, these package name are discouraged and you should use the upper conventions for describing the package name, something like this,
com.zingyminds.apk
Rename your package name com.example.zingyminds.apk to com.zingyminds.apk
Google Play doesn't care about the filename of your application. It cares
about the package name defined in the manifest.
If you observe properly, the fourth value in error message is 'com.example' which is same as starting of your package com.example.zingyminds... Rename your package to something else which is not listed in the message, it will solve your problem.
Packages are typically named using the following convention:
[com.android, com.google, android, com.example]
so, these package name are discouraged and you should use the upper conventions for describing the package name, something like this,
if you want to mention example in your package name, try this
com.zingyminds.example.apk

Changing the package name of an upgraded Android application

During the upgrade of my android application, I changed the package name. But Android market doesn't allow to upload the changed package name application as an upgrade. If I upload the application as a new application, will the user have two applications on his/her device? How can I make sure that the user doesn't have to download the application again from scratch without reverting the change of my package name?
two package = two different application in market place.
Once you upload one app, its package should be same. Also, the key should be same.
Android market is only concerned about the package name in your manifest, not the actual packages name in the source.
You could try to give the old package name in the manifest attribute, then for activities give the new package name instead of relative (ie .MainActivity)
Like this:
<manifest package="your.old.package" ...>
...
<application android:name="your.new.package.MainActivity" ...>
Could work..
I plan to serve two versions of my app (paid/free) this way and using same project and code.
If you change the package name, it's treated as a separate app - not just in the market, but apk's in general will only 'replace' the same package name (and only if they're both signed with the same key).
Although it's possible to phase over to a new key by signing an intermediate package with both keys, there's currently no easy way to phase over the package name.
The best that can be done is this:
New apk version is signed with the same key, but has a different package name.
When installed, the new apk arranges to use the shared_prefs with the old package name.
The data is copied across to the new package name.
The new version requests that the old version is removed, and the user sees the uninstall dialog.
Note app data is usually kept here:
/data/data/pac.kage.name/
I haven't tried this, so I can't give anymore details yet. You may also be interested in my request for a seamless way of transitioning the package name.

Categories

Resources