AsyncTask in Java and doing HTTP calls

Most HTTP or REST API calls are done asynchronously. In Java, that means having to make use of the AsyncTask class to execute such calls. You can do a HTTP protocol based call inside of a class that extends the AsyncTask class. AsyncTask is designed to be a helper class around Thread and Handler and…

Working with a Service for Android

This tutorial is intended to be a quick guide to get you up and running with basic Service knowledge for Android. Ideally, you can visit here for more in depth information. Whats a service? A Service is an application component that can perform long-running operations in the background, and it does not provide a user…

Playing music/sound on Android project

Playing a sound or music in Android is very easy to do. It consists using mostly the MediaPlayer class. I will base this tutorial on the Android Service tutorial I did. Using MediaPlayer as a service is very common. For this tutorial, I will only use methods that will get you started, I won’t go…

Notification implementation for Android

Implementing notifications in Android is simple enough to do. Notifications give your app more richness and you can display messages or other information, even a couple tasks/buttons. Here’s a very simple notification implementation that consists of simple text and an icon. You can also add action buttons to your notifications, see here: http://www.vogella.com/tutorials/AndroidNotifications/article.html#example-notificationmanager

How to obtain current location with Android (Java)

Suppose in your app you would like to obtain the current location of the device. In other words, obtaining stuff like latitude, longitude, and city. Its very simple to do so with Android. You’ll first need to import… To obtain the latitude and longitude To obtain the city Lastly, if you wanted to be even…