Posts

Showing posts from 2017

Disable ScreenShot in Android - Xamarin.Forms

Image
Taking  ScreenShot  in device is the best way to keep record at time where you don't want to write it down or you may want to have a copy of it. Android device gives us an opportunity to capture the screen content in the form of Image. If you don't want the user to capture the screen content for the purpose of security or for some other reason, you can achieve it in a very easy way. Lets see how to achieve it using  Xamarin.Forms. You have to write a native code for android and iOS. And yes, we have to struggle for iOS, we will see why and how we can overcome it. Xamarin.Android: 1) Open the  MainActivity.cs  file under your  projectName.Droid  project. 2) In the  OnCreate()  method, write the below Line just before the  LoadApplication(new App()) .                            -   Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure); ...