Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make an auto update for android app from server [duplicate]

Tags:

android

I'm developing an app for android in my company that will be running in a few tablets, if I make some changes I need to re-download and re-install my app in server manually. is there any way to do this automatically? I've search it, and this is what I've got;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);    
        Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://192.168.xxx.xxx/myApp.apk"));
        startActivity(intent);  
}

but it only download from my apk link, but it didn't install my apk, and everytime I open my app, It always download from my link, I want to make it only download when there's new app, and automatically install it.

like image 368
Darjeeling Avatar asked Aug 26 '26 09:08

Darjeeling


1 Answers

We have a text file on the server containing the current release version (as an int) and the version number (eg 1.1.31)

Once a day the app will check load that data and compare to the current build number then prompt to download if the server version is higher. In your case you'd do the check first before calling the intent.

like image 69
David O'Meara Avatar answered Aug 28 '26 22:08

David O'Meara