no permissions (user in plugdev group; are your udev rules wrong?)

While trying to use ADB on a Linux Computer, I received the following error from “adb devices”

no permissions (user in plugdev group; are your udev rules wrong?);

Not exactly sure what causes the above error, but the information in the following Stack Exchange link was helpful.

I was able to get around the issue by putting the USB option to “File Transfer Mode” from the notifications menu

How to Restore Pixel to Factory Image

Restoring a Pixel to the factory image is a pretty straight forward operation if you are familiar with fastboot and adb. This guide assumes you have fastboot already installed and setup in your user path. If not you can refer to the following link for more information.


1. Download OTA Image

Go to the following link and download the Factory Image for your device

Extract the file and then open a terminal or command prompt in that directory.

2. Boot up Pixel in recovery

You can do this with “adb reboot recovery” or with the volume key to boot into the Android boot menu.

3. Flash Image

On Windows you can flash the firmware with


Or on Linux


Should take it a couple of minutes to complete.

Next we can lock bootloader with

fastboot flashing lock

You will need to confirm the lock on your phone.

Android Button – Remove Shadow and Border from Button with Image on it

We can remove the border and shadows from a button by adding the following style code in your activity_main.xml file. Or what ever your XML file is.


Code for button. We are setting an image as the background.


Comparison of buttons. One on the left still has the shadow on it

Difference between border and borderless buttons

More info here

Getting Android WiFi state in Kotlin

In Kotlin you can request if the WiFi adapter is on or off with the following code
This changes the text on a textbox, replace with your textbox.

wifiManager = this.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
textBox.text = "WiFi State = ${wifiManager.wifiState}"

The important part is


It will return a number from 0-4 which indicates if it is on or off.

0 = WiFi is being disabled
1 = WiFi Disabled
2 = WiFi is being enabled
3 = WiFi is Enabled
4 = Error

Add ADB path to Windows Environment Variables

From the start menu search for “Edit environment variables for your account”

Click Path and then Edit.

Edit Environment Variables

Then click new and paste in the path to the ADB directory which should be


And hit OK

Adding ADB path

You should be good now. You’ll need to relaunch and Command Prompts you have open, but you should be able to run adb without having to navigate to the adb folder.



Looks like if you get the above error resolved by adding the following to the Android Manifest file.


Kotlin – Buttons and TextViews

Set Text for text view

val textBoxVar: TextView = findViewById(
textBoxVar.text = "Hello World!"

Button clicked – do something

val buttonVar: Button = findViewById(
buttonVar.setOnClickListener {
    buttonVar.text = "Button Pushed..."  //Change text on button


Toast notification

val text = "Hello World! This is a toast message!"
val duration = Toast.LENGTH_SHORT
val toast = Toast.makeText(applicationContext, text, duration)

Changing Boot Animation over adb on Android Things

You’ll need to install and setup adb and then run the following commands. Change ipaddress to the ip address of the device running Android Things

adb connect ipaddress
adb root
adb remount
adb push /system/media/
adb reboot will either need to be in the same directory as adb, or you can specify the path. For example if it is located on your Desktop you can use

For Windows

adb push \Users\username\Desktop\ /system/media/

on Linux or MacOS

adb push ~/Desktop/ /system/media/