Posts

Showing posts from February, 2021

Code for "Webview download"

 Set the whole different fon codes: 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.setDestinati...

Code for "Button Effect"

 Set the codes on the block: android.content.res.ColorStateList clr = new android.content.res.ColorStateList(new int[][]{new int[]{}},new int[]{Color.parseColor(_color)}); android.graphics.drawable.RippleDrawable ripdr = new android.graphics.drawable.RippleDrawable(clr, null, null); _view.setBackground(ripdr);

Code for "Video Record"

Set these codes: Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); if (takeVideoIntent.resolveActivity(getPackageManager()) != null) {startActivityForResult(takeVideoIntent, REQ_CD_CAM); } Go to our channel: https://youtube.com/channel/UCfRsBA71sa4LaDTZuSkmasw

Code for APK Share

Set these codes: String apk = ""; String uri = (_name); try { android.content.pm.PackageInfo pi = getPackageManager().getPackageInfo(uri, android.content.pm.PackageManager.GET_ACTIVITIES); apk = pi.applicationInfo.publicSourceDir; } catch (Exception e) { showMessage(e.toString()); } Intent iten = new Intent(Intent.ACTION_SEND); iten.setType("*/*"); iten.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new java.io.File(apk))); startActivity(Intent.createChooser(iten, "Send APK")); Set these on.the "add source directly" block.... Thanks.....

Code for Video Player

 Set codes for the more block "extra": } VideoView vidview; MediaController mediaControls; { Set codes for 'on activity create": vidview = new VideoView(this); vidview.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); linear2.addView(vidview); mediaControls = new MediaController(this); mediaControls.setAnchorView(vidview); vidview.setMediaController(mediaControls); vidview.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { } }); vidview.setOnErrorListener(new MediaPlayer.OnErrorListener() { @Override public boolean onError(MediaPlayer mp, int what, int extra) { showMessage("Oops An Error Occured While Playing Video!!"); return false; } }); Set codes for "file picker": vidview.setVideoURI(Uri.parse(path)); vidview.start(); Thanks for viewing.........