Sometimes you may want to use custom font in your Android application for aesthetic requirement or to show a message in a different language. I have already written an article on how to use a Custom Font in Android four years ago. Since it has been a long time and a reader wondered if that code still works, I am writing this new article using Kotlin. However, the underlying technique hasn't change over the years and you can still use my previous article.

Finally, I found some time to write about accessing MySQL or any database that you can think about from an Android application. Android offers a built-in database known as SQLite which is supposed to be used for local data storage. For example, if you want to store your recent transactions locally in the device, you have to go with SQLite. I have already written a few articles on how to use SQLite database in Android. However, enterprise mobile applications often depend on client/server databases such as MySQL, Oracle DB or MongoDB. Whatever the database, you have chosen, the way to access them from an Android application is pretty same. In this article, I explain how to access a MySQL database from an Android application written in Kotlin.

I will use Kotlin for all upcoming Android tutorials because it is the future of Android programming. Kotlin is a JVM based language and you can easily convert a Kotlin project into Java and vice versa.

An Android application is not supposed to directly access a database deployed in a server. I do not recommend implementing JDBC connections in an Android application due to the tight coupling introduced between the application and the database. The industrial best practice requires you to implement a web service between the database and the Android application. Having a web service layer reduces the complexity of the Android application and also reduces the dependency on database specific operations. Therefore, the problem of accessing a client/server database like MySQL from an Android application can be defined as the problem of consuming a web service hosted somewhere.

Having said that, as an Android developer, you don't need to care about what is behind the web service. It may be a MySQL database, MongoDB database, a Social Media network or even a Weather Network API. What you need is the API endpoints exposed by the web service. In this article, I only explain how to connect to a web service hosted on your local machine from an Android application. However, the sample web service used in this article provides API endpoints to CRUD operations on a MySQL database. Please follow the RESTful CRUD With Java and MySQL in Minutes article and develop the web service to access a MySQL database. In the following section, you will learn how to access the web service you have created for accessing a database.

Scala is a JVM based functional programming language widely being used in data analytics. You can install Scala on Ubuntu using sudo apt install scala. However, IDE support is inevitable these days. Therefore, this article explains how to use Scala in IntelliJ IDEA.

Install the latest IntelliJ IDEA. You can install either the community version or the Ultimate version depending on the license. Again, I have an article explaining how to Install IntelliJ IDEA on Linux.

It has been a long time since I wrote the tutorial: Android: Simple Calculator. However, still, that tutorial attracts more readers to my blog. Therefore, I have decided to write a new article to develop the same application using Kotlin. The previous article on developing a Calculator application using Java is still valid and feel free to compare this article with the previous one.

Step 1:

Create a new Android application: Kotlin Calculator with an Empty activity. In the very first dialog, make sure that you have enabled the Kotlin support.

Of course, you can write a fancy code to read user input and feed them to an isUnique method. However, to keep the code clean and simple, I am calling the static method isUnique and immediately print the response. The isUnique method returns false all the times. In the following section, we are going to implement the algorithm for the isUnique method.

This tutorial helps you to setup Apache Axis2 on Ubuntu and to add it to Eclipse IDE for Java EE Developers.Step 1:
Download the latest version of Apache Axis2 from this link.Step 2:
Open the Terminal (Ctrl + Alt + T) and enter the following command to change the directory.

cd /opt/

Step 3:
Enter the command given below to extract the Axis2 from the ~/Downloads directory. If your downloaded file is in any other directory and replace the last parameter by the actual file path.

sudo unzip ~/Downloads/axis2-1.7.8-bin.zip -d .

Step 4:
Rename the folder name to axis2.

sudo mv axis2-1.7.8/ axis2/

Step 5:
To deploy web services, you may need to add some files inside this folder. Therefore it is required to change the permission of this directory. Enter the following command to change the permission of axis2 folder.

sudo chmod -R 777 axis2/

Step 6:
Environment variables AXIS2_HOME and PATH have to be added to the system. Enter the following command in the terminal to open the /etc/environment.

sudo gedit /etc/environment

Step 7:
Add the following line at the end of the file.

AXIS2_HOME="/opt/axis2"

Add the /opt/axis2/bin to the PATH.

The /etc/environment before the modification.

The /etc/environment after the modification.

Step 8:
Reload the environment variables to the current terminal using this command.

source /etc/environment

Step 9:
Enter the following command to start the Axis2 server.

axis2server.sh

If you are using Java 9 or latest, you may get an error similar to:
"-Djava.endorsed.dirs=/opt/axis2/lib/endorsed:/usr/lib/jvm/jdk-10.0.2/jre/lib/endorsed:/usr/lib/jvm/jdk-10.0.2/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit".
To fix this problem, open $AXIS2_HOME/bin/axis2Server.sh script and scroll down to the bottom. At the end of the script, you have a command like this:

There are hundreds of articles on how to install phpMyAdmin on Ubuntu. However, none of them showed me an error-free way of installing phpMyAdmin in my system. This article is for those who want to install phpMyAdmin and MySQL without any errors.

phpMyAdmin depends on Apache Server, PHP, and MySQL. Therefore, I recommend to install them before installing phpMyAdmin.

After seeing the huge response for the Import and Use External Database in Android article, I have realized the importance of deploying Android database from external sources. The library used in the above article allows you to import database only from the assets directory. However, recently one of my readers, asked for a way to import and upgrade the database from SD card. As a solution for his use case, I have developed a new library named "externalsqliteimporter" which allows you to import database either from assets directory or from SD card. This article explains the application of this Android library using a sample application.

The ExternalSQLiteImporter library allows you to build your SQLite database on your desktop computer, and to import and use it in your Android application. This library has two separate ways to maintain your database.

This library is still under development. Deploying and upgrading the database from an external directory is not secure as it is publicly available for third party applications as well. Use that feature with caution.

I keep receiving so many requests for an article on how to access MySQL database from Android application. Even though Android applications can have direct access to MySQL database server, that is not preferred due to security issues and high complexity. The easy and best solution is developing a REST web service to receive the requests from whatever the client (including Android applications) and execute them on the database connected with the web service.

There are so many articles already available on the Internet about how to create a web service to perform Create, Read, Update & Delete (CRUD) operations on a database and how to connect from an Android client. However, I wondered why most of them are using PHP to develop the web service! I believe developers find PHP a less painful language to develop web services than Java. In this article, I am going to show how to develop a RESTful CRUD Web service with Java in minutes. As a matured language Java has enough frameworks to make your task easy. I guarantee that you will never look back for a different language once you know the tools.

The most awaiting release, Android Studio 3.0 has been released a few days back with exciting features including Kotlin and Java 8 support. Even though developers were able to use Kotlin and Java 8 earlier, this time they do not need any extra configurations to enable them. This article explains how to create a hello world Android application using Kotlin.

Wait... This is Java Helps but I am writing about another language! Am I running out of content? Of course Kotlin is a new language but still, it is running on top of Java Virtual Machine. Kotlin can be compared with Groovy in terms of how it compiles the code. Both of them produce the same binary code that every Java developer is familiar with. Therefore Kotlin is another baby joining the family of JVM languages but with different syntax and more features.

Ubuntu and most other Linux distributions have Apache Maven in their official repository but I prefer manual installation to avoid dependencies like Open JDK. This article explains how you can install the latest Apache Maven in Linux.

Requirements:

Apache Maven depends on Java Development Kit so you must have either Oracle JDK or OpenJDK installed on your system. In case if you do not have JDK in your system, follow these articles first and install Oracle JDK on your computer.

Even though OpenJDK is available in Linux repositories, some applications strictly require Oracle Java Development Kit. This article shows you how to manually install Oracle JDK 11 on your Linux system. This article uses JDK 11$java_update_no to demonstrate the installation. In the provided commands, replace the version specific paths and file names according to your downloaded version.

Step 1:

Download the latest JDK(jdk-11$java_update_no_linux-x64_bin.tar.gz) from this official link.
If you want to download to a remote server or if you simply prefer wget, use the command given in this StackOverflow answer: Downloading JDK