Code example for File

Methods: existsgetAbsolutePath

	public Drawable retrieveNetworkDrawable(String url) {
		try { 
			String name = url.hashCode() + ".png";
			File f = new File(TiApplication.getInstance().getCacheDir()
					+ name);
			if (!f.exists())
				downloadImage(_proxy.resolveUrl(null, url), f);
			return Drawable.createFromPath(f.getAbsolutePath());
		} catch (Exception e) {
			Util.e("Hit exception while downloading image " + url, e);
		return null; 
	private void downloadImage(String url, File f) throws IOException {
		URL myFileUrl = new URL(url);
		HttpURLConnection conn = (HttpURLConnection) myFileUrl.openConnection();
Connect your IDE to all the code out there  Get Codota for Java