I downloaded the source code of OI Notepad and did some modifications to it. And then made an .apk file out of it. But when I try to install the .apk it shows
This is a system application.
Do you still want to replace it?
When i say yes it moves forward but does not install it..
I have this post My application tries replace another my application and the answer given there the package name of both the apps cannot be same.
But is there any way in which I can manage to install modified OI Notepad without any hassles of replacing the older one. It happens in Emulator..
Thanks
If you are using eclipse you can right click the package tree and use the refactor option to quickly change the package. This, in most cases, correctly updates the Application Manifest for you. This 'should' resolve the error you are having keeping in mind that you will now have two versions of the application so it may be in your best interest to change the application name of your custom version so you can easily distinguish between the two.
Related
We have a custom ROM for a device we are making and what I want to do is make our own custom Settings app to replace the settings app that comes already built in android.
I cant really find any documentation on how to even create a system app. It does not appear you can create it in Android Studio, I tried looking on the AOSP site and didnt find anything there related to creating system apps. The few things I did find were on here where you would put android:sharedUserId="android.uid.system" in your manifest and then has to be signed with the same key as the ROM but after that I cant find anything.
The settings app I want to create would need access to the framework.jar to be able to use the hidden framework API's.
Does anyone have any information or know where I can find this information on how to go about actually creating a system app?
You may want to research how to make a Device Tree Overlay (dto). Basically it is your code, reformatting the base code, into what you want. https://source.android.com/devices/architecture/dto?hl=en
Since you said you use Gradle, you should put first build you apk and put them in you vender folder, and next important thing is to create a mk/bp file to tell the Android build system how to deal with this pre-built apk.
P.S. If you system app highly depends on Android hidden api, make sure you have the right version of framework.jar in you Android Studio project, or, as what I alway did, create apps directly in AOSP, in this case, you can just check the code structure of the original Settings app in AOSP
this tutorial may help you.
I want ti install same app twice without replacing the each Other.
something like :I Want play a game from the start without losing previous game saved data.so, Is there a way i can install same apk twice without replacing the previous one. is it possible??
Will changing the apk package name & changing default installed Directory of app work?,but i think it doesn't work.
Actually you can I do that before BY:
You must have a different package name (make sure the package name in the AndroidManifest.xml file is different), there is no other way. I had two different versions of the same product (free & paid) and used: com.package.paid & com.package.free.
This means that nothing is shared between the two apps (DB included).
You can also use ANT scripts to build both apps from the same code base, I just changed it manually every time I needed to build a version. Hope this help :)
You can't do that, android only allow one version of an app exists. Do an upgrade or downgrade installation, or find another device to install the same app.
I developed an app for android, but I need to install two instances of it, one for my daily use, another for debug/development, I don't have too many phones for debug, just have one phone, and don't want to debug on emulator, because it's too slow compare to real phone.
Or is there any thing we can change on APK file, then we can install it as another app, e.g. change it's package name ?
Currently, I changed the package name in code then make them to two apps, which can be installed on the same phone, but this way is not convenient. seek for simple way.
Update: is there any tool to modify package name in androidmanifest.xml directly after packaged(apk file)? then we just need unzip the apk, modify the androidmanifest.xml, zip the apk again.
You've answered the question yourself. You have to change the package name in the manifest, otherwise Android will override the old app (or can't install it, if the certificate differs).
Try changing the the name of the app in strings.xml from resource folder #string/app_name to have multiple instances of the same app. And package name must be changed so that the existing app is not overridden.
You can copy your project and change the package name in the copy.
You can use the same SVN path to apply the changes on the two projects.
Or you could automate the different builds using an ANT build.xml file with parameters. There are several examples on how to do this for Android in Google.
ref: One android application, one startup view, two icons
I would make the original app a library project and create a new project which uses the library project.
Advantage:
you can have both running as your new project should have a different package name
easily identification by overriding the app name in your new project (just add "beta" to it)
both versions can be installed on one device/emulator parallel
pretty good setup if you try to verify the update process of your app
no confusion with a version control system - renaming packages results in awful non-real changes on your development branches
Disadvantage:
you need to "uncheck" the library setting before you can release the original project
you might need to change some stuff in both manifest files which will increase the maintainability in a small manner
If you really need a market version of your app on your device, this method is the easiest one as a package rename will very probably result in worse maintainability.
edit:
You can mark a project as a library project in project preferences -> Android. After that you can link add that library project to another normal android project at the same spot, just click on the add button.
I need to have different versions of my code on my device when I'm developing my android application. I want to have a copy of my latest code once in a week or so. The reason is that sometimes you make changes to the code and make it worse for a while, then after that you polish your code to include the features. So I need to have a copy of latest correctly running version of my code on the device.
I tried to change the app name, to see whether the ide deploys a new copy of my code, but it didn't work and the ide seems to be smarter than that and it replaces the app with the new name. I suspect that I need to change the package which is a little bit frustrating/risky. Anyone knows the solution?
Right now, I'm using Intellij to implement my android project but I think this doesn't matter.
You need to change the package name.
I use ant build script to do this easily. I created an ant task to rename the package name and make a build.
Typically I use svn to keep track of changes and label which ones are the ones that work then add features and use svn merge commands to combine new features with working code. Then if you want to undo something you can just roll back a revision.
The way I achieved that goal is:
- configure the original project as library
- create another project specifying a different package name in the manifest
- you also need to declare all the activities, receivers, etc with the full name in the new manifest
In that way switching the code of the original project through different branches you can create different apks and have different version of the app installed at the same on your device.
You need to change the package name, not the app name, it's pretty easy in Eclipse.
If your package name now is 'com.sina.perch', so just rename it to 'com.sina.perch1' or something else whatever in file 'AndroidManifest.xml' , which looks like:
It will be work.
I have a project “Abc12” which contains App “TypeYourName”.
Also I have another project “Xyz12” which contains a Service like “MySoftKeyboard”, which is NOT a library type project.
I’d like to associate project “Xyz12” to project “Abc12”, so when user downloads App “TypeYourName”, App “MySoftKeyboard” is also downloaded with it.
Any idea how can be done, if possible ?
I don't think you can do this as separate .apk files. (At least I'm pretty sure you can't do this either in the Android Market or the Amazon Appstore. I also don't know how you could side-load two apk files from the same link.) Create a single project that has your app and also has the service.
It might make sense to put all the code for the service into a library project. Then you could have the service available as a stand-alone project and also bundled with other applications.
You can't. The best you can do is within Abc12, query the package manager for Xyz12, and if it is not present, prompt the user to download it. Make Xyz12 a service or define the proper intent so that ABC12 can access it.