This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleActivity extends Activity { | |
/** | |
* A string constant to use in calls to the "log" methods. Its | |
* value is often given by the name of the class, as this will | |
* allow you to easily determine where log methods are coming | |
* from when you analyze your logcat output. | |
*/ | |
private static final String TAG = "SampleActivity"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CompatibilityUtil { | |
/** | |
* Get the current Android API level. | |
*/ | |
public static int getSdkVersion() { | |
return Build.VERSION.SDK_INT; | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class AlbumStorageDirFactory { | |
/** | |
* Returns a File object that points to the folder that will store | |
* the album's pictures. | |
*/ | |
public abstract File getAlbumStorageDir(String albumName); | |
/** | |
* A static factory method that returns a new AlbumStorageDirFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseAlbumDirFactory extends AlbumStorageDirFactory { | |
/** | |
* For pre-Froyo devices, we must provide the name of the photo directory | |
* ourselves. We choose "/dcim/" as it is the widely considered to be the | |
* standard storage location for digital camera files. | |
*/ | |
private static final String CAMERA_DIR = "/dcim/"; | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FroyoAlbumDirFactory extends AlbumStorageDirFactory { | |
@Override | |
public File getAlbumStorageDir(String albumName) { | |
return new File( | |
Environment.getExternalStoragePublicDirectory( | |
Environment.DIRECTORY_PICTURES | |
), | |
albumName | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleActivity extends Activity { | |
private AlbumStorageDirFactory mAlbumFactory; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
/* Implementation not shown */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.accounts.Account; | |
import android.accounts.AccountManager; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.content.SharedPreferences.Editor; | |
import android.os.Build; | |
import android.preference.PreferenceManager; | |
import com.google.android.gms.auth.GoogleAuthUtil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleActivity extends Activity { | |
private final Handler mLeakyHandler = new Handler() { | |
@Override | |
public void handleMessage(Message msg) { | |
// ... | |
} | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require all the things | |
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
gutil = require('gulp-util'), | |
plumber = require('gulp-plumber'), | |
rename = require('gulp-rename'), | |
minifyCSS = require('gulp-clean-css'), | |
prefixer = require('gulp-autoprefixer'), | |
connect = require('gulp-connect'); | |
cp = require('child_process'); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.