Sync with Ion 2.4 & 2.5 Android Ion

Refactored the code to support both pre-2.5 and 2.5 Android Ion. 

Implements http://teampulse.telerik.com/view#item/271692
It actually is extracted under the name of prepareTmpDir, but I wanted to avoid unnecessary slow operations on the device. I will implement a cache for the name, so that device operations happen only once. Thanks for spotting!