This is a cleaned up version of code posted here: http://www.eevblog.com/forum/thermal-imaging/question-about-flir-one-for-android/
All credit goes to tomas123, cynfab etc from that forum who did the awesome research and work to make this support.