Knowledge7

The Linux and Mobile Solution Provider

  • About
  • Training
  • Services
  • Clients
  • In the news
  • Blog
  • Contact Us
You are here: Home / Topic / Services and Notifications

Services and Notifications

This topic is part of our Android Application Development training

Some Android application depend on data available on the Web. For example, a TopTracks application might show the top 10 tracks of a given artist using a web service such as AudioScrobbler.

Downloading this data can be slow and it is preferable to use a service to do that. In this way, the “main screen” of the application is an Activity and only takes care of displaying the user interface and starting / stopping the download service.

The application to develop allows the user to enter the name of an artist:

Click on Show Tracks does not necessarily display the tracks as this requires the track information to be downloaded first. This is done by clicking on Start Service.

When the data has been downloaded, the service displays a notification in the status bar telling the user that the top tracks have been downloaded. It is only then that the user can click on Show Tracks to get:

This topic is part of our Android Application Development training

Our forthcoming training courses

  • No training courses are scheduled.

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for something?

Want to know more?

Get our newsletter

Discover the latest news, tips and tricks on Linux, the Web and Mobile technologies every week for FREE

This work is licensed by Knowledge7 under an Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.