RecyclerView Adapters part 2: RecyclerView Cursor Adapter

In the Android platform, a CursorAdapter is an Adapter that exposes data from a Cursor object to a ListView widget. This second post about RecyclerView Adapters will explain on how to make a simple and reusable Cursor adapter yourself, and how to use it in your application. In a third post about RecyclerView Adapters, I’ll show a more advanced version of this CursorAdapter class.

Continue Reading

RecyclerView Adapters part 1: RecyclerView Array Adapter

Nowadays most Android developers use the new RecyclerView instead of a ListView or GridView. The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views.

The sad thing is that Google didn’t provide us with a set af default RecyclerView Adapter classes to extend from, like they previously did for the ListView. The first one I’ll discuss is a RecyclerView Array Adapter, which allows you to easily bind a List of objects to your RecyclerView.

Continue Reading

Share private files with other apps: FileProvider

Sharing a private file with other apps, it’s a challenge every Android developer will have to tackle someday. You will spend hours on this, probably give up, and then finally end up on this blog to find out how to implement this feature.

Continue Reading

LinearLayoutICS, another great Class in the support library

swapCursor vs changeCursor, what’s the difference?

Implementing a ListView is probably one of the first things you do when learning Android development. At In the Pocket, we use them a lot. To make everything work as smooth as possible, all Android developer at In the Pocket agreed to use CursorAdapters as much as possible. You probably wonder why we do this? Continue Reading


Support v7 appcompat & options menu

Some time ago, Google made its own backport of the famous ActionBar. The times of ActionBar Sherlock are finally over, and that’s a good thing. There has already been written a lot about using the Support ActionBar, so I won’t bother you with that. I’m going to talk about a small detail, but yet a very important one: using the Options Menu.

Continue Reading

Something you must know about the AlarmManager class

If you already worked on a few Android applications, you probably also used the AlarmManager class to schedule alarms (like pending notifications). This all seems pretty straight forward, and it is, but there is a small detail you should know about and never forget when scheduling alarms.

Continue Reading