QuickTip: Store Undefined and Null in Class/Table Rows on Parse.com
I’ve been working on an Android app backed by Parse.com to make my development process faster and easier. So while coding the app I made a decision to have 2 classes (tables) called Conversations and...
View ArticleQuick Tip: Android Convert byte[] Data to ImageView
Let’s say you have a byte[] array of image data that you want to convert into an Image by showing up in an ImageView in your layout. We can achieve that with a few lines of code. We convert our byte...
View ArticleDetecting 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...
View ArticleUsing onTouchEvent() and View.OnTouchListener Interface to Detect Common...
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...
View ArticleQuick 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...
View ArticleAndroid ViewFlipper and ViewSwitcher with GestureDetector Swipes/Flings
While developing an Android application, most of us will encounter the need to integrate a section in our app where the user can switch between Views. So it should show one view which can be an...
View ArticleAndroid Swipe (Touch Gesture) Views Using ViewPager, FragmentPagerAdapter and...
Swipe Views are an efficient way to allow the user to laterally navigate among related data items spread across multiple panes using a simple touch gesture (swipes/flings), making access to data faster...
View ArticleAndroid PagerTabStrip and PagerTitleStrip with ViewPager
Note: This post is sort of a continuation of my previous post on ViewPager and its related pager adapters with tabs. When working with ViewPager we most likely include action bar tabs and integrate...
View ArticleQuick Tip: Android Add Image to PagerTabStrip or PagerTitleStrip
If you’ve ever wanted to place images instead of text in the PagerTabStrip or PagerTitleStrip or even a combination of text and image, then that is surely possible. Here’s how your getPageTitle()...
View ArticleAndroid Image Slideshow using ViewPager with PagerAdapter
We’ve already discussed ViewPager in depth in one of my earlier posts. We saw how to use it with specific PagerAdapter implementations like FragmentPagerAdapter and FragmentStatePagerAdapter that works...
View ArticleADB Genymotion Upgrade Issue: Devices Not Showing Up (“adb server is out of...
I upgraded a lot of things on my system. From Mavericks to Yosemite (upgrading the entire Mac operating system itself) to upgrading the Android SDK with Eclipse as well as Android Studio from 0.6.1 to...
View ArticleExecute ADB Commands To Query a Particular Android Device/Emulator
When using the versatile Android Debug Bridge (adb) tool to issue commands, if there’s only one device or emulator attached then that’s fine as the commands will be executed on exactly that. But if...
View ArticleGet Application APK File from Android Device on Your Computer
In this quick tip, we’ll see how to use the excellent Android Debug Bridge (adb) tool on the command line to list all the installed packages on our android device (non-rooted in my case) and then...
View ArticleAndroid Application Data Storage With SharedPreferences
Android has a concept of shared preferences using which application preferences data can be stored persistently. That means the data or state won’t be lost until the application is uninstalled. The...
View ArticleAndroid Saving Files on Internal and External Storage
Android allows us to store files in its file system which is quite similar to any other Linux filesystem that you must have experience with. Using the java.io file input/output APIs we can start...
View ArticleAndroid Add Views or View Groups Below a ListView or GridView
You might be thinking showing up a View like TextView, ImageView, EditText, Button, etc. or a ViewGroup (wrapping other Views) itself like RelativeLayout or LinearLayout must be easy. It’s not. Not in...
View ArticleAndroid Emulator HierarchyViewer “Unable to get view server protocol version...
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...
View ArticleUnderstanding Android Input Touch Events System Framework
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...
View ArticleAndroid Using a Scrollable ViewGroup Like ScrollView, ListView or GridView In...
There are times when you want to use 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...
View ArticleHow to Check/Detect Whether Current Thread is UI/Main Thread or Not in Android
Checking whether the current thread is the UI/Main thread or some other background thread is very easy. Here’s the code for it: Bonus: If you’re in a thread other than the UI Thread and you want to...
View Article