Kamis, 11 Mei 2023

Enable download ​from webview in Sketchware without code Injection

 It has been a while since the discovery of code injection technique in Sketchware and the code for enabling download from webview in Android has been known ever since.

But now I have discovered a way to enable download from webview in Sketchware, without injecting any external code or without rebuilding the app code with any other software. Given below is the step by step process.

1. If you are not using Sketchware, download it from the link provided. It is a great android app through which you can create you own android apps right from your mobile. Download Sketchware.

2. Start a new project in Sketchware.

3. In the view area, insert a Scroll(V) with layout_width set to match_parent. Inside the scroll(V) layout, insert a webview widget.

4. In Logic area of the project add the following events:
onBackPressed
WebView: webview1 onPageStarted
WebView: webview1 onPageFinished

and also add an Intent component:
Intent download

5. Now go to onCreate event and add three string variables namely a, b, and c.

6. In onCreate event add the WebView loadUrl block and write the initial url to be loaded.
7. In onBackPressed event use following blocks:
If WebView webview1 canGoBack then
WebView webview1 goBack
else
FinishActivity
8. In the event When webview1 pageStarted (url), add the following blocks:
set a to WebView webview1 getUrl
set c  to (url)
9. In the event When webview1 pageFinished (url), add the following blocks:
set b to WebView webview1 getUrl
If (a equals b) and not (c equals b) then
Intent download setAction ACTION_VIEW
Intent download setData c
StartActivity download

10. Now save and run the project. You will be able to download when you click on download links in your app.

Here is a video for better understanding of the logic:


If you like this then you are requested to share it. Also subscribe to my YouTube channel for more such logics.
Share:

2 komentar:

  1. hai.. i love your blog so much!!!

    How do I make a webview riderect to the Play Store application when I will download an application from Google?

    Thank you for the help..

    BalasHapus

Alam terbuka mengasyikkan di Destinasi impian

Jasa Pembuatan Website Archives - Legenda Web

loading...

Archive

Cari Blog Ini

Diberdayakan oleh Blogger.

Mengenai Saya

Foto saya
Saya memiliki Jasa Pembuatan Website Terpercaya
www.legendaweb.com

Pernah mengerjakan seo untuk Agen Travel door to door ecopremieretransindo.com dan Agen Travel Jakarta Jogja jakjogtrans.com

Juga memegang SEO Biro jasa paspor

Selain Itu, kerjasama dengan Sewa Mobil Bali Mai Bali Trans dan Industri pariwisata trip Bali dari beautrip.id

Labels

Admob ads in Sketchware Admob Ads in Sketchware App admob ads using AIDE Admob banner ads using AIDE Admob interstitial Ads Android app Android change status bar color animation in Sketchware background music Change color of checkbox in Sketchware change color of Seekbar change color of Switch button change status bar color code for moving image with finger in android code Injection create and share text file in Sketchware create text file in Sketchware Custom listview in android Custom ListView in Sketchware CustomView in Sketchware Dictionary Android App Dictionary Android project Dictionary App Dictionary App in Sketchware drag image enable download from Sketchware enable download in webview enable download without code Injection Enable image upload enable upload from webview enable upload from webview in android enable upload in Sketchware enable upload in webview​ using AIDE enable upload using AIDE gif image in Android App gif image in webview how to use ListView in Sketchware how to use Spinner image zoom Integrate Admob Ads in Sketchware Intent large paragraphs in Sketchware larger texts in Edittext. limit input text length load image in webview make image fit screen make scrollbar invisible media player move image with finger notification icon in Android notification in Android Notifications in Sketchware open other apps retrieve APK file retrieve source code share button share button in Android App share button in Sketchware App Share text file Sketchware sound on off sound play pause soundpool Soundpool for Multiple sounds Sounds in Android App stopwatch Android App Stopwatch App string list timer use of list