android

android tips and tutorials

Where is the Android SDK located on macOS? (setting ANDROID_HOME)

If you’re using macOS and need to know where (in what directory) the Android SDK is located, it is currently located here:

~/Library/Android/sdk

The sdkmanager and avdmanager and a few others are located in this directory:

~/Library/Android/sdk/tools/bin

The Android SDK platform tools bin directory is here:

~/Library/Android/sdk/platform-tools

I’m doing some things with Android from the command line tonight and learned that I needed to set ANDROID_HOME, and that’s when I dug into this.

~ March, 2019

Android/Kotlin: A FloatingActionButton setOnClickListener Snackbar example

As a quick note to self, this is an example of how to implement a setOnClickListener on a FloatingActionButton with Android and Kotlin:

fab.setOnClickListener { view ->
    Snackbar.make(
        view,
        "An exciting message!",
        Snackbar.LENGTH_LONG
    ).setAction("Action", null).show()
}

Hopefully that’s enough to get “future me” pointed in the right direction when I need this again. :)

(There are more lambda details at this link.)

Amazon Fire 10 HD: 33% off on Black Friday, 2018

I need a new tablet, and I just might bite the bullet on the Amazon Fire 10 HD today (Black Friday, 2018). For my Android development I don’t like that it’s based on Android 5, but $100 (33% off its regular price) for a tablet with decent performance is hard to pass up for my current needs.

How to make a phone call from your Android app

I came across this Android phone dialer tip yesterday. If you want to make a phone call from an Android application, all you have to do is create a new Intent, either an Intent.ACTION_DIAL (to start the call) or Intent.ACTION_CALL (to place the call).

Here are the three lines of source code you need to get started:

Intent dialIntent = new Intent();
dialIntent.setAction(Intent.ACTION_DIAL);
dialIntent.setData(Uri.parse("tel:8675309"));
Android users have a higher loyalty than iOS users alvin March 10, 2018 - 5:44pm

A new study shows that Android users have a higher “loyalty” to their OS than iOS users have, 91% to 86%. techcrunch.com has the story.