What do you want to save?
Add Code snippet
New code examples
-
Java 2022-02-19 07:05:01
android vibrate device
import android.os.Vibrator; ... Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); // Vibrate for 500 milliseconds if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.D... Add solution -
Other 2022-02-19 03:55:13
barycentric coordinates triangle
// Compute barycentric coordinates (u, v, w) for // point p with respect to triangle (a, b, c) void Barycentric(Point p, Point a, Point b, Point c, float &u, float &v, float &w) { Vector v0 = b - a, v1 = c - a, v2 = p - a; float d00 = ... Add solution -
Java 2022-02-12 08:45:13
give text color and font size in android string
TextView tv = new TextView(this); String string= "Hello"; String title="MyTitle"; SpannableString ss1= new SpannableString(string); ss1.setSpan(new RelativeSizeSpan(2f), 0, ss1.length(), 0); tv.append(ss1); tv.append(title); setConten... Add solution