I write something for a licence that you can buy an activation key pay for it and the licence is activated only when the user pay for the application, it is a very complex thing, but i manage some service and use a licence file that is encrypted using a type structure, and a server that store the client licence data that is the same as the local licence file. the only thing, the client need to activate the licence either manually or automaticly by paying for it licence, then the server set a byte in the licence file for that specific client, and when the app open up when the user start the app, a call is made to the server to scheck for activation, and if the activation byte is set then the app is activated and can be run fully.
There is more to this that i can describe here, but so far my system work pretty well, and ive made a web app to check for clients, activate or deactivate licence and if the app is not activated, the app will run in demo mode only accessing certains parts of the program, it also check in the local app for a date period if the app is not activated, and it will stop accessing data, the app is still there but he can do nothing with it. It does not mather if the user deinstall the app, the app remember that it was installed before, and if it is reinstalled again on the same phone or tablet, it will remerber it's id and will not create a new entry in the database.
Anyway, there is a lot of ways to do licencing, but after many many tries and experinces i think i have the best licencing sheme for my apps. and this i use using an object class that i include in all my apps, and i don't have to create a new protection sheme everytime i create a new app.
If you are interrested, i can give you hints on how to implement this technique, and modify it to yours need. But my pattern involve and internet access and a server to receive and manage licences. But so far this have work flawlessly for me and my company, and i can sold demos that are time limited or datelimited and activate the app remotely without changing anything in the app for it to work.
Give me a buzz if you are interreting to know how that works.