Reputation: 4383
I need some help,
1) I am developing app in which I want to display offline web site including videos so i added videos in raw folder for offline access of app and i want to change that videos after some days( may be add or delete some videos from app). so is it possible to update my app without using android market?
The idea is when i start app it will parse json and check wether new version of app is available on my site or not. If it is available than it will start download of it(i don't want to open browser for download. update should be done within my app or in background ) and reinstall it .How can i do that by programmatically?
also how can i cache the entire website in web view.currently i am using this code but it cache only visited pages (the page that we open in 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 by usb without clicking on run button of eclipse. I want to install this apk to 200 tablets, so i am looking for some batch program or some script which will be one click install script for app. I search on gooogle i found one Multiple apk on click but i don't know that it will work on Non rooted tablet or not.
Waiting for reply. Thank you
Upvotes: 3
Views: 4547
Reputation: 3893
I think store videos etc as resources is a bad way.
You can sync you data by timer with your site and store all in db or sd card - so you don't need to reinstall app, but only download some data sometimes and all of the data will be on your device and avaliable offline.
And about script - you can write your own and only run abd install app
- so you will only need to start your adb without opening IDE.
BTW you can "reinstall" your app without users actions (on non rooted device) - so it's very inconvenient for user to reinstall your app many times.
UPDATED
To install app via usb - this person must have adb.
they don't want to wait until download completes
but in this case they have to wait until app is downloaded =). They have to download the content even this content in resources or avaliable online.
If you want to create such app with built-in content you can face with some problems:
So i can't imagine any usecase when your method is better than usual "online" methods.
Upvotes: 1
Reputation: 3587
There are two ways you can do this first use push notifications and tell users that new version when they click on the notification download the apk from your web server and let them install (I have used this one )
other option may polling your web server after some fix time say(one day) and check if the new version is available once it is available push that to notification area that a new version is available when user clicks that it will again repeat the above procedure for this all you need is web server that you will request to send and from where you will make users download the application
Upvotes: 2