Creating a Lock Screen Device App for Android

Creating a dedicated XML Policy file

Declaring the use of the Device Administration API

  • A subclass of DeviceAdminReceiver including the BIND_DEVICE_ADMIN permission and the ability to respond to the ACTION_DEVICE_ADMIN_ENABLED intent, expressed in the manifest as an intent filter
  • A declaration of security policies used in metadata

Creating a subclass of DeviceAdminReceiver

Creating the User Interface

  • A Lock button to lock the device immediately
  • An Enable button to enable our security policies
  • A Disable button to disable our security policies

Writing the Java code of the Main Activity

Testing our Lock Screen Device App




Entrepreneur / Developer / Blogger / Author. In Bitcoin We Trust:

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Improving ExoPlayer rendering performance

Unit Testing Custom View in Android

Firebase Remote Config: 3 lessons learned

When Equal is Not, Another WebView Takeover Story

Why I Switched From Java to Kotlin and Never Looked Back

Woman working at desk

Flutter 3.0

Custom Progressbar with shape

Hardcoded credential leaks — API Key in Android apps

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sylvain Saurel

Sylvain Saurel

Entrepreneur / Developer / Blogger / Author. In Bitcoin We Trust:

More from Medium

Building a Simple calculator App in android studio.

How to Beautify and Convert the User’s Voice Using the Agora Android SDK

Introducing Android 12

Resolving HAXM Issue in Android Studio for Windows