The Internet is full of examples. Some of them are good and some of them are not so good.
Here I am going to post really good example from real project that I found in internet which could be very useful.
Note: This is a live post, which I am going to modify while I find projects on Internet.
- LastFM: The ultimate application to listen radio on internet. (gitHub)
When you have it downloaded and imported it to the eclipse, you will see an error. What you should do is go to the file "README.API_KEY", copy/past the code and create a class called "PrivateAPIKey" in the package "fm.last.android".
After it, you must apply for a API key in last.fm in order to make your app run.
1. Go to the web page of Last.fm and register yourself if you haven't
2. Go to the API Web page and apply for an API Key (it is free if it doesn't have any commercial propose).
3. Copy and paste the API and the Secret into the class "PrivateAPIKey".