Make a WebView App With Download Option | Sketchware Tutorials 01
❖ ┉┉┉┉┉┉┉┉┉┉┉┉ 〄 ┉┉┉┉┉┉┉┉┉┉┉┉ ❖ If You Need Sketchware Pro Apk Just Post a Comment. ❖ ┉┉┉┉┉┉┉┉┉┉┉┉ 〄 ┉┉┉┉┉┉┉┉┉┉┉┉ ❖ ⫸ Codes For Download Block ⫷ webview1.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); String cookies = CookieManager.getInstance().getCookie(url); request.addRequestHeader("cookie", cookies); request.addRequestHeader("User-Agent", userAgent); request.setDescription("Downloading file..."); request.setTitle(URLUtil.guessFileName(url, contentDisposition, mimetype)); request.allowScanningByMediaScanner(); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); java.io.File aatv = new java.io.File(Environment.getExternalStorageDirectory().getPath() + "/Webview/Download");if(!aatv.exists()){if (!aatv.mkdirs()){ Log.e("TravellerLog ::","Problem creating Image folder");}} request.setDestinationInExternalPublicDir("/Webview/Download", URLUtil.guessFileName(url, contentDisposition, mimetype)); DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); manager.enqueue(request); showMessage("Downloading File...."); BroadcastReceiver onComplete = new BroadcastReceiver() { public void onReceive(Context ctxt, Intent intent) { showMessage("Download Complete!"); unregisterReceiver(this); }}; registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); } }); #SketchwareTutorials #OwnApps
Download
0 formatsNo download links available.