10

I have an app, but I want to update it, I read some post of "stackoverflow" (update application programmatically)

Android programmatically update application when a new version is available

update apk programmatically (without root)

but none convince me.

I would like information on how to update an app.

Right now my app is not uploaded on google play, I have it in apk.

I would upgrade using a button [update click here], and that she is going to take charge "http:www.site/myapk.apk" and to update.

Why say the apk? because every week I will update my app a bit.

And if they have to always download the apk, it is very frustrating.

There an easy and clean way (with code)?

Community
  • 1
  • 1

2 Answers2

12

please visit this link you may get some idea LINK

It follows these steps ::

1 Create a Web Service which your app can poll whenever the app launches or based on some time limit that can check if there is new version out there.

  1. This Web service should return the lastest Version of the apk file that is hosted on the Server along with the URI of the application file that has the new version.

  2. When your app gets the response from the Web Service, it will parse the JSON and check your app version to the lastest version that is available on the server.

  3. If your app version is lower than the latest version it will prompt the user to start the download process. The download of the new app is handled by the Download Manager.

  4. The download manager will notify your app using Broadcast receiver when the download is complete.

  5. After completion of the latest version of the application file the you can start the activity to install/update that file.

Ajay
  • 4,850
  • 2
  • 32
  • 44
5

Try this option

Add google library to update from the application

  dependencies {
implementation 'com.google.android.play:core:1.5.0'
...}

refer doc from below link

https://developer.android.com/guide/app-bundle/in-app-updates#update_readiness

Amin Pinjari
  • 2,129
  • 3
  • 25
  • 53