Code example for StatFs

Methods: getBlockSize, getFreeBlocks

0
			  componentToDisable,
			  PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
	} 
	 
	private boolean checkAvailableSpace(long bytesNeeded){
		StatFs stat = new StatFs(Environment.getDataDirectory().getPath());
	    long bytesAvailable = (long)stat.getFreeBlocks() * (long)stat.getBlockSize();;
	    return (bytesAvailable > bytesNeeded);
	} 
	 
	public enum PhotoDownloadResult{ 
		SUCCESS, INSUFFICIENT_STORAGE;
	} 
	 
	protected void onResume(){ 
		super.onResume(); 
		collectionId = getIntent().getExtras().getString("cid");
		dbAdapter = LivePaperDbAdapter.getInstanceOf(getApplicationContext());
	} 
}