I have some problem installing my apk file in code. Wondering if anyone could find out what I did wrong.
What I was trying to do is put a Check Upgrade function in our program. When user clicks it, it will send request to our web server and find out what is the latest version. I use app versionName to stamp a version, something like 2010.11.23. I don't use the version code in Manifest.xml file. So our program sees the latest VersionName is later than itself, it will download the latest one, and then use the following code to install the new apk file:
Intent intent = new Intent(Intent.ACTION_VIEW);
Now looks like, everytime when I changed the VersionName, it will fail to install the apk file. It downloads the file fine. I don't know exactly why. Sometimes, in Eclips, when I hit debug, I got error saying "Re-installation failed due to different application signatures". I don't know if this is the same error caused the installation failed.
So, looks like my questions are:
1. Should that upgrade logic work? I am wondering if it has something to do with the VersoinName.
2. What could cause the application signature change? (I did sign our program before I put it on our server, but I always use the same key file for different versionName. )
Any input are welcome.