The Gesture SDK on Samsung Galaxy phones supports an interesting feature of detecting palm movements in front of the screen. The issue however is that they’re only supported on Galaxy S5, Note3 and Note4 devices and since December 2014, Samsung provides no further updates for the SDK for new Samsung mobile devices. But it’s still… Continue reading Detecting hand gestures on Samsung Galaxy.
This blog will be divided into two parts. First, how can we store files in the private storage of our Android application so that it is not directly accessible by other applications running on the device, such as the file manager and second, how to open these files using an external application. Step 1 :… Continue reading Storing files privately on Android and opening them using an external application.
While working on the Ambient Dynamix project, I needed to search for android devices running the Dynamix framework from a python based application running on the desktop. Starting API 16, android provides the NSDManager class to advertise and search for services. However, to be able to support pre android 16 devices, I used the JmDNS… Continue reading Using JmDNS for service advertisement and discovery on android.
While working on the Ambient Dynamix Project, I needed to create a listview which contains a non fixed number of headers each one followed by some list items. A common solution is to use the MergeAdapter. A MergeAdapter object exposes the addAdapter(), addView() and addViews() methods. The demo included in the repo is pretty self… Continue reading Inflating different xml layouts in an Android ListView for different Objects.
Ideally when I have to remove a list item from a listview, I’d remove the data object from the collection which the adapter uses and then do a adapter.notifyDataSetChanged() call which’ll redraw the list view. Consider an adapter which uses an array list of Strings. Now, to delete an item from the ListView, But this… Continue reading Hiding a list item from an Android ListView without removing it from the data source.
This probably is the simplest way to detect the exact swipe direction on Android. We split the screen into four quadrants and then use the MotionEvents to calculate the angle of swipe. The code is pretty self explanatory. To check out how to use this SwipeGestureDetector class with the relevant view, check out this post… Continue reading Detecting up-down, left-right swipe on Android.