Understanding Android Intent Filters (Receiving Implicit Intents)

Intents sends signals to the Android system telling it that some action needs to be performed by another component (activity, services, broadcast receivers) in the same app or a different app. The system starts resolving which component in which app is responsible to handle this event that just got triggered. Let’s see a simple example of an implicit intent that opens a webpage URL in the browser.

Continue reading

Understanding Explicit and Implicit Android Intents (App Component)

Any android application comprises one or more activities. In order to launch another activity from a particular activity (for example launch RegisterActivity from a click action in LoginActivity) we’ve to use a particular app component that android has called Intent. An Intent is basically an intention to do an action. It’s a way to communicate between Android components (not just activities) to request an action from and by different components. It’s like a message that Android listens for and react accordingly by identifying and invoking the appropriate app’s appropriate component (like an Activity, Service, Content Provider, etc.) within that same application or some other app. If multiple apps are capable of responding to the message then Android provides the user with a list of those apps from which a choice can be made.

Continue reading

Android PubNub Integration Tutorial (Setup and Basic Publish/Subscribe Usage)

PubNub is a lovely SaaS platform that helps us build realtime applications very fast without coding our own backend infrastructure. In my Android application I had to code a small chat piece where multiple people could chat in groups (similar to WhatsApp groups). The idea of this article is to quickly show you how to install the PubNub Android SDK in your app and get started.

Continue reading

Android Using a Scrollable ViewGroup Like ScrollView, ListView or GridView In a ScrollView With requestDisallowInterceptTouchEvent()

There are times when you want to have a scrollable ViewGroup like a ViewPager or a ListView or a GridView inside another scrollable ViewGroup like a ScrollView. You could have various combinations like a ViewPager in a ListView, a ViewPager and a ListView inside a ScrollView (this is what I had to do in my Android app), etc. in your application.

Continue reading

Understanding Android Input Touch Events System Framework (dispatchTouchEvent, onInterceptTouchEvent, onTouchEvent, OnTouchListener.onTouch)

On my journey of learning Android Development, I’ve realised that it is really important to understand the input handling especially how the entire touch events framework work. Wrapping your head around the entire propagation of touch events (including the gesture) is imperative else while coding you’ll find yourself stumped by the behaviour of different ViewGroups (or Views) when attaching touch listeners to them with the hope that your code works as expected when they actually won’t. It gets even tricker when you have ViewGroups like ViewPager or ListView (both scrollable) inside other scrollable ViewGroups like ScrollView.

Continue reading