Understanding Android Spinners and Populating Them with (Adding) a Set of Items

Spinners in Android are like select dropdowns (HTML) of web development. Once tapped, it shows a list of options in a dropdown menu from which one can select a value. It is very simple to add it as a View in the Layout file (just as any other view like TextView or EditView):

Continue reading “Understanding Android Spinners and Populating Them with (Adding) a Set of Items”

Android Dividing Your ListView Into Sections with Group Headers

ListView is commonly used to display a set of data in a list. For example a list of emails, messages, tasks or contacts. I’ve written an article on how to work with lists in android before, which you might want to read.

Continue reading “Android Dividing Your ListView Into Sections with Group Headers”

Understanding and Implementing Android Lists with ListView, ExpandableListView, ListFragment, ListActivity and Custom List Adapters

There are times when you want to display data as a list. For example a list of emails, a list of messages, a list of tweets, a list of post titles, a list of photos with their titles and other meta data like dates and summary. Android provides 2 classes with the help of which we can achieve a scrollable list of items in our mobile application:

  • ListView – Show items in a vertically scrolling list.
  • ExpandableListView – Similar to ListView but supports grouping of items that can be expanded individually to show its childrens.

Continue reading “Understanding and Implementing Android Lists with ListView, ExpandableListView, ListFragment, ListActivity and Custom List Adapters”

Prevent Touch Panning and Zooming on Mobile Web Pages with CSS touch-action Property

The new touch-action property from the CSS Pointer Events spec can help us (as developers) specify what sort of manipulation (panning, zooming, etc.) should be allowed by a user in a particular region (one or more DOM elements) in a specific web page on a mobile device. It helps specify the sort of interactions or gestures allowed by the user in one or both axis.

Continue reading “Prevent Touch Panning and Zooming on Mobile Web Pages with CSS touch-action Property”

Android Pick/Select Image from Gallery with Intents

Sometimes in your Android application you’ll want the user to choose an image from the gallery that’ll be displayed by the application (and even uploaded to your servers) after the selection is made. In this article we’ll see how to invoke a single interface from which the user is able to select images across all his apps (like Gallery, Photos, ES File Explorer, etc.) and folders (Google Drive, Recent, Downloads, etc.) using Intents.

Continue reading “Android Pick/Select Image from Gallery with Intents”