Product Documentation

FairCom Edge Android IoT

Previous Topic

Next Topic

Install the FairCom Edge Database

Now that we are satisfied that our development environment is intact, let’s get to work with the FairCom Edge database technology. We will begin by:

  • Installing our default database engine and playing around a bit.
  • Walk through the steps to embed the FairCom Edge into your own app.

On your desktop machine, unzip the Android FairCom Edge product zip file you downloaded or received from FairCom:


You will see a footprint like this, with two faircomEdge_xxxxxx.apk in the server folder: a debug and release version. In our tests, we will use the release version, but if you need some more debugging information in your project, you may choose the debug version.

We will use the adb command-line tool to install the faircomEdge_xxxx.apk package to our phone emulator. If your phone emulator is not already running, start it now.

To make things simpler, ensure that the phone emulator is the only device connected. As shown here.

Let’s look at the phone emulator. Notice the applications you have installed, among them the "My Application" that we created in the previous topic, but so far we don't have any FairCom application (assuming we have no FairCom apps installed yet).

Now, let’s install the default FairCom Edge database engine. Go back to your command line, and issue the following adb install command:

./adb install <path>faircomEdge_xxxx.apk

In this screen shot, forgive the long path name before the .apk file. We are in the platform-tools folder (because we have not set up our PATH to it) and we are installing the faircomEdge_xxxxxx.apk file from where we unzipped the downloaded FairCom zip file.

Now go back to your phone emulator and view the Apps. You will see the FairCom ctreeEDGE App.

Click the FairCom EDGE (ctreeEDGE) app and then click Open. Click the Start button to start the FairCom Edge database engine. You won’t see anything happen because the engine runs in the background.

After starting the server, we can see:

Our FairCom Edge database technology is primarily designed for use as an embeddable engine linked to our customer’s applications.

Now drop down to the file system to inspect. Look for the FairCom Edge database engine’s CTSTATUS.FCS file to see if we are up and running and all is OK.

From your command line, do the following:

./adb shell


cd /storage/emulated/0/Android/data/com.example.faircomedgeapp/files 

ls -C


If you do not have a files folder, try to START your database engine again from the app.

The tail CTSTATUS.FCS command allows us to see the contents of the status file. The engine should be Operational

If you would like to execute some client-side applications from your desktop machine that connect into this database engine running on your device, you will need to "forward" the TCP ports. To do this, execute the following commands:

adb forward tcp:5597 tcp:5597

Now that the server is running and accepting external connections, it is possible to connect to it with any FairCom client sample program. To proceed with this particular test, we have installed FairCom V12 in the Mac machine (this is necessary if you intend to run programs on your desktop, against a FairCom Server or FairCom Edge Server). For instance, once the package is installed in your local machine, you can move to the following folder:


Run one of our sample programs, ctixmg:

ctixmg ADMIN ADMIN FAIRCOMS@localhost

Any request to localhost on my MAC get forwarded to the device. The data inserted during the execution of this sample program goes to the FairCom Edge Server in the Android emulator in this case.

Note: If you ever need to discontinue the port forwarding, you may run:

./adb forward --remove tcp:5597

Then, if you try a new connection with ctixmg against the FairCom Edge server, you will get an error:

With our database engine up and running, we encourage you to review the FairCom Edge Development Guide found in your FairCom downloaded zip package or on our site:

There you will find more information on accessing and processing data on your device with communication protocols such as other native c-tree interfaces: C/C++, C#, Python, more…

This concludes the steps to install and execute a basic application that utilizes the FairCom EDGE database engine.