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...
T This page will show how to share apk in sketchware project. T 1.Add an button button1 in your sketchware project. 2.In on create activity add an add source directly block 1. In add source directly block paste the code as shown below: StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.setVmPolicy(builder.build()); if(Build.VERSION.SDK_INT>=24){ try{ java.lang.reflect.Method m = StrictMode.class.getMethod( "disableDeathOnFileUriExposure"); m.invoke(null); } catch(Exception e){ showMessage(e.toString()); } } 3.In more block area create an block share In moreblock add an add source directly block,in add source directly block add the code shown below InIn android.content.pm.ApplicationInfo app = getApplicationContext().getApplicationInfo(); String filePath = app.sourceDir; Intent intent = new Intent(Intent.ACTION_SEND); i...
bhai admin penal me se connection file missing h.
ReplyDelete