I need to implement Android application which will be expired after few days or number of uses.
The application will be on the google market.
I can implement the check using shared preferences.
But what should I do in the application if user decides to buy the license?
Is it possible for user to pay via the market?
You can have two different applications. One will be the full version and the other will be the licensed version. The first version will store the first date when the application is run as a SharedPreference. It could also be stored on a server somewhere else. It will then work for only so many days after that. The second version(licensed version) will not work until the user types in the correct product key. This could be validated over the internet.
I'm not sure why you would want to do this though. Most apps on the Android market will have a free version of their application with limited functionality. Then the full version of the application can be purchased separately. This model seems to work well for many applications.