How to remove data stored on the device remotely through code (programatically)

95 Views Asked by At

I want to remove data stored on the device remotely through code. I did through android device manager. https://www.google.co.in/android/devicemanager But I want same approach programatically through my application.

1) How can I get Active devices through gmail.

2) How can I lock my mobile

3) How can I ring my mobile remotely.

I didn't see any code programatically. How can I do programatically all these? I tried below code.

public class Controller extends Activity {
    public class adminActivity extends DeviceAdminReceiver {

        DevicePolicyManager mDPM;
        ComponentName mDeviceAdminSample;

        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
            mDeviceAdminSample = new ComponentName(Controller.this,
                adminActivity.class);
        }
    }
0

There are 0 best solutions below