This source code gives you the service which starts with start of every activity and stops with end of every activity. basic pupose is to calculate the current location if app is open.