For non market app, how can I protect my app from installation and running in unauthorized devices? Eg. For computer softwares, most developers use HDD serial number etc to protect their products. So how can I get unique hardware Id or serial no (that not change by app) of android phone, tablet?
Thanks for advance.
When you sell an app the user has to give his/her email address. At the first start this mail address will be checked one and a licence file will be stored on the phone/tablet. At every start this will be checked if it is valid. After some time (every week or month) the mail address is checked again. You will need an hosted server with MySql and php (about 10€ a month).
2. Create an own app for every user. You create a register file (same as #1) and send it by mail. The user then can copy it to a special folder.
First of all, its not to hard to crack an app. So, dont break your head, nor make it tedious for your legal "users".
Just use the IMEI, aply on it some hashing or just screambling. Use this as a Hardware ID. Make the user send it to you when the pay, and finaly send them a Licence Key that whas calculated by you from the Hardware ID.