siraj
siraj

Reputation: 461

Android :- making app non shareable

I want to make an application which has to be very secured. So f I install an apk in a phone it should only work in that phone. When apk is shared it should not work.Can any one help me in implementing this.

One idea from my side is using an algorithm to generate password using device mac address and so the password won't work for two different devices to log in.Is there any way to get the MAC address( or something unique to device) in android from java? .Expecting alternate solutions!!

Upvotes: 0

Views: 1129

Answers (2)

siraj
siraj

Reputation: 461

I implemented with IMEI number. So my apk is designed based on IMEI number.So it will check whether IMEI given matches with the device IMEI then only it will launch the new Activity, else it will exit.

TextView tx = (TextView) findViewById(R.id.tx);
    String ts = Context.TELEPHONY_SERVICE;
    TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(ts);
    String imei = mTelephonyMgr.getDeviceId();
    if (imei.equals("<what we given inthe source>")) {
        // Launch the activity
    } else {
        // show an alert dialog and exit
    }

Upvotes: 0

Rajesh
Rajesh

Reputation: 15774

If you are distributing the app through Google play store, you can make use of the Google Play Application licensing.

You may read Identifying App Installations on Android Developer's Blog for a discussion about how to uniquely identify a device.

Upvotes: 1

Related Questions