Hey guys, welcome back to the blog .
So guys today in this blog we will learn how can we block the screenshot taking in our .
This topic is very important for us because by blocking the screenshot in our application we can secure our application. So in this blog we will be teaching you how can you do it in our application.
Before getting started as usual you can also visit our Youtube video for more information. {Video👇}
Let's get started:
Step 1: open the Sketchware application & click on "+" button.
Step 2: Write the name of your application & click on "create app" .
Step 3: Then your application will be created.
Step 4: Then design your UI as of your wish.
Step 5: Then move to "Event".
Step 6: Click to "More Block"
Step 7: Then click on "+ fab" ans add a more block with the name "screenshot".
Step 8: Then add a "Boolean" Variable.
Step 9: Then name the variable as "notallowed" & click on add.
Step 10: Then click on "Add" & your more block will be added. And then click on the more block with the name "screenshot".
Step 11: Then drag the "if...then...else..." Block from "Control".
Step 12: Then drag the "add source directly" block from the "operator" & other block as shown in the image👇.
Code:
//add source 1
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
//add source 2
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
Step 13: Then go back to "Activity" & Click on "on create" option .
Step 14: Then drag the more block named "screenshot".
Step 15: Then drag the "true" block from "operator". { As shown in the image 👇}
Step 16: Then go back and click on "run" button.
I hope this tutorial blog was helpful for you.
So thanks for visiting our blog.
How To Block screenshot Taking In Your Application | in Sketchware
Reviewed by Shahbaz Hashmi Ansari
on
July 01, 2020
Rating:
Nice bro
ReplyDeleteNot working
ReplyDeleteNice
Delete