Android App update-auto-detect version and automatic upgrade

Source: Internet
Author: User
Tags ftp file

Original

Http://www.cnblogs.com/keyindex/articles/1819504.html

Note: The essence, put their new version of the APK can be downloaded in the place, first set up their own communications, check the version, I am directly in the cloud, of course, can also be placed on their own computer, you can use

FTP file server under the same wireless access download, or through peanut shell mapping remote Download

The original version of the affected, the last part of the installation needs to be modified, and so I organize and then edit this post

Private voidUpdate () {//Install the appIntent Intent =NewIntent (Intent.action_view); //determine if it is a androidn and a higher version        if(Build.VERSION.SDK_INT >=Build.version_codes.            N) {intent.setflags (intent.flag_grant_read_uri_permission); Uri Contenturi= Fileprovider.geturiforfile (Getapplicationcontext (), buildconfig.application_id +". Fileprovider",NewFile (Environment. getExternalStorageDirectory (), download_name)); Intent.setdataandtype (Contenturi,"application/vnd.android.package-archive"); } Else{intent.setdataandtype (Uri.fromfile (NewFile (Environment. getExternalStorageDirectory (), download_name)),"application/vnd.android.package-archive");        Intent.setflags (Intent.flag_activity_new_task); }//Intent.setdataandtype (Uri.fromfile (New File (Environment//. getExternalStorageDirectory (), download_name)),//"Application/vnd.android.package-archive");StartActivity (Intent);

Android App update-auto-detect version and automatic 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.