#Android best practices
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.content.Context; | |
import android.support.annotation.NonNull; | |
import com.google.android.gms.tasks.OnCompleteListener; | |
import com.google.android.gms.tasks.Task; | |
import com.google.firebase.remoteconfig.FirebaseRemoteConfig; | |
public class RemoteConfigManager { | |
public static final String KEY_STABLE_VERSION = "stable_version"; |
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.content.Context; | |
import android.support.annotation.NonNull; | |
import java.lang.ref.WeakReference; | |
import timber.log.Timber; | |
/** | |
* Our custom TimberTree that lets us output to a file via an {@link android.app.IntentService} | |
* like {@link TimberService} |
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.content.Context; | |
/** | |
* A basic implementation of {@link Id} to be used in non play-services environments | |
*/ | |
public class BasicId extends Id { | |
/** | |
* Get an analytics ID for non play-services powered devices, uses UUID to get the id | |
* @param context | |
* @return |
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.content.Context; | |
import java.util.UUID; | |
/** | |
* This generates an anonymous user id for analytics | |
*/ | |
public abstract class Id { | |
abstract public String getId(final Context context); |
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.content.Context; | |
import android.support.annotation.Nullable; | |
import com.google.android.gms.ads.identifier.AdvertisingIdClient; | |
import com.google.android.gms.common.GooglePlayServicesNotAvailableException; | |
import com.google.android.gms.common.GooglePlayServicesRepairableException; | |
import com.google.firebase.iid.FirebaseInstanceId; | |
import java.io.IOException; |
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
compile 'cc.soham:toggle:0.1' |
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
{"name": "myapp", "features": | |
[ | |
{"name":"video", "default": "enabled", "rules":[ | |
{"state": "disabled", "value": | |
{"apilevel_min": 21, "apilevel_max": 23, "device":[{"manufacturer":"xiaomi","model":"mi3"}, {"manufacturer":"samsung", "model":"s4"}]} | |
}, | |
{"state": "disabled", "value": {"appversion_max": 13}} | |
]}, | |
{"name":"crash_reporting", "rules":[ | |
{"state": "disabled", "value": |