Android set a limit of installation allowed per .apk
===

Is there a standard way to limit the number of installations allowed by an .apk

If I understand correctly Timstamp limits the time an .apk is valid for installation, is there something similar to this that limits the installation count.

Im planning on using DeviceID and UserID to populate a DB that checks logs for used User ID / Device ID combination to allow or not allow access, once the app is installed.

Thing is Im trying to prevent the app from even being installed if its over x number of installations.

I was also thinking about something like...

    package com.tchip.kw;
    public class mysoft {
    static {
    try{
    System.loadLibrary("tchipmysoft");
    }
    catch(Exception e)
    {}
    }
    public native int getmachinestatus1();
    public native int getmachinestatus2();
    }
     
    ///this will read/call 2 solutions from mysoft when the end users try to run app. If the return value is 0, then it will say’ Quit’. For example:
     
    mysoft kw = new mysoft();
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            //this.findViewById(id)
            if (kw.getmachinestatus1() && kw.getmachinestatus2() )
            setContentView(R.layout.main);
    /////Star splash activity
    else
    {
    You do not have proper license to use this software and it will quit
    }
    }

I've thought about writing an installation .APK for the for the app.apk that check for a set of  Key's held remotely and then grants access to to

If there is a standardized method or Im missing something really simple, Im all ears. 