Back to project page TrackEveryPenny.
The source code is released under:
Apache License
If you think the Android project TrackEveryPenny listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ca.jbrains.upfp.model.android; /*from w w w. j a v a 2s . c o m*/ import android.os.Environment; import ca.jbrains.upfp.controller.android.*; import java.io.File; public class AndroidDevicePublicStorageGatewayImpl implements AndroidDevicePublicStorageGateway { public String getExternalStorageState() { return Environment.getExternalStorageState(); } public File getExternalStoragePublicDirectory() { return Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DOWNLOADS); } @Override public File findPublicExternalStorageDirectory() throws PublicStorageMediaNotAvailableException, PublicStorageMediaNotWritableException { if (Environment.MEDIA_MOUNTED.equals( getExternalStorageState())) return getExternalStoragePublicDirectory(); if (Environment.MEDIA_MOUNTED_READ_ONLY.equals( getExternalStorageState())) throw new PublicStorageMediaNotWritableException( getExternalStoragePublicDirectory()); throw new PublicStorageMediaNotAvailableException(); } }