I just spent around an hour implementing the android market licencing tools into my app.
The app in question is a widget, I want to know how I would go about stopping the widget (a button) from functioning, if the app isn’t licensed.
Does anyone know how this could be accomplishes?
I assume you check for a valid license when the application is first started (say in onStart())? If so, then depending on the response from the licensing server, just set a boolean to indicate if it is licensed and use that as a check in the button’s onclick method. If it’s not licensed, then notify the user and do nothing else.
As a side note, depending on your app’s intended use and expected user interaction frequency, you shouldn’t check for a valid license every single time the app launches. You may only need to check once and then store the result in a shared preference that you use on subsequent launches.