Android : Around me (remote provider)

android-256This tutorial is about creating the remote provider of places for the “Around me” tutorial. If you have not read the first part, you must read it first : Around Me tutorial. The RemotePlaceProvider consists in loading the near points from a remote webservice. The first question you may ask is how to set up quickly a backend server with REST/JSON webservices and geoloc features. The answer is Mongolab, a database-as-a-Service (DBaaS) platform. In this tutorial, i will first describe the steps to configure your mongolab database, then i will explain about the client code for Android.

Read more...

Android : Around Me (local provider)

android-256This tutorial is about creating the local provider of places for the “Around me” tutorial. If you have not read the first part, you must read it first : Around Me tutorial. The LocalPlaceProvider consists in loading the near points in the database. Sqlite has no geo feature and this is problematic. I have used the following solution described in this great blog : Query by proximity in Android. To resume, we first start a sql query using a sort and a limit. The result may have small errors so we sort it again in Java using a Comparator and the Android API.

Read more...

Android : Around me Tutorial

android-256This android tutorial deals about creating an “Around me” screen for your application. “Around me” shows near places around you using your current location. There are different possibilities to retrieve the near points.

The first one is to use Google Places API. You can use it for common places but it may not fit your needs :

The conclusion may be for you : DIY (do it yourself) and this is precisely the goal of this tutorial. I will show you two possible solutions :

Look at the video below to see the result of the tutorial :

Read more...

Android: PreferenceFragmentCompat

Unfortunately, PreferenceFragmentCompat is missing in android support library. In this tutorial, i show you a possible implementation that you can use until Google makes its own.

Read more...

Android : Volley and Gson tutorial

Android Volley is the new way to make network requests. It has a lot of advantages : configurable thread pool, request priority, caching, request cancel. AsyncTask is no more needed and this is a good new as AsyncTask is known for its memory leak issues. In this quick step tutorial, i show the piece of source code to make it work with google gson library.

Read more...

Android : Navigation Drawer

A few days ago, i wrote a tutorial about creating a sliding menu using the SlidingMenu library. Since, Google has introduced the NavigationDrawer in the android support library. This tutorial shows you how to use it.

Read more...

Android : AsyncTask in fragment – Best pratices

This article shows you how to code properly an asynctask inside a fragment. This is an update of the article Android : AsyncTask – Best pratices that shows you how to code an asynctask with an activity. With a fragment, it is much simplier because you don’t have to manage rotation as the fragment can be set to retainInstance and survive on configuration changes (rotation).

Read more...

Android : Sliding Menu – Part 2/2

This is the second part of the SlidingMenu tutorial. In this part, we will see how to create a nice menu with sections and items. For that, we will use an ExpandableListView.

Read more...

Android : Sliding Menu – Part 1

This android tutorial teaches you how to add a sliding menu inside your application. It is a two part tutorial. The first part is about installing the SlidingMenu library and creating an empty sliding menu. The second part will explain how to fill the sliding menu with sections and menu items. You can watch the video below to see the result.

Read more...

Android : Refresh item inside action bar using circular ProgressBar

This android tutorial is about adding a refresh item in the action bar. When refreshing is disabled, a simple image is shown. When refreshing is running, a circular progressbar is shown. Let’s see the screenshots below to show the results.

Read more...

Next Page →