While developing android apps, I found out that why previous apps was replaced when I installed another app using apk file.
The apps have different names, labels, but the same package name. Is that ok?
take a look at your package name. The package name must be unique. May thats your problem
The apps have different names, labels, but the same package name. Is
that ok?
No, it's not Ok. The package name is how the system uniquely identifies one app.
for example you should/could your packages name as:
com.jrgalia.app_1_name
com.jrgalia.app_2_name
com.jrgalia.app_3_name
etc...
To be very specific as why your app got replaced. All applications will be stored in /data/data/package_name
If you do adb install then the folder and its content will be replaced by your new operation, that is why while uploading to google play it makes sure package names are unique.
Related
i was working with a source code of an application in eclipse in order to create an application
what i want is to create two applications the same view but with some differents in the content.
the proleme is when i change the database content
an extract it as an apk file
the apps cannot being installed together
when i install the second one i should delete the first app to install the second
that mean the phone think that this is the same application
so what can i do to make the phone accept installing the both apps
thanks
Change the default package name and update the same in manifest file. You can also change the app name for one application so that both applications dont have the same names. But this is not mandatory.
I've upload application on google play store with my own package name.
Later client want to change the package name.
I've searched but i got that, not able to change package name after publish.
what can i do for this?
and
In playstore can we have two apps with same name with different package?
In playstore can we have two apps with same name with different package?
Yes, you can have multiple apps in the play store with the same display name, but they have to have different package names (and the play store won't actually allow a second app with the same package name as another even to be uploaded)
what can i do for this?
You cannot change the package name.
You can change the package name in your dev environment and upload it as a new app. All your ratings and download numbers will not transfer.
You can't. As stated here, seems that's one of the few things you cannot do.
Choose a good package name
Make sure you choose a package name that is suitable over the life of
your application. You cannot change the package name after you
distribute your application to users. You can set the package name in
application's manifest file. For more information, see the package
attribute documentation.
I install my apps by sending the apk file to my gmail account as an attachment and then install the app from there. But by doing this, I find that I can install only one app at any point. the device tries to replace any previously installed app if i try to download and install another one. I found the same thing when sideloading the apps through command prompt. am i missing something here?
any help is appreciated.
thanks.
You need to have different package names for the apps , also if you do this, put separate names too to avoid confusion on your home screen.
There are two kinds of packages in Android-land. One is the Java package that your classes are in and the other is the Android package that is in the manifest. I assume that you are talking about the Android package, not the Java class package, right? I was confused by the need to give a package name in the manifest and assumed that it wanted the Java package name. And since I used the same Java package for both of my first two apps, when I installed the second one, it replaced the first one.
On a related question, what is a typical naming convention for Android packages?
First of all, go to File and find Export to zip file and click it.
Like here:
.
Now extract the generated zip file and reopen this Android project. It works for me.
Try renaming the .apk files, that might help.
Does it matter what I name the final .apk file that I will be uploading to the android market? Can the user see the name of the file?
No, name of .apk file is ignored and user will not be able to see it. You can name .apk in whatever way is convenient for you. Android Market only parses the internals of .apk files and extracts all the information it needs.
Also, when .apk is installed on the device it named as <package.name>-#.apk. For example: com.google.zxing.client.android-2.apk or com.estrongs.android.taskmanager-1.apk. Though this is not documented and just an observation.
I have noticed the package name of app on the prompt message when application got crashed.
Package name is also visible for some time, when device is loading package screen in settings. If device is acting slow, I can see the package name of the application.
So you can take care of package name.
I have an Android app in the Market and I want to push an update. The problem is that after refactoring my base package name in the Manifest file is completely different. I feel I'm in trouble because (in order to migrate old data) I need to access a file stored in:
/data/data/old_app_pkg_name/app_data
but with my refactoring I'll probably be able to access the data directory in:
/data/data/new_app_pkg_name/app_data
Am I stuck with using the same old package name if I want to access the data directory of the original app? Or I do have access to that directory when pushing an update even if I change the package in the Manifest?
Best!
German
You probably can't. Unfortunately Android generates a new user the combination of package name and signing certificate. If you had created your old files as WORLD_READABLE on the SD card then maybe you would have been able to do it, but as far as I am aware once you change the package name you can't get to the old directory any more.
Answering my own question and just for the benefit of anyone struggling with this here's a great new blog post from the Android team about what to keep when updating your app:
http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html
(I wish it was available when I asked this question but it wasn't, it's new)
Best!
German