Posts

Showing posts with the label Sketchware

How to Enable Own Download in Sketchware app.

Image
Enable own Download in sketchware app. Ads:- Follow the below instructions :- 1) Create a New project in Sketchware. 2) In View area add WebView as webview1 3) Add more block as download_path with String as file_path 4) On create Activity event add as shown Here I have used " /Webview/Download/ " folder as download folder. You can change it to your choice by changing all the text" /Webview/Download/ ". Codes below copy to the add source directly block as shown above. 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("

Enable Fullscreen for Youtube videos in WebView

Image
1) Create a New project in Sketchware App. 2) In View area add WebView as webview1 . 3) Add more block as full . 4) Copy the below code to more block in add source directly } public class CustomWebClient extends WebChromeClient { private View mCustomView; private WebChromeClient.CustomViewCallback mCustomViewCallback; protected FrameLayout frame; // Initially mOriginalOrientation is set to Landscape private int mOriginalOrientation = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; private int mOriginalSystemUiVisibility; // Constructor for CustomWebClient public CustomWebClient() {} public Bitmap getDefaultVideoPoster() { if (MainActivity.this == null) { return null; } return BitmapFactory.decodeResource(MainActivity.this.getApplicationContext().getResources(), 2130837573); } public void onShowCustomView(View paramView, WebChromeClient.CustomViewCallback viewCallback) { if (this.mCustomView != null) { onHideCustomVie