public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // ... TextView notPaidText = findViewById(R.id.not_paid); ObjectAnimator colorAnim = ObjectAnimator.ofInt( notPaidText, "textColor", Color.parseColor("#50ff0000"), Color.parseColor("#00ffffff") ); colorAnim.setEvaluator(new ArgbEvaluator()); colorAnim.setDuration(10000); TimeInterpolator baseInterpolator = colorAnim.getInterpolator(); colorAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { if (animation.getInterpolator() instanceof AccelerateDecelerateInterpolator) { animation.setInterpolator(new ReverseInterpolator()); } else { animation.setInterpolator(baseInterpolator); } animation.start(); } }); colorAnim.start(); } public class ReverseInterpolator implements Interpolator { private final Interpolator delegate; public ReverseInterpolator(Interpolator delegate) { this.delegate = delegate; } public ReverseInterpolator() { this(new LinearInterpolator()); } @Override public float getInterpolation(float input) { return 1 - delegate.getInterpolation(input); } } }
Batch script for converting mp4 to gif using ffmpeg
Here is the batch script:
@echo off for %%i in (*.mp4) do ( ffmpeg.exe -i "%%i" "%%i".gif move "%%i".gif gif move "%%i" mp4 )
Batch script for installing apks in folder
Here is the batch script:
@echo off for /r %%i in (*.apk) do ( echo "Installing %%i"; adb install -r "%%i" )
Or you can just download it.
Get current Activity name by adb shell
Here is the command:
adb shell "dumpsys window windows | grep -E 'mCurrentFocus'"
The output would be:
mCurrentFocus=Window{b6a99d1d0 u0 com.sec.android.app.launcher/com.sec.android.app.launcher.activities.LauncherActivity}
My activity name is: LauncherActivity
Create “create folder yyyy-MM-dd” from context menu
Here is the script. All You have to do is just edit path to Android icon.
create RainbowSpan effect
public class RainbowSpan extends CharacterStyle implements UpdateAppearance { private final int[] colors; public RainbowSpan(Context context) { colors = new int[]{ Color.parseColor("#FF0033"), Color.parseColor("#FF8000"), Color.parseColor("#FFE600"), Color.parseColor("#1AB34D"), Color.parseColor("#1A66FF"), Color.parseColor("#801AB3") }; } @Override public void updateDrawState(TextPaint paint) { paint.setStyle(Paint.Style.FILL); Shader shader = new LinearGradient( 0, 0, 0, paint.getTextSize() * colors.length, colors, null, Shader.TileMode.MIRROR); Matrix matrix = new Matrix(); matrix.setRotate(90); shader.setLocalMatrix(matrix); paint.setShader(shader); } }
Android xml rectangle border
Simple xml code for rectangle border with transparent background:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="2dp" /> <stroke android:width="2px" android:color="@color/white" /> </shape>

Android xml drop shadow
Simple xml code for shape drop shadow:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="@android:color/transparent" android:endColor="#88333333" android:angle="90"/> </shape>

Raspberry Pi – what Raspberry Pi I have?
All You need is to call in terminal this:
grep Revision /proc/cpuinfo
After You get something like this:
Revision : a22082
Go to page https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
and search it in text.

Below is a list of information dated as of 08/02/2019 :
Code | Model | Revision | RAM | Manufacturer |
---|---|---|---|---|
900021 | A+ | 1.1 | 512 MB | Sony UK |
900032 | B+ | 1.2 | 512 MB | Sony UK |
900092 | Zero | 1.2 | 512 MB | Sony UK |
900093 | Zero | 1.3 | 512 MB | Sony UK |
9000c1 | Zero W | 1.1 | 512 MB | Sony UK |
9020e0 | 3A+ | 1.0 | 512 MB | Sony UK |
920092 | Zero | 1.2 | 512 MB | Embest |
920093 | Zero | 1.3 | 512 MB | Embest |
a01040 | 2B | 1.0 | 1 GB | Sony UK |
a01041 | 2B | 1.1 | 1 GB | Sony UK |
a02082 | 3B | 1.2 | 1 GB | Sony UK |
a020a0 | CM3 | 1.0 | 1 GB | Sony UK |
a020d3 | 3B+ | 1.3 | 1 GB | Sony UK |
a21041 | 2B | 1.1 | 1 GB | Embest |
a22042 | 2B (with BCM2837) | 1.2 | 1 GB | Embest |
a22082 | 3B | 1.2 | 1 GB | Embest |
a220a0 | CM3 | 1.0 | 1 GB | Embest |
a32082 | 3B | 1.2 | 1 GB | Sony Japan |
a52082 | 3B | 1.2 | 1 GB | Stadium |
a02100 | CM3+ | 1.0 | 1 GB | Sony UK |
How to change emulator’s RAM and VH heap (for AVD Manager, for Android Studio)
The solution is easy. All You need is to locate AVD directory and modify params in config.ini file.
Mostly it is located in
%UserProfile%\.android\avd\{AVD name}\config.ini