Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. Manage auto update

Manage auto update

Scheduled Pinned Locked Moved Android
announcementandroidquestionsysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andy_Bell
    wrote on last edited by
    #1

    Good evening I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file. I want to change this procedure, if it's possible. Before installing new version, I want that application should be able to uninstall itself. How can I do? Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way? What can you sugest me? Thank you.

    A 1 Reply Last reply
    0
    • A Andy_Bell

      Good evening I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file. I want to change this procedure, if it's possible. Before installing new version, I want that application should be able to uninstall itself. How can I do? Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way? What can you sugest me? Thank you.

      A Offline
      A Offline
      Afzaal Ahmad Zeeshan
      wrote on last edited by
      #2

      Quote:

      I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file.

      That is required. How about, you keep all of the business logic on your server side and just show the results on the Android application? This way, you won't have to push every fix to the Android application but merely the new features only.

      Quote:

      Before installing new version, I want that application should be able to uninstall itself.

      That is done by default, your previous application is removed by the Google Play Store and then the latest version is installed. But if your application uninstalls itself then I am not sure, Google Play Store would be happy to install the new version of the application, without user intervention. It would require the user to go to Play Store and install the latest version themselves.

      Quote:

      Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way?

      Of course, if the data is no longer of user, remove it. Anyways, have a look here, there is way, where you can download the APK related content later, but that is just for the applications where the content is above 100 MB. APK Expansion Files | Android Developers[^]

      The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

      A 1 Reply Last reply
      0
      • A Afzaal Ahmad Zeeshan

        Quote:

        I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file.

        That is required. How about, you keep all of the business logic on your server side and just show the results on the Android application? This way, you won't have to push every fix to the Android application but merely the new features only.

        Quote:

        Before installing new version, I want that application should be able to uninstall itself.

        That is done by default, your previous application is removed by the Google Play Store and then the latest version is installed. But if your application uninstalls itself then I am not sure, Google Play Store would be happy to install the new version of the application, without user intervention. It would require the user to go to Play Store and install the latest version themselves.

        Quote:

        Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way?

        Of course, if the data is no longer of user, remove it. Anyways, have a look here, there is way, where you can download the APK related content later, but that is just for the applications where the content is above 100 MB. APK Expansion Files | Android Developers[^]

        The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

        A Offline
        A Offline
        Andy_Bell
        wrote on last edited by
        #3

        Thank you for repaly. Last days I have made some tests. Now I can recal new intent to unistal my application, after downloading and storing new version in Download folder. I have found the routine to send Intent for installing the new version. Here is the code for this two procedures:

        Uri packageURI = Uri.parse("package:com.example.nameapp");
        Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
        startActivityForResult(uninstallIntent, PICK_CONTACT_UPDATE);
        //
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + nomeApp)), "application/vnd.android.package-archive");
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);//installation is not working

        But when application executes unistallation, it is arrested and it cant't execute the install procedure (loading II intent). How can I execute II intent after unistallation? Is it possible? How can I do?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups