System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
import android.util.Log; | |
import com.squareup.leakcanary.AnalysisResult; | |
import com.squareup.leakcanary.DisplayLeakService; | |
import com.squareup.leakcanary.HeapDump; | |
import retrofit.RestAdapter; | |
import retrofit.RetrofitError; | |
import retrofit.http.Multipart; | |
import retrofit.http.POST; | |
import retrofit.http.Part; | |
import retrofit.mime.TypedFile; |
@Test | |
public void login_successIfUserNameAndPasswordIsValid() { | |
// Arrange | |
String username = "username"; | |
String password = "password"; | |
when(userRepository.isUsernameValid(username)).thenReturn(true); | |
when(userRepository.isPasswordValid(password)).thenReturn(true); | |
// Act |
public class Order { | |
private String id; | |
private String origin; | |
private double price; | |
public Order(String id, String origin, double price) { | |
this.id = id; | |
this.origin = origin; |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
import android.animation.TypeEvaluator; | |
import android.animation.ValueAnimator; | |
import static java.lang.Math.pow; | |
public class GammaEvaluator implements TypeEvaluator { | |
private static final GammaEvaluator sInstance = new GammaEvaluator(); | |
/** |
import java.io.Serializable; | |
/** | |
* The perfect implementation of Singleton design pattern | |
* Properly solves all the below mentioned problems in Singleton pattern | |
* <p> | |
* 1) Attack using Reflection API | |
* 2) Problems from serialization/deserialization of your object | |
* 3) Problems from cloning your object | |
* 4) Uncertainty in a multi-threaded environment |
package com.sjl.util; | |
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.util.Log; | |
import java.util.List; |
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc