The post guide how to download any file from file url in sketchware project. 1.Add a linear layout linear1 and a button button1 which will act as download block [Download file FROM URL(string: url) TO PATH(string: path) with progress dialog] 2.In moreblock area create a moreblock Download. In add source directly block add following code: 3. android.net.ConnectivityManager connMgr = (android.net.ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); android.net.NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { final String urlDownload = _url; DownloadManager.Request request = new DownloadManager.Request(Uri.parse(urlDownload)); final String fileName = URLUtil.guessFileName(urlDownload, null, null); request.setDescription("URL - " + urlDownload); request.setTitle(fileName); request.allowScanningByMediaScanner(); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIF...
Comments
Post a Comment