Home » Android » Page 20

Android

Android Bound Service: IPC with Messenger

In this post, we want to talk about Android Bound Service. A bound service is a service that allows other android components (like activity) to bind to it and send and receive data. In the previous post, we talked about local service and we saw how we can create a service, start and stop it. A bound service is a ...

Read More »

Android Service Tutorial

In this post, we want to talk about Android Service. This is a key component in developing Android app. Differently from Activity, Service in Android runs in background, they don’t have an interface and have a life-cycle very different from Activities. Using Service we can implement some background operation, for example we can suppose we want to load a web ...

Read More »

Android Tutorial : Two methods of passing object by Intent (Serializable,Parcelable)

In this post, I will show you an simple example of how to pass object by intent in Android application. Parcelable and Serialization are used for marshaling and unmarshaling Java objects. In Parcelable, developers write custom code for marshaling and unmarshaling so it creates less garbage objects in comparison to Serialization. The performance of Parcelable over Serialization dramatically improves (around ...

Read More »

YouTube GData API and Android

If you want to use the YouTube API v2 to search for content on YouTube with an Android device, the recommended way is the use the gdata-http-client java package. However, this requires that you parse the XML returned yourself, and navigate it. The reason is that out of the box the YouTube API v2 java library doesn’t work on Android. ...

Read More »

Storing Objects in Android

One alternative to using SQLite on Android is to store Java objects in SharedPreferences. Here, we’ll look at two different ways to do that. Why not go for SQLite for all storage needs? The reasons can be varied: besides the impedance mismatch between object orientation and relational databases, SQLite might be overkill (brings more overhead) for some simple use cases, ...

Read More »

Android Volley dynamic ListView: AsyncTask comparison

In this post, I will describe first how to use Volley to populate dynamically a ListView, and then compare it against AsycnTask. In this post, we will invoke a remote service to get contact information in JSON format, and we populate the items inside a ListView.This simple example is very useful to understand Volley library and how we can integrate ...

Read More »

Android Volley Tutorial: Post and download image

In this post, I want to describe how to use a very powerful and easy to use library for Android. This library is called Volley and it can be used to handle networking connection. In previous post, we talked about HttpUrlConnection and Apache HTTP client. They are both valid and useful but using Volley we can simplify our work. Volley ...

Read More »