public File createTempFile(final String fileName) {
        File outputDir = null;
        try {
            outputDir = context.getCacheDir(); // context being the Activity pointer
            if (fileName == null) {
                return File.createTempFile("cgeo_tempfile_", ".tmp", outputDir);
            }
            final File tempFile = new File(outputDir, fileName);
            return tempFile.createNewFile() ? tempFile : null;
        } catch (IOException ie) {
            reportProblem(R.string.contentstorage_err_create_failed, ie, false, fileName, outputDir);
        }
        return null;
    }
Helper method, meant for usage in conjunction with {@link #writeFileToFolder(PersistableFolder, FileNameCreator, File, boolean)}
main/src/main/java/cgeo/geocaching/storage/ContentStorage.java