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
apply from: "$rootDir/utils.gradle" | |
android { | |
defaultConfig { | |
buildConfigField 'String', 'SECRET_KEY', toJavaCodeString(SECRET_KEY) | |
} | |
} |
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
public static String saveBitmapToFile(String path) { | |
try { | |
File file = new File(path); | |
BitmapFactory.Options o = new BitmapFactory.Options(); | |
o.inJustDecodeBounds = true; | |
o.inSampleSize = 6; | |
FileInputStream inputStream = new FileInputStream(file); |
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.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; | |
public class EmptyRecyclerView extends RecyclerView { |
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
public static boolean isInternetAvailable() { | |
Runtime runtime = Runtime.getRuntime(); | |
try { | |
Process ipProcess = runtime.exec("/system/bin/ping -c 1 8.8.8.8"); | |
int exitValue = ipProcess.waitFor(); | |
Debug.i(exitValue + ""); | |
return (exitValue == 0); | |
} catch (IOException | InterruptedException e) { |
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 java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import android.content.Context; | |
import android.net.wifi.WifiManager; | |
import android.os.Build; | |
import android.provider.Settings.Secure; | |
import android.telephony.TelephonyManager; | |
public class UDID { |
NewerOlder