Generate apk for only one Tablet

  • Hallo,
    bitte ich habe folgendes Problem. Und zwar: ich habe eine Android Applikation auf Android Studio für eine Firma entwickeln. Aber bei der generierung der apk datei will die Firma, dass die App nur auf einen bestimmten Tablet läuft, damit der kunde nicht auf mehrere Tablets instalieren kann. Dafür habe ich auf die IMEI-Nummer gedacht, aber das Tablet ist mit WLAN only d.h. hat keine IMEI-nummer. Und ich habe überlegt, ob ich mit der MAC-Adresse machen kann...aber wie!!! weiss ich nicht.
    wie kann ich meine App einstellen oder programmieren, damit es nur auf einen Tablet läuft??? Konnte mir bitte jemand helfen???
    Danke.

  • Die Lösung heißt DeviceId



    Code
    import android.provider.Settings.Secure;
    
    
    private String android_id = Secure.getString(getContext().getContentResolver(),Secure.ANDROID_ID);


    Added in API level 3


    A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device. The value may change if a factory reset is performed on the device.


    Note: When a device has multiple users (available on certain devices running Android 4.2 or higher), each user appears as a completely separate device, so the ANDROID_ID value is unique to each user.

  • michael thks for reply,
    the code generates a security key ... so I want to enter the MAC address of the Tablet anywhere in the code (build.gradle, AndroidManifest, ...) so that it can be installed only on this. That lock my App for any other Tablet or Smartphone and applicable only to a single Tablet.
    Thanks.

  • mh then I think it's not possible by app development. You should take the source code of a custom rom and change it the way you need. Maybe it's possible to add a mechanism to that custom rom that checks a custom tag in the manifest file of an application.

  • Das funktioniert aber nur wenn er die kontrolle über das Gerät hat, beziehungsweise dem Besitzer vorschreiben kann, dass es in den Android Einstellungen aktiviert sein muss. Wobei das garnicht so abwägig wäre, da er ja auch irgendeine Geräteidentifikationsnummer für die App braucht.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!