Issues with Android Auto update upgrade

Source: Internet
Author: User

Problem description
Hello everyone, about Android upgrade questions to ask everyone, to answer, first of all thank you.
I am currently on the phone app version 30, the app on the server is 31. Each time the app launches, it sends the data on the message area server, where the server gives the current version of the server app, and launches the upgrade program if it's higher than the current app.
The upgrade prompt was successful. In fact, it failed. The situation is. The icon for the application list and the font below have changed, and the program size has changed. But the UI content hasn't changed since it went in. I experimented with it many times, uninstalling the program either as an APK installation, or as an Eclipse installation. Be sure that the APK download on the server was successful. The general logic of my program is:
To upgrade, start a thread and download the APK on the server as follows:
  /**     *  Download New Programs      */     public void appupdate (context context) {    httpclient httpclient  = new defaulthttpclient (); HTTPGET GET = NEW HTTPGE ("server address" + "/update/xxx.apk"); httpresponse response;inputstream is = null; Fileoutputstream fileoutputstream = null;try {response = httpclient.execute (GET) ; Httpentity entity = response.getentity (); Is = entity.getcontent ();long len  = entity.getcontentlength (); if (is!=null) {fileoutputstream = context.openfileoutput ("XX.apk",    context.mode_world_readable+context.mode_world_writeable); byte[] buf = new  byte[1024];int ch = -1;while ((Ch = is.read (BUF))  != -1) { Fileoutputstream.write (Buf, 0, ch);}} Fileoutputstream.flush ();} catch  (clientprotocolexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();}  catch  (ioexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();} Finally{if (is != null) {try {is.close ();}  catch  (ioexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();}} if (fileoutputstream != null)  {try {fileoutputstream.close ();}  catch  (ioexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();}}}     }

After the download is complete, update it in handler.
Final Handler Handler = new Handler () {@Overridepublic void Handlemessage (Message msg) {try {switch (msg.what) {case 1:pro Gressdialog.dismiss (); Intent Intent = new Intent (Intent.action_view); File File = new file ("/data/data/package name/files/xxx.apk"); Uri uri = uri.fromfile (file); Intent.setdataandtype (URI, "application/vnd.android.package-archive"); Context.startactivity (intent); break;default:break;}} catch (Exception e) {e.printstacktrace ();}}


When the program starts, the Android system prompts for updates, clicks on the update, pops up the system progress bar, then says the installation is complete, and goes inside as described above, the contents of the content has not changed. Solutions 1
Download to SD card try Solution 2
Figure out if your 31 version on the server is the correct solution 3
The APK on the server is the wrong feeling solution 4
Do you directly install the version on the server right? I'm automatically upgraded. No such nonsense, and it's not likely to be. Solution 5
You first check the phone inside Data/app below Odex or apk time and size right
If it's all the same as on the server, log on.
1. Log that was launched by the original app
2. Download the log to complete the upgrade
3. The new app launches the log

Filter on full, especially note the Packagemanager and package name sections

Issues with Android Auto update upgrade

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.