Quick Tip: Android ViewFlipper Jump/Move/Switch To a Certain Child View

At times you might want to jump the user to a specific View inside a ViewFlipper on the click of some other View or some such scenario. So let’s say we have a ViewFlipper in our layout resource like this:

Continue reading “Quick Tip: Android ViewFlipper Jump/Move/Switch To a Certain Child View”

Using onTouchEvent() and View.OnTouchListener Interface with MotionEvent to Detect Common Gestures Like Tap and Swipes on Android

Touch gestures like tapping, swiping vertically/horizontally, panning, etc. occurs when a user places one or more fingers on the screen and by the time the last finger looses contact, the entire pattern of finger movements is interpreted as a particular gesture by your android application. First all the relevant data of touch events are gathered and then they’re interpreted to see which gestures they match and the pertaining actions are executed as specified in the code.

Continue reading “Using onTouchEvent() and View.OnTouchListener Interface with MotionEvent to Detect Common Gestures Like Tap and Swipes on Android”

Detecting Common Gestures on Android Using GestureDetector

Gestures are those subtle motions to trigger interactions between the touch screen and the user. It lasts for the time between the first touch on the screen to the point when the last finger leaves the surface. We’re all familiar with it as it’s the most common way to communicate with apps on our mobiles, tablets, etc. these days. Some examples are scrolling in an app by swiping vertically/horizontally, pinch to zoom, long press to select and so on.

Continue reading “Detecting Common Gestures on Android Using GestureDetector”

Understanding GridView in Android with Custom Adapters by Building an Image Gallery

GridView is a ViewGroup just like ListView that allows us to display items in a two-dimensional scrolling grid. Just like a ListView the data into a GridView is populated by an Adapter (ListAdapter) that fetches data from various sources like an array or a database. It’s mostly used to build image, video, audio galleries.

Continue reading “Understanding GridView in Android with Custom Adapters by Building an Image Gallery”

Android Realtime (Instant) Search with Filter Class and Filterable Interface Using Custom and Inbuilt Adapter

Android has an excellent Fitler class that helps us filter data from an entire data set based on some pattern (for example a string) provided. Filters are usually created by classes implementing the Filterable interface. It makes sense to use filters (implement the Filterable interface) mostly with adapters, which means Filterable classes are usually Adapter implementations.

Continue reading “Android Realtime (Instant) Search with Filter Class and Filterable Interface Using Custom and Inbuilt Adapter”

Adding Search Functionality to Your Android Application Activity with SearchView and Search Dialog

If you’re building an android application, then most likely you’ll need to implement a search in it to let the user search through a set of data that could be emails, messages, chats, photos, files, etc. Android provides us with a search widget called SearchView that provides a user interface for the user to enter a search query and submit the request. The preferred way to use this widget to provide search in our application is to use it in the action bar.

Continue reading “Adding Search Functionality to Your Android Application Activity with SearchView and Search Dialog”