Category Archives: Android tutorials

Android tutorials, step by step description for beginner, for experts

Retrofit basics – Introduction

In the introduction part of the Retrofit basics tutorial we are going to summarize the following chapters and give an overview what you can learn, if you do this tutorial.

In this tutorial we are going to show you how you can send (register user), get (fetch all users) and get your profile from the database of a WordPress site, what we are going to create by ourselves.

For all of this we are going to use the Retrofit library, which is a type-safe HTTP client for Android and Java and a WordPress REST API helper, called Swagger.

Continue reading Retrofit basics – Introduction

Follow and like us:

RelativeLayout – Password checker

In this tutorial, we are going to create a sample application, where we are going to practice a bit the RelativeLayout and we will make a password checker app.

The layout will be very fancy, it will follow the nowdays valid design patterns and it will use dark colors. For this we are going to use very few type of user interface elements, eg TextViews, EditTexts.

The new view will the CardView. Since Android 7.0, we can use CardView, which has many cool features. You can create with it rounded corners and shadows based on its elevation. CardView is part of the AndroidX library.

Continue reading RelativeLayout – Password checker

Follow and like us:

Room basics – ViewModel

In this chapter of the Room basics tutorial we are going to talk about how we can use the Room queries through a ViewModel. It means, we are going to call the queries from the ViewModel to follow the MVVM design pattern.

We can use the ViewModel as a communicator between the user interface and the repository. It holds the data in a lifecylce-conscious way, which survives configuration changes.

 

Continue reading Room basics – ViewModel

Follow and like us:

Room basics – DAO, Database and Entity

In this chapter of the Room basics tutorial, we are going to talk about the main part of Room, which is the creation of the DAO, the Database and the Entity.

In short

      • DAO stands for Data Access Object, which is an interface, that contains the queries to access the database. It is annotated with @DAO
      • Database represents the database. Because it holds a connection to the SQLite database, all operations are executed through it. It is annotated with @Database.
      • Entity represents a table in the Room database, which should be annotatad with the @Entity keyword.

Continue reading Room basics – DAO, Database and Entity

Follow and like us:

Room basics – The starter project

In this chapter of the Room basics tutorial we are going to create the starter project. It means, that we are going to add the needed dependencies, add the fragments, implement the RecyclerView, which will hold our todos, create the data class and finally we will create the navigation graph as well.

Because we will use in this tutorial Kotlin Coroutines, Navigaion– and Lifecycle components, we have to add to the project some other dependencies. Thenafter we can start to implement the RecyclerView for our todos.

So, let’s start coding! 😎

Continue reading Room basics – The starter project

Follow and like us:

Room basics – Introduction

In this tutorial we are going to talk about how we can implement in our Android applications the Room persistent library. For this, we gonna create a whole new app. So, you can have a big picture about this library. In the introduction part we are going to summarize the tutorial.

Previously, if we wanted to store data locally on an Android device, we had to create manually the database helpers and the SQL queries. It took a long time and it wasn’t an easy task, because we could make many errors also, what what we got only at runtime.

Then Room come to the rescue. It was released in the Google I/O 2016. Room is one of Google’s architecture component library for working with SQLite on Android.

With the release of Version 2.1, the library added support for database transactions using coroutines.

Continue reading Room basics – Introduction

Follow and like us: