public static BufferedImage getImage(final String name, final String URL, final String format) {
        final File file = new File(Environment.getStorageDirectory(), name);
        try {
            if (!file.exists()) {
                final BufferedImage image = ImageIO.read(new java.net.URL(URL));
                ImageIO.write(image, format, file);
                return image;
            } else
                return ImageIO.read(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }