How to install the new version of apk file from a web server automatically instead of manual install(Downloading the apk and clicking the same).Upon starting the application , it should query for the higher versions available in web server and based on that the new version should be installed in the device.The updation may be either with user confirmation or background process.
You cannot auto-install any apk without the user's permission. You can at best, download the apk file, and then prompt the user to let him know that you want this application to be installed.
So, if the web app has the necessary APIs, you could write some code to query and get the latest versions available, and then finally download and prompt the user.
There is an intent to launch this confirmation activity.
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setDataAndType(Uri.fromFile(new File("link to downloaded file")),"application/vnd.android.package-archive"); startActivity(intent);