2

I have developed an education app for specific people. I want that my app only get installed on their devices (on specific IMEI devices).

I know that, After application installed, my app can verify those IMEI numbers. But as we all know that, we can put some restriction (like Minimum SDK version) in manifest file. I was wondering, Is there any device Id restriction we can add inside manifest file, that verify while installation.

If So, than I generate different apk files for all of them...

RStar
  • 100
  • 2
  • 7
  • you can restrict app showing in specific devices from play store but there is no way to prevent app(apk) to install on those devices based on ime. play store will only restrict viewing app from those devices but if uses of those devices can install the app if they have the apk file – Illegal Argument Aug 18 '14 at 06:15

4 Answers4

2

From android there is no way i mean you cannot restrict through any permission but yes through smart coding you can achieve it

1) Anyways you will get the IMEI numbers of the users phone so programatically you can check the condition on landing/splash page if IMEI==USER_IMEI_NUMBER then only he/she can able to see its main page else he will not get authority to enter into main page but for that you need to create APK file for each device

2) If you dont know how many users will use your app then you can do remote database in that database you can save new users IMEI number and in splash/landing page you can check through webservice that IMEI==USERS_IMEI_NUMBER (from remote database) then he/she can use your app but off course for that you need to mention internet permission in it and user must have valid internet connection if you dont want user to check it identity/IMEI number each time then you can validate user at once and you can save its result in shared preferrences and you can give access to user everytime without hiting webservice for validation

hope this suggestion may help you happy coding :)

  • In my app, there is no need to use Internet. Thus what I do is, On the HomePage I check as you said, Is IMEI == PRE_DEFINED_IMEI. If yes then go to next activity else finish() app. – RStar Aug 18 '14 at 09:53
  • yes you can do this but there is disadvantage of this solution is that you need to create apk everytime for every new IMEI Number but yes it will work – Android is everything for me Aug 18 '14 at 09:55
0

I do not think it is possible on Google Play store to filter your app for specific IMEI devices. If I were to do this, I would set up my own server and upload the apk to there and then distribute the url to the devices that I want to share the app with. Have a look at here

hoomi
  • 1,882
  • 2
  • 16
  • 17
  • Hey Hoomi, I haven't developed any application that require internet connection. So I haven't gone through this server concept. As much I know, Google provides free space for server and with couple of lines command, I can set up my own server. But do you have any great links or ideas to set up my server just for the verification of IMEI number of Devices. – RStar Aug 18 '14 at 09:59
0

I used TelephonyManager and IMEI number to identify the reral user. when someone wants the app they send the IMEI and then I put it and Rebuild the project as signed the APK file to his number. After generate signed Apk , I'll send it via Whatsapp. Some are installing & running, Some are installing only. plz can you tell what is the error for it. Thank you under shows my Main Activity .java

    public class MainActivity<AUTHORISED> extends AppCompatActivity {

private final static String AUTHORIZED_IMEI = "xxxxxxxxxxxxxxx";
TextView txtView, txv;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {

        // TODO: Consider calling
        // ActivityCompat#requestPermissions;
        // here to request the missing permissions, and then overriding
        //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
        //                                          int[] grantResults)
        // to handle the case where the user grants the permission. See the documentation
        // for ActivityCompat#requestPermissions for more details.

        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, 1);

        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
        } else {
            return;
        }
    }
    String deviceImei = telephonyManager.getDeviceId();

    String authorisedImei = "356245995115572154" + "";
    if (authorisedImei.equals(deviceImei)) {
        txtView= findViewById(R.id.text2);
        txtView.setText(deviceImei + " - Authorised");
        startActivity(new Intent(MainActivity.this, AreatoRiyanActivity.class));
    }
    else {
        txtView = findViewById(R.id.text2);
        txtView.setText(deviceImei + " - Not authorised");

        new CountDownTimer(5000, 1000) {
            public void onTick(long millisUntilFinished) {
                 txv = findViewById(R.id.text1);
                txv.setText("seconds remaining: " + millisUntilFinished / 500);
            }
            public void onFinish() {
                finish();
            }
        }.start();
    }
}

}

nevil
  • 1
-1

If you know how to get IMEI number in programmatic-ally please share the code. You requested answer is == step 1. Find IMEI number in programmatic-ally Step 2. Store that number in your app Step 3. pass that number to your app verifyer to install

AaaNnn
  • 1