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.

You need to use a Theme.AppCompat theme (or descendant) with this activity.

You need to use a Theme.AppCompat theme (or descendant) with this activity.

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/

Installing Android Things on Raspberry Pi 3 B+

Download the Console Tools from the following link. You will need to sign into your Google account.

Unzip the file and Launch the correct utility for your OS.

On Windows you will need to launch as administrator by right clicking on the Windows Application and Run as administrator.

Run as administrator

The program is easy to follow along with and automatically downloads and creates the SD card for the Pi.

After you are finished, put the card in the Pi and boot it up.

Turn 3.5mm Jack on Raspberry Pi Running LineageOS 16

You will need an Android Terminal. You can turn on the default one in the developer settings. Need to turn on developer mode?

You will also need to enable root which can also be done in the Developer settings

Open up the terminal app and run


More info here