This video show how to setup /etc/udev/rules.d/51-android.rules in Ubuntu (behind VirtualBox) to enable hardware device debugging in Android Studio.
The development platform is 64-bit Ubuntu-GNOME 15.10 running in VirtualBox, with Android Studio installed with Ubuntu Make (umake).
To enable hardware device debugging in Ubuntu, you have to create /etc/udev/rules.d/51-android.rules file to add device IDs for your debugging devices. (refer: Android Developers Document Using Hardware Devices - Setting up a Device for Development)
Create /etc/udev/rules.d/51-android.rules file with sudo right, add the line and save:
SeekBar.OnSeekBarChangeListener colorBarChangeListener = new SeekBar.OnSeekBarChangeListener(){
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { setColorFilter(imageView); }
@Override public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override public void onStopTrackingTouch(SeekBar seekBar) {
} };
private void setColorFilter(ImageView iv){
/* * 5x4 matrix for transforming the color+alpha components of a Bitmap. * The matrix is stored in a single array, and its treated as follows: * [ a, b, c, d, e, * f, g, h, i, j, * k, l, m, n, o, * p, q, r, s, t ] * * When applied to a color [r, g, b, a], the resulting color is computed * as (after clamping) * R = a*R + b*G + c*B + d*A + e; * G = f*R + g*G + h*B + i*A + j; * B = k*R + l*G + m*B + n*A + o; * A = p*R + q*G + r*B + s*A + t; */