how to make my application device administrator in android?

android, device-admin

Solution

i just need to make sure that to uninstall the application , user needs to enter the password which is set in my application.

Fortunately, this is not possible for an SDK application. Even a device admin app cannot prevent the user from uninstalling it.

Problem

I am trying to make my application device administrator , i followed some notes provided on the same at Device admin SAMPLE notes or TUTORIAL here but still could not implement it. Can some one plz point out a working example of the same , i just need to make sure that to uninstall the application , user needs to enter the password which is set in my application. Any help will be useful , Thanks in advance

Original source