Use getTemporaryDirectory instead of hard-coding /tmp