Detecting hand gestures on Samsung Galaxy.

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.

Storing files privately on Android and opening them using an external application.

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.

Android, JavaScript and Python compatible RSA Encryption.

It’s extremely painful to implement RSA Encryption so that data encrypted on either of these platforms can be easily decrypted on the other platforms and even more so for someone like me who had almost zero knowledge of programming using encryption algorithms. While developing an initial pairing mechanism for Ambient Dynamix, I had already settled… Continue reading Android, JavaScript and Python compatible RSA Encryption.

Using JmDNS for service advertisement and discovery on android.

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.

Inflating different xml layouts in an Android ListView for different Objects.

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.

Hiding a list item from an Android ListView without removing it from the data source.

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.

Detecting up-down, left-right swipe on Android.

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.