In this guide we take you through the steps to get our sample project, Hello Sdl, running and connected to SDL Core as well as showing up on HMI.
First, make sure you download or clone the latest release from GitHub. The Hello Sdl Android app is a package within the SDL Android library.
sdl_java_suite/android project using "Open an existing Android Studio project" in Android Studio. We will exclusively use Android Studio as it is the current supported platform for Android development.
If you don't want to set up a virtual machine for testing, we offer Manticore, which is a free service that allows you to test your apps via TCP/IP in the cloud.
SDL Core and an HMI or Manticore are needed to run Hello Sdl Android and to ensure that it connects
Hello Sdl Android has been built with different build flavors.
To access the Build Variant menu to choose your flavor, click on the menu
Select Build Variant. A small window will appear on the bottom left of your IDE window that allows you to choose a flavor.
There are many flavors to choose from and for now we will only be concerned with the debug versions.
multi- Multiplexing (Bluetooth, USB, TCP (as secondary transport))
multi_high_bandwidth- Multiplexing for apps that require a high bandwidth transport
tcp- Transmission Control Protocol - used only for debugging purposes
We will mainly be dealing with
multi (if using a TDK) or
tcp (if connecting to SDL Core via a virtual machine or your localhost, or to Manticore)
If you aren't using a TDK or head unit, you can connect to SDL core via a virtual machine or to your localhost. To do this we will use the flavor
For TCP to work, you will have to know the IP address of your machine that is running SDL Core. If you don't know what it is, running
ifconfig in a Linux terminal will usually let you see it for the interface you are connected with to your network. We have to modify the IP address in Hello Sdl Android to let it know where your instance of SDL Core is running.
In the main Java folder of Hello Sdl Android, open up
In the top of this file, locate the variable declaration for
DEV_MACHINE_IP_ADDRESS. Change it to your SDL Core's IP. Leave the
TCP_PORT set to
// TCP/IP transport config private static final int TCP_PORT = 12345; // if using Manticore, change to assigned port private static final String DEV_MACHINE_IP_ADDRESS = "192.168.1.78"; // change to your IP
if you do not change the target IP address, the application will not connect to SDL Core or show up on the HMI
Right out of the box, all you need to do to run Bluetooth is to select the
multi_sec_offDebug (Multiplexing) build flavor.
To connect to an SDL Core instance or TDK via USB transport, select the
multi_sec_offDebug (Multiplexing) build flavor. There is more information for USB transport under Getting Started - Using AOA Protocol.
For TCP, you may use the built-in Android emulator or an Android phone on the same network as SDL Core. For Bluetooth, you will need an Android phone that is paired to a TDK or head unit via Bluetooth.
Make sure SDL Core and the HMI are running prior to running Hello Sdl Android
To know more about how to connect the app to the infotainment system, please check the Connecting to an Infotainment System
Sometimes things don't always go as planned, and so this section exists. If your app compiles and does NOT show up on the HMI, there are a few things to check out.
SdlService.javato match the machine running SDL Core. Being on the same network is also important.
12345on the machine or VM running SDL Core. In the same breath, make sure your firewall allows that outgoing port.