JavaFX TableView Tutorial and Examples.

TableView is a JavaFX control we can use to render tabular data. TableView is very powerful. It can allow us to visualize an unlimited number of rows of data, broken out into columns.

It's in a way similar to ListView. Except for the fact that it can render 2D data. That is data in both rows and columns. Normally ListView only renders data in rows only, with a single column.

Hence this makes JavaFX TableView an integral part of JavaFX as a Framework.

This control resides in the javafx.scene.control package.

Android EasyImage tutorial and Example.

EasyImage is a library that allows you to easily capture images from:

  1. Gallery
  2. Camera
  3. Documents.

Yet it does this without creating lots of boilerplate code. You can easily plug EasyImage into your project as a dependency and use it. This library is written by Jacek and is well maintained and mature.

Android Runtime Permissions Tutorial and Examples.

Android has this concept of permission requesting before accessing various device resources.This helps in protecting the privacy of an Android Device user. So for example you(your apps) have to request permissions to:

  1. Access sensitive user data (such as contacts and SMS).
  2. Acess certain system features (such as camera and internet).

Depending on the feature, the system might grant the permission automatically or might prompt the user to approve the request.

Android ViewGroup Tutorial and Examples.

A ViewGroup is a special view that can contain other views (called children.) This is class is very important as it acts as the base class for countless view containers and layouts. All those AdapterViews as well as Layouts subclass this class.

Furthermore, it also defines the ViewGroup.LayoutParams class which serves as the base class for layouts parameters.

Android ScrollView Tutorials and Examples

A ScrollView is an android layout that permits it's child views to be scrolled vertically. This is important because in many cases you need content to be scrolled. Normally adapterviews like ListView and recyclerview have scrolling capability but not many views. Hence we don't use scrollview with them otherwise we get degraded performance.

With scrollview you only scroll up or down. However if you want horizontal scrolling then you can use the HorizontalScrollView.

Furthermore, ScrollView should only have one direct child. This then means that if you desire to add multiple children then use a ViewGroup like relativelayout or LinearLayout. Then add those children to the viewgroup and the viewgroup to Scrollview.

Android Handler Tutorial and Examples.

Handler is a class fundamental to how we do threading in android, at the infrastructure level. It works hand in hand with the Looper. Together they underpin everything that the main thread does—including the invocation of the Activity lifecycle methods.

Looper will take care of dispatching work on its message-loop thread. On the other hand Handler will serve two roles:

  1. First it will provide an interface to submit messages to its Looper queue. 2.Secondly it will implement the callback for processing those messages when they are dispatched by the Looper.

Each Handler gets bound to a single Looper and, by extension, to one thread and its looper MessageQueue.

Android SearchableSpinner Library Tutorial and Example.

What about if you have a spinner with plenty of items and you want to provide users with ability to search or filter those items.

What do you do then?

Well you have a solution is SearchableSpinner by @michaelprimez in SearcableSpinner.

Java Jackson Tutorial and Examples.

Jackson is a JSON API for java comprising:

  1. Jackson Core(Streaming API) - defines low-level streaming API, and includes JSON-specific implementations
  2. Jackson Annotations - contains standard Jackson annotations.
  3. Jackson Databind - implements data-binding (and object serialization) support on streaming package; it depends both on streaming and annotations packages.

These three require each other in the sequence we've listed them. Jackson Annotation uses the Jackson Core features, and the Jackson Databind uses Jackson Annotation.

Moshi Tutorial and Examples.

Moshi is a modern JSON library for Android and Java.

Moshi is able to read and write Java core's data types

  1. Primitives (int, float, char...) and their boxed counterparts (Integer, Float, Character...).
  2. Arrays, Collections, Lists, Sets, and Maps
  3. Strings
  4. Enums

It's very easy to customize how values are converted to and from JSON.

A type adapter is any class that has methods annotated @ToJson and @FromJson.

Morevover Moshi is designed to help you out when things go wrong.

It does this by always throwing a standard if there is an error reading the JSON document, or if it is malformed. It throws a JsonDataException if the JSON document is well-formed, but doesn't match the expected format.

Moshi also uses Okio for simple and powerful I/O. It’s a fine complement to OkHttp, which can share buffer segments for maximum efficiency.

Moshi is very similar to Gson. It uses the same streaming and binding mechanisms as Gson.

Android cordinatorlayout Tutorials and Examples.

According to Android SDK documentation, the CoordinatorLayout is a super-powered FrameLayout.

It is a ViewGroup that resides in the package.

This layout is meant to be used mainly in two cases:

  1. As a top-level application decor or chrome layout.
  2. As a container for a specific interaction with one or more child views.

When you create an application using android studio and choose Basic Activity as you layout, then android studio will automatically create for an aactivity_main.xml with cordinatorlayout as you top-level element.