Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Example Apps

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.

Open the the 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.

Getting Started

If you are not using a production head unit for development, we recommend using SDL Core and this Generic HMI for testing.

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.

Note

SDL Core and an HMI or Manticore are needed to run Hello Sdl Android and to ensure that it connects

Build Flavors

Hello Sdl Android has been built with different build flavors.

To access the Build Variant menu to choose your flavor, click on the menu Build then 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.

Versions Include:

  • 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)

Transports

Configure for TCP

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 tcpDebug.

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 SdlService.java

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 12345.

    // 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
Note

if you do not change the target IP address, the application will not connect to Sdl Core or show up on the HMI

Configure for Bluetooth

Right out of the box, all you need to do to run Bluetooth is to select the multi_sec_offDebug (Multiplexing) build flavor.

Configure for USB (AOA)

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.

Building the Project

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.

Must

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
guide

Troubleshooting

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.

TCP

  1. Make sure that you have changed the IP in SdlService.java to match the machine running Sdl Core. Being on the same network is also important.
  2. If you are sure that the IP is correct and it is still not showing up, make sure the Build Flavor that is running is tcpDebug.
  3. If the two above dont work, make sure there is no firewall blocking the incoming port 12345 on the machine or VM running SDL Core. In the same breath, make sure your firewall allows that outgoing port.
  4. There are different network configurations needed for different virtualization software (virtualbox, vmware, etc). Make sure yours is set up correctly. Or use Manticore.

Bluetooth

  1. Make sure the build flavor multi_sec_offDebug is selected.
  2. Ensure your phone is properly paired with the TDK
  3. Make sure Bluetooth is turned on - on Both the TDK and your phone
  4. Make sure apps are enabled on the TDK (in settings)
View on GitHub.com
Previous Section Next Section