This section has instructions to create a sample application using Telematics APIs.
You need to have the following in order to proceed:
- Linux Ubuntu 14.04
- Linux Yocto Platform SDK Installer created by the system integrator for the device on which the Telematics app is expected to run
Source the environment
Install the Linux platform SDK created by the platform developer for the intended device. Let's assume that the installer is named sdk_installer.sh.
Open the terminal, Copy the sdk_installer.sh into your working directory, say for example "my_sdk_install".
$ mkdir my_sdk_install; cd my_sdk_install
$ ./sdk_installer.sh
- Setup the build environment as follows:
$ cd my_sdk_install; source environment-setup-cortexa8hf-vfp-neon-oe-linux-gnueabi
Now your development environment is set for the terminal, start your development.
To get started with a sample app
- Create a sample folder
- Create a sample application as follows:
#include <iostream>
#include <memory>
#include <telux/tel/PhoneFactory.hpp>
int main() {
auto &phoneFactory = telux::tel::PhoneFactory::getInstance();
auto phoneManager = phoneFactory.getPhoneManager();
bool subSystemsStatus = phoneManager->isSubsystemReady();
std::cout << "PhoneManager Ready? " << (subSystemsStatus? "Yes":"No") << std::endl;
if(!subSystemsStatus) {
std::cout << "wait unconditionally for it to be ready " << std::endl;
std::future<bool> f = phoneManager->onSubsystemReady();
subSystemsStatus = f.get();
}
std::cout << "PhoneManager Ready? " << (subSystemsStatus? "Yes":"No") << std::endl;
return 0;
}
Compile the program
Now compile your source code
user@machine:/sample_app$ ${CC} SampleApp.cpp -ltelux_tel -std=c++11 -lstdc++ -o sample_app
Install apps on the device
Push your binary to the /data location on the device
user@machine:/sample_app$ adb push sample_app /data/
user@machine:/sample_app$ adb shell
$ cd data
$ chmod +x sample_app
$ ./sample_app