I want to create a new app by modifying code of an existing app's source code. So I did the following from eclipse:
exported the code of the old app "app1" to a file system.
created a new Java project "app2", and imported the code that was exported earlier.
modified strings.xml, and renamed the app_name as "app2"
made other edits to app2's code, for a new feature.
ran app2 on the mobile device (connected to the PC)
Now app2 is working correctly, and its name is also seen as "app2". But I see that when I loaded the code onto the mobile device, it has replaced the app1 that was previously installed, ie the app1 is no more visible on the device.
So my question is: what other changes do I need to make (apart from the strings.xml:app_name) to make a completely new app? ie, I want both app1 and app2 to exist on the device.
You have to change package name as package name plays as unique in android.
Here is showing way how to do that :
https://stackoverflow.com/a/4025422/4161269
Related
First I uploaded one app with one package and now client changed the package name, in my app I used FB login and push notifications with the old app, so I have to change any thing in the FB developer either I have to create new account or I can use the old fb developer account and app_ID, with changing of the Package name.I am so much confused what I have to do, when I change the package name,please suggest some solution.
You also have to change the folder names to match the name of the new package.
For example the package:
xxx.yyy.zzz
Should correspond to the directory:
xxx/yyy/zzz
First , In android code, you will need to change package names in manifest xml and gradle mainly. use refractor for that.
secondly,
you mentioned that you used fb login and push notifications,
so for these, you will need to make some changes .
in Facebook developer app settings page, simple add your new package name to existing package list,
and for GCM push notifications, do the same on developer console and create new configuration files and add them to your project and everything will work fine.
I have developed my first app using eclipse and uploaded to Amazon app store. Later, I realized some bugs, fixed them and re-uploaded. But, when I want to reinstall app over same/newer version, it says:
"The application you are installing will replace another application. All previous data will be saved" as other normal apks.
"And then it says application not installed." I have signed both versions using same key.
when you try to run the app(Let the new project name be AndroidAPP_v2) with all the bugs fixed ,then In eclipse It will show like this :"The application you are installing will replace another application".that means It will replace your old project(let it be AndroidAPP_v1) with new project(AndroidAPP_v2).If you click OK ,it wil automaticall install new app .
This is because both applications have the same package name. If the package name of the two applications are different, you won't get this message.
In fact, if the package name in the Manifest file (in the tag) matches the package name of another installed application, it will replace it.
I'm trying to create my own version of Gesture Builder. In eclipse I selected android project from existing code and I renamed the project and package name to new gesture. Then I added in android:fadeOffset = "1000" in create gesture xml(so that I can create gestures for letters like t and f) and in AndroidManifest.xml I set the version name to NewGestures and I set a different icon but when I try to run it I get this error message:
"Re-installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data! Do you want to uninstall?"
From what I've seen online I need to match the signature used originally on Gesture Builder, but I've no idea how to do this on eclipse, shouldn't the signature have been handled properly when I created from existing code? Any help would be very much appreciated. I just need this app working so I can get a gestures library for a different application I'm working on for college.
This message concerns the application signature. This happens when you are trying to install an application on your device while an application of the same package name is already installed, but signed with a different certificate (see details here).
For example:
You have exported and installed your application using your Google Play keystore (so using your actual developer's certificate), and now you are running/debugging it from Eclipse, implicitely using the debug certificate (which is different)
You have runned/debugged your application from Eclipse at home on this device, and now your are running it/debugging it from Eclipse with another computer (which is using a different implicit debug certificate)
etc
Normally, below the error message, you have a button that allows uninstalling/reinstalling. If not, just uninstall your app manually and everything will be fine again.
versionName:
The version number shown to users. This attribute can be set as a raw
string or as a reference to a string resource. The string has no other
purpose than to be displayed to users.
package:
The package name serves as a unique identifier for the application.
The package name declared in your manifest.xml is what makes your application unique. Therefore, there can not be two application installed with the same package name at the same time. If you try this, your error occurs.
I have a req. like I have Application A created by me and APK of Application B.
Is it possible for me to set the process id and user id both same for the apk as well as application A. I don't have manifest of application B since its an apk. Is it possible for me to run the apk and an application of my own in the same process? Please help.
You need to set a sharedUserId in both manifest.xml files.
The process id (normal install) must not be the same on each device. You get the id from the device.
If you have access to the manifest.xml of the apk, you can set the sharedUserId.
EDIT:
If you Have only the apk file. You can use the android-apktool, this tool allows you to "decode resources to nearly original form and rebuild them after making some modifications". So you can have access to the AndroidManifest.xml and there change the sharedUserId.
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.