This guide takes you through the steps needed to get the sample project, Hello Sdl, connected a module.
To get the example app, download or clone the sdl_java_suite. The Hello Sdl Android app is a package within the SDL Android library. Open the
sdl_java_suite/android project using "Open an existing Android Studio project" in Android Studio. We will use Android Studio throughout this guide as it is the official IDE for Android development.
Hello Sdl Android has been built with different build flavors that allow you to quickly connect the app to an emulator or hardware. You can choose your flavor in the Build Variant menu. To open the menu, select Build > Select Build Variant. A small window will appear on the bottom left of your IDE that allows you to choose a flavor.
There are many flavors to choose from but for now we will only be concerned with the debug build variants:
multi- Multiplexing - Bluetooth, USB, TCP (as secondary transport)
multi_high_bandwidth- Multiplexing for apps that require a high bandwidth transport
tcp- Transmission Control Protocol - Only used for debugging purposes
You will mainly be dealing with
multi build variants if connecting to TDK, or
tcp if connecting to Manticore or another emulator.
You can use a simulated or a real device to connect the example app to an emulator. To connect the example app to Manticore or another emulator, make sure you are using
tcpDebug build flavor. You must update the IP address and port number in the Hello Sdl Android project so it knows where your emulator is running. Please check the Connecting to an Infotainment System guide for more detailed instructions on how to get the emulator's IP address and port number.
1. In the main Java folder of Hello Sdl Android, open up
2. At the top of this file, locate the variable declaration for
DEV_MACHINE_IP_ADDRESS and change it to your emulator's IP address. Set the
TCP_PORT to your emulator's port number.
private static final String DEV_MACHINE_IP_ADDRESS = "192.168.1.78"; // Update private static final int TCP_PORT = 12345; // Update
3. Make sure the emulator is running, then build and run the app on a real device or a simulated device. The SDL app should show up on the HMI.
You need a real device to connect the example app to production or debug hardware. To connect the example app via Bluetooth or USB, all you need to do to is select the
multi_sec_offDebug build flavor and then run the app on an Android device. You can find more information about the USB transport in the Using AOA Protocol guide.
If using the Bluetooth transport, make sure to first pair your Android phone to the hardware before attempting to connect your SDL app.
If your app compiles and but does not show up on the HMI, there are a few things you should check:
SdlService.javato match the machine running SDL Core. Being on the same network is also important.
12345on the machine or VM running SDL Core. Also, make sure your firewall allows that outgoing port.