library

Android Room database persistence library examples alvin July 20, 2017 - 12:02pm

As a note to self, here are some Android Room database persistence library examples:

Those tutorials don’t show how to properly use Room database access methods, so they’ll lead to Android “Application Not Responding” (ANR) errors. Therefore, here are some related Google/Android docs:

Finally, here’s my own Android AsyncTask REST example, which also shows how to use an AsyncTask.

The karma of bad software documentation

Tried to use someone’s software library.
Documentation was bad, couldn’t get it to work.
Used someone else’s.

#haiku-ish

How to use the Spring Framework in Scala

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 17.4, “How to use the Spring Framework in Scala.”

Problem

You want to use the Java Spring Framework library in your Scala application.

Solution

In my experience, the only real changes in using the Spring Framework in Scala applications involve how you cast the objects you instantiate from your Spring application context file, and that’s only because the casting process is different between Scala and Java.

How to access HTTP response headers after making an HTTP request with Apache HttpClient

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a very short recipe, Recipe 15.12, “How to access HTTP response headers after making an HTTP request with Apache HttpClient.”

Problem

You need to access the HTTP response headers after making an HTTP request in your Scala code.

Solution

Use the Apache HttpClient library, and get the headers from the HttpResponse object after making a request:

How to find good Scala libraries

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a short recipe, Recipe 14.7, “How to find good Scala libraries.”

Problem

Ruby has the RubyGems package manager, which lets developers easily distribute and manage the installation of Ruby libraries; does Scala have anything like this?

Android Studio - How to import a jar file (in a libs folder)

I just started using Android Studio 1.x and quickly ran into a problem where I needed to use a Jar file in my Android project. In short, this image shows the steps I followed to import the Jar file into my project. As an important note, I put the Jar file I needed in an app/libs folder, which I created in my project. As the image shows, this affects your Gradle build configuration. (I found this info at this SO link.)