class: center, middle, title-slide
This file contains hidden or 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.app.Activity; | |
import android.app.Application; | |
import android.os.Bundle; | |
import com.google.analytics.tracking.android.EasyTracker; | |
public class MainApplication extends Application { | |
private boolean locationNeedsUpdated = true; | |
private int createdActivityInstanceCount = 0; | |
This file contains hidden or 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
/** | |
* In the absence of Java 8, here is our Optional duplicated code. Other than the package name, | |
* this should be a subset of this API, http://docs.oracle.com/javase/8/docs/api/java/util/Optional.html | |
*/ | |
public final class Optional<T> { | |
public static <T> Optional<T> of(T value) { | |
if (value == null) { | |
return Optional.empty(); | |
} |
This file contains hidden or 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 com.google.gson.Gson; | |
import java.io.IOException; | |
public class GsonParser implements Parser { | |
@Override | |
public <T> T parse(String json, Class<T> clazz) throws IOException { | |
return new Gson().fromJson(json, clazz); | |
} | |
} |
This file contains hidden or 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
package com.mycompany.myapp.app; | |
import android.app.Application; | |
import android.content.Intent; | |
import com.google.android.gms.common.GooglePlayServicesUtil; | |
import com.google.android.gms.security.ProviderInstaller; | |
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener; | |
public class MainApplication extends Application { |
This file contains hidden or 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
#!/bin/sh | |
rm -rf app | |
mkdir -p app/src/main/java/com/mycompany/myapp | |
echo "import com.mycompany.myapp.R;" > app/src/main/java/com/mycompany/myapp/Test.java | |
echo "com.mycompany.myapp.SomeActivity" > app/AndroidManifest.xml |
This file contains hidden or 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.text.Selection; | |
import android.text.Spannable; | |
import android.text.SpannableStringBuilder; | |
import android.text.TextPaint; | |
import android.text.method.LinkMovementMethod; | |
import android.text.style.ClickableSpan; | |
import android.view.View; | |
import android.view.View.OnAttachStateChangeListener; | |
import android.widget.TextView; |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" > | |
<translate | |
android:duration="@android:integer/config_shortAnimTime" | |
android:fromXDelta="-100%" | |
android:toXDelta="0" /> | |
</set> |
This file contains hidden or 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.os.Build; | |
import android.util.Log; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.InetAddress; | |
import java.net.Socket; | |
import java.net.SocketAddress; | |
import java.net.SocketException; |
This file contains hidden or 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
package com.androidfu.nowplaying.app.api; | |
import android.content.Context; | |
import com.androidfu.nowplaying.app.util.Log; | |
import com.androidfu.nowplaying.app.util.Preconditions; | |
import com.jakewharton.byteunits.DecimalByteUnit; | |
import com.squareup.okhttp.Cache; | |
import com.squareup.okhttp.OkHttpClient; |