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 HeavyExternalLibrary { | |
private boolean initialized = false; | |
public HeavyExternalLibrary() { | |
} | |
public void init() { | |
try { | |
Thread.sleep(500); |
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 FlatBuffersParser { | |
static { | |
System.loadLibrary("FlatBuffersParser"); | |
} | |
public ByteBuffer parseJson(String json, String schema) { | |
final byte[] bytes = parseJsonNative(json, schema); | |
return ByteBuffer.wrap(bytes); | |
} |
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
ByteBuffer bb = ByteBuffer.wrap(bytes); | |
ReposList reposListFlat = frogermcs.io.flatbuffs.model.flat.ReposList.getRootAsReposList(bb); |
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
private class ColorTextInfo extends ItemHolderInfo { | |
int color; | |
String text; | |
//... | |
} |
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 ExampleApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
//Use it only in debug builds | |
if (BuildConfig.DEBUG) { | |
Dagger2Metrics.enableCapturing(this); | |
} | |
} |
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 ExampleApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
//Use it only in debug builds | |
if (BuildConfig.DEBUG) { | |
AndroidDevMetrics.initWith(this); | |
} | |
} |
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
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.frogermcs.androiddevmetrics:androiddevmetrics-plugin:0.3' | |
} | |
} |
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 ExampleApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
//Use it only in debug builds | |
if (BuildConfig.DEBUG) { | |
AndroidDevMetrics.initWith(this); | |
} | |
} |
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
apply plugin: 'com.android.application' | |
apply plugin: 'com.neenbedankt.android-apt' | |
apply plugin: 'com.frogermcs.androiddevmetrics' | |
repositories { | |
maven { | |
url "https://oss.sonatype.org/content/repositories/snapshots" | |
} | |
} | |
//... |
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
@ProducerModule | |
public class GithubApiProducerModule { | |
@Produces | |
static OkHttpClient produceOkHttpClient() { | |
final OkHttpClient.Builder builder = new OkHttpClient.Builder(); | |
if (BuildConfig.DEBUG) { | |
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); | |
logging.setLevel(HttpLoggingInterceptor.Level.BODY); | |
builder.addInterceptor(logging); |