How to update Android app by software without Android market

I need help,

1) I am developing an application in which I want to display an offline website including videos, so I added the video to a raw folder for offline access to the application and I want to change this video after a few days (maybe add or remove some videos from the application). so is it possible to update my app without using android marketplace?

The idea is when I run the application, it will parse the json and check if a new version of the application is available on my site or not. If it's available, it will start downloading it (I don't want to open the browser to download, the update must be done in my application or in the background) and reinstall it. How can I do this programmatically?

also how can i cache an entire website in webview. I am currently using this code, but it only caches the visited pages (the page we open in the app)

webView.getSettings().setLoadsImagesAutomatically(true);
 webView.getSettings().setDomStorageEnabled(true);
 webView.getSettings().setAppCacheMaxSize(1024*1024*24);
 String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
 webView.getSettings().setAppCachePath(appCachePath);
 webView.getSettings().setAllowFileAccess(true);
 webView.getSettings().setAppCacheEnabled(true);
 webView.setWebChromeClient(new WebChromeClient());
 webView.setWebViewClient(new WebViewClient());   
 if (savedInstanceState == null) {
 if(isNetworkAvailable() == true){
 webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
 webView.loadUrl("http://www.xyz.com");
  } else {
 webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ONLY);
 webView.loadUrl("http://www.xyz.com");
  }   } }

      

2) How can I install apk from mac to tablet to usb without pressing the eclipse launch button. I want to install this apk for 200 tablets, so I am looking for some batch program or some script to be installed with one click to install script for application. I search on gooogle, I found one Multiple apk per click , but I don't know if it will work on Non-rooted tablet or not.

Waiting for an answer. Thanks you

+3


source to share


2 answers


There are two ways to do this, first use push notifications and tell users that the new version, when they click on the notification, downloads the apk from your webserver and lets them install (I used this one)



another option could poll your webserver after some time of fixing (one day) and check if a new version is available, when it is available click on it so that the new version appears in the notification area when the user clicks the repeat button above procedure for all this you need is a web server to which you will request submission and from where you can download the application.

+2


source


I think storing videos, etc., as resources is a bad way to go.

You can sync the timer data with your website and store everything on a db or sd card - so you don't need to reinstall the app, but download some data sometimes and all the data will be on your device and available offline.

And about the script - you can write your own and only run abd install app

- so you only need to run adb without opening the IDE.

BTW you can "reinstall" your application without user action (on a non-rooted device) - so it is inconvenient for the user to reinstall your application many times.

UPDATED

To install the application via usb - this person must have adb.



they don't want to wait for the download to complete

but in this case they have to wait for the app to load =). They have to download content even in this content on resources or on the Internet.

If you want to create such an app with embedded content, you may run into some problems:

  • Some devices won't accept you a very large APK (> 20 mb for htc desire, for example it's a bad idea =)
  • Every time you want to update your application people have to reload a huge amount of heart attack, if you create online caching they can spend much less time downloading diffs. Even if people install your application via usb - you can put all the data on the SD card.
  • You can't update the app on non-rooted devices in a way that doesn't get people angry - you'll have to reinstall your app every time. But with my method thay can sleep and content can load.

So, I can't imagine any usecase where your method is better than the usual "online methods".

+1


source







All Articles