I need help in upgrading apk file. I have apk file developed for android 2.2 and I donot wish to publish my apk on android market. I published apk in our own webserver. And i could download it to my android mobile. Now the issue is that how can i upgrade apk file by publishing in our webserver.
My questions are:
How android market does apk upgrading?
How to upgrade a binary in android mobile with new version of which old version is already installed?
I used android built in view using intent which actually Re-installs apk not upgrading.But i don't want prompts asking "Do u want to install application?".
I want the apk to be upgraded once user click upgrade button without showing prompt to user, like doing in android market.
Is there any method to upgrade apk in android?
Are there any restrictions doing that?
Are there any specific permissions i need or i need to set in manifest file.
Once you've downloaded the APK, Android itself decides if the program is installed and needs to be upgraded, or if it is a new installation. Users can decide for themselves whether to upgrade or not.
Besides how to find out when there is an update available, it's not possible to upgrade it without prompting the user with the "Do you want to install". Android doesn't allow third apps to install apps unless the phone is rooted and your app has root access, but I think that this isn't your target group.
I have no experience with that but what you could try is loading classes manually from your server and then store it in the assets folder.
http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html
This is one approach, I don't think that it's very handy and easy but it would work.
Hope it helps!
PS:
And just because I'm wondering, is there a reason why don't you wanna publish it on the Android Market?
When you are publishing an App on your private web server, you need to create a process through which you can check for new version .There is No in built method for doing this .
I have created one as well.
Related
I have created my custom ROM from aosp. I have also included my application, lets call it myCustomInstaller.apk (1.0) in the custom ROM while building. The application basically is kind of Google play Store. The application has system privileges and can install or remove applications silently.
I am able to install, update or remove any other applications. The problem I am facing is, When I am updating the myCustomInstaller.apk to 2.0 itself, the application is also installed silently, I am able to see the latest version installed in installed apps, but when i restart the phone, myCustomInstaller app reverts back to the original version.
I really don't know how to proceed, How is google playstore updating itself, and installing other application? Do I need any other permissions to make the updated version of myCustomInstaller app persist?
I am using this for silently installing, yes I do modified code for updating and removing
https://code.google.com/p/auto-update-apk-client/
Did you make sure to increment the android:versionCode in your Manifest? If not, the updated version, which will only get stored in the /data/ directory will be deleted when you boot.
i'm new in android developing. (and in developing after all)
Here is my problem: If i install my android application onto my mobile device or AVD, i want it to check the current app version number and if it's lower than the one i want to install currently then install it, and if it is higher , then alert the users that they already use the latest version.
Because now when i install the .apk file, it just installs the app again and nothing happens.
Is it possible to develop this?
Best regards,
weeyas
The install process is managed at the system level, so your application has no control over it. As per the versioning guide, the Android system will only allow you to install updates from the same or newer version codes (i.e., version 1 can be replaced by version 2, but version 2 can never be overridden by version 1 unless you do a complete uninstall/reinstall). This applies to both Google Play updates and sideloading APKs yourself.
I don't know if it is possible if you try to install application from .APK file. However, you will not be able to publish the newest apk to Google Play if it has the same or lower version number than the current one.
I have an application already installed on the mobile, am trying to install the update version of it.
I placed the apk inside the data/data folder, using file manager at the path,am trying to install it -
it shows a dialog to replace but not upgarde (Signed with the same key-store and version code/version name has an incremental value).
Could someone explain me more on this?
There is a difference between installing and subsequently, updating, apps off Google Play. Applications installed via a File Manager, for instance, will always prompt you to replace and not update an application. Side-loading apps on devices directly, does not have that mechanism to update. This is true not only for your app, but for every app.
It does not matter how it was signed or even the increment of your app's version.
Upgrade is only possible when you actually follow the installation procedure from Android Market. Else, it would just be a replace.
I want to update an apk file already installed in the device programmatically to a new version from a url. Is there any way to do this other than installing the file again using application/vnd.android.package-archive (Since I'd prefer to do this silently without user actions)
Not unless you have system privileges. If that were possible, any app would be able to install anything on your device (including malware).
save your current version and url in remote db.and when application starts in device check application version stored in db and installed app version is same or not. if different then download file from url.if not then run current version.
but you have to do these these things manually in code.
and for this you will need internet connection in device also.
I have done the same. I have my new apk in the FTP server and a version number of the new APk. I am comparing the version numbers and downloading the APK and installing it. but before that I am checking for the checksum of the downloaded apk with the checksum in the FTP server to make sure that the APK is downloaded properly.
Automatic installation without the users consent, i don't think it is possible. Let me know if you have found a solution for that.
I am trying to build this app which is almost complete now. I am trying to improve it by
Providing OTA support
In order to do that check the version, download apk and install it.
Some research pointed me to use Intents but was not very clear.
A step-by-step procedure will be much appreciated.
Thanks in advance.
PS: I may not be publishing it in the market because of certain requirements. So uploading to market is ruled out.
You can install an APK programatically by sending an intent with ACTION_VIEW with the apk file. This will open the application installer, which will install it if the build version in the manifest is higher than the one in the installed application.
See a similar question here for that part.
You'd need to poll a file on your server somewhere periodically that can return the latest version number, and compare it to the currently installed application version number through PackageManager (call getPackageInfo() and check PackageInfo.versionCode).