Given that I intend to make an app executable on a single device, a tablet for example placed in a pub where I offer a particular service; so I want guarantees that the app runs only on that device, and cannot be recompiled and transported elsewhere.
it is possible to implement something like bluethoot; like a second phone that sends and receives a specific code to verify that the app is genuine (but then you have to encrypt the values via bluethoot or as better to do)?
but this solution would be something great: there would be the possibility, and how to do it, to insert a kind of hardware key via the OTG port and therefore there is a kind of "IMEI" for a USB pen (Which I grant to the user of the app) ?
I hope the questions will be valid for others, and thanks for the advice.
If it is your app, that you put on this tablet, and nowhere else, how would it be possible to copy the apk and use it somewhere else?
It think you make it more difficult than it should be. As long as you do not put the app on the playstore or anything like that.
You can make an app that doesn't work without a key. When you install the app, you enter the secret key yourself and the app works. The idea with IMEI will not work from android 10+.
I use myself "APK Extractor" to extract my applications from the mobile phone in which they are installed, to install them in other devices. I have an android TV and I also happened to use "APK Extractor"to extract an APK and install it on the TV. So "stealing / taking" an installed APK is very simple.