If you are annoyed that "Sources for Android 26" are not yet available via SDK manager, this might be for you:
- Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
#!/bin/bash | |
SOURCE=$1 | |
if [[ -z $SOURCE ]]; then | |
echo "Usage: $0 [source]" >&2 | |
exit | |
fi | |
sudo mkdir -p /mnt/sd1 |
If you are annoyed that "Sources for Android 26" are not yet available via SDK manager, this might be for you:
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
public class SupportVersion { | |
private SupportVersion() { | |
} | |
public static boolean isLollipopOrAbove() { | |
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; | |
} | |
public static boolean isMarshmallowOrAbove() { | |
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M; |
// based on: https://github.com/george-steel/android-utils/blob/master/src/org/oshkimaadziig/george/androidutils/SpanFormatter.java | |
public class StringSpan { | |
private static final Pattern PATTERN = Pattern.compile("%([^a-zA-z%]*)([[a-zA-Z%]&&[^tT]]|[tT][a-zA-Z])"); | |
private StringSpan() { | |
} | |
public static CharSequence format(@NonNull CharSequence format, Object... args) { | |
return format(Locale.getDefault(), format, args); |
#!/usr/bin/env sh | |
# export PATH=$PATH:~/Library/Android/sdk/platform-tools/ | |
case $1 in | |
"enter") | |
adb shell settings put global sysui_demo_allowed 1 | |
# display time 12:00 | |
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200 | |
# display full mobile data without type | |
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false |
public class DashedLineView extends View { | |
private static final int DEFAULT_COLOR = Color.BLACK; | |
private static final float DEFAULT_DASH = 4f; | |
private static final float DEFAULT_GAP = 2f; | |
private static final float DEFAULT_PHASE = 0f; | |
private final Paint paint = new Paint(); | |
private final Path path = new Path(); | |
private float dash; |
public enum UidUtils { | |
INSTANCE; | |
private final static String DEFAULT_ID = "anonymous"; | |
private String androidId = DEFAULT_ID; | |
private String advertisingId = ""; | |
private boolean limitAdTrackingEnabled = false; |
public final class Network { | |
private Network() { | |
} | |
public static @NonNull String doGetRequest(@NonNull String service, @NonNull String resource, | |
@NonNull List<Pair<String, String>> params, @NonNull List<Pair<String, String>> headers) throws IOException { | |
HttpURLConnection httpURLConnection = null; | |
try { | |
URL url = new URL( | |
service + "/" + Uri.encode(resource) + (params.isEmpty() ? "" : "&" + convertPairToParamString(params))); |
public class GifImageView extends ImageView { | |
private static final long DEFAULT_MOVIE_VIEW_DURATION = TimeUnit.SECONDS.toMillis(1); | |
private Movie movie; | |
private long movieStart; | |
private int movieCurrentAnimationTime; | |
private boolean running = false; | |
private boolean visible = true; |
public abstract class DRMVPFrameLayoutView<P extends DRMVPPresenter<V>, V extends DRMVPView> extends FrameLayout { | |
private P presenter; | |
public DRMVPFrameLayoutView(Context context, @Nullable AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public DRMVPFrameLayoutView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | |
super(context, attrs, defStyleAttr); | |
init(); |