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

Android Emulator HierarchyViewer “Unable to get view server protocol version from device” Error

If you’re running your application in the Android Emulator and suddenly the Hierarchy Viewer stops loading up the View Hierarchy in the standalone tool or in Android Device Monitor then chances are high that ADB server needs to be restarted in order to fix it.

Continue reading