1

Possible Duplicate:
Device IMEI locking for tablets

Is there any way to lock my android app by using IMEI no. I want to do this because I do not want to allow users of my app to share it by sending APK to other device.

Community
  • 1
  • 1
Sagar Dhomane
  • 1,069
  • 1
  • 10
  • 22

4 Answers4

3

The apk itself cannot be locked to the paid user, until JellyBean. From JellyBean onwards, paid apps are encrypted and stored on the phone.

Here is a solution that Screencast application seems to use. When you purchase it, they store your identity in their server. Each time you open the application, they verify your identity again before proceeding. The problem is, ofcourse, even registered users cannot use it if they are not connected to the net.

Aswin Kumar
  • 5,158
  • 5
  • 34
  • 39
1
public String getSimSerialNumber(){
    TelephonyManager tm = (TelephonyManager)this.getActivity().getSystemService(this.getActivity().TELEPHONY_SERVICE); 
    String number = tm.getSimSerialNumber();
    return number;
}

this may be helpful to you. also you can fetch other data using Android's TelephonyManager.

Dhairya Vora
  • 1,281
  • 12
  • 35
1

As far as I know, your app package cannot modify itself. So 'locking' it to current installation using any unique id is pointless without some external server to validate the lock. Otherwise, user can just install again, application will read IMEI and lock. User wipes out 'app data' and your app thinks it is new installation.

If you know IMEI beforehand (like from registration form), you can compile personal version of application for each user, with IMEI hardcoded inside and checked on start.

tmouse
  • 679
  • 1
  • 6
  • 14
1

Please read this blog post. IMEI is not a secure way to identify a certain device.

http://android-developers.blogspot.de/2011/03/identifying-app-installations.html

  • WIFI only devices wont have an IMEI
  • After a reset, the IMEI remains the same. So it is a problem to sell the device
  • Sometimes the function for querying the IMEI returns trash
  • You need an additional permission in your app ( READ_PHONE_STATE )

Unfortunately google doesnt show a "best practice" way for this problem...

fklappan
  • 3,259
  • 2
  • 17
  • 18