Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Drive together not the same

Drive together not the same

Connected cars are among us.
Today we can use our smartphone in a safer way while driving not touching them at all! Let’s see together what we can do as developers to integrate our apps in Automotive Systems in the marketplace.
What platform like Android Auto, Sync AppLink and Mirrorlink are offering to us to make a safe driving experience for our customers.

AndroidAuto Mirrorlink Sync3

Giovanni Laquidara

April 07, 2016

More Decks by Giovanni Laquidara

Other Decks in Programming


  1. Drive together not the same

  2. 20,1% of Car Accidents 40% fatals

  3. None
  4. Building agenda

  5. Mirrorlink Connect your Android app to IVY Smartphone Server -

    IVY Client • Uses/extends a number of open standards • Physical layer agnostic • Services Provided • Framebuffer replication • Control events • Bi-directional audio • Bi-directional data services • MirrorLink Services Provided Transparently to the Application • Apps don’t have to implement ML protocol • Thin API provides access to info about ML session 
 and some basic commands • Applications Execute On the Phone • MirrorLink is a Protocol for Using Automotive Head Units (Clients) as Remote Terminals for Phones (Servers) • Uses/extends a number of open standards • Physical layer agnostic • Services Provided • Framebuffer replication • Control events • Bi-directional audio • Bi-directional data services • MirrorLink Services Provided Transparently to the Application • Apps don’t have to implement ML protocol • Thin API provides access to info about ML session and some basic commands • Applications Execute On the Phone, But Are Viewed and Used on the Head Unit MirrorLink Client (Head Unit) MirrorLink Server (Phone) MirrorLink Common API Application
  6. Event Configuration Discussion • Different Head Units Have Different Capabilities

    • Minimum Set – Rotary Knob OR Single-Touch (1 Pressure Level) • Rotary knob – up/down/left/right, clockwise/counter-clockwise turn, push • If you are going to be CCC certified, have to work with both • Event Configuration Can Change at Runtime…in Theory • I haven’t seen it yet • Can Tailor Application UI Based on Head Unit Capabilities • One UI for rotary know and one UI for single-touch • One UI for multi-touch • One UI for park and one UI for drive • We Test Each UI Layout in Certification Testing App CB’s Advice: Build One UI That Works With Rotary & Single-Touch Car Connectivity Consortium Requirements
  7. Application Requirements • Base Requirements “Park Mode” – Ensure Applications

    Can Be Used • Application supports multiple UI schemes - Different screen sizes - Different controls › Rotary knob › Touch screens • Application doesn’t require use of OS keys that may not be available • Useful for alternate use cases of MirrorLink • Drive Requirements – Ensure Applications Do Not Excessively Distract Driver • Does not show forbidden content • Does not demand user’s attention • Easy for the user to read and interact with • Does not consume too much of the driver’s attention (driver workload)
  8. Basic Interoperability Display Compatibility • Support Reference Client Display •

    800 x 480 pixels (square) • 13.33 cm x 8.00 cm • 90 cm from driver • Adapt to Client Display [Optional] • Support Landscape Mode • Control Positioning • Not entirely within outer 5% of the display Control Compatibility • Support Rotary Knobs • May not have a rotary keyboard available, so either implement your own, or don’t require • Support Single-Touch Events • Cannot require multi-touch • Voice Commands • May use, but may not be available • Must notify user if not available • Cannot Require OS Keys • May not be present on Client • Provide Application Metadata Benefit – App Will Work With ML Clients
  9. © 2014 Car Connectivity Consortium. All Rights Reserved. 2015/05/18 Drive

    Requirements Minimizing Driver Distraction • Guiding Principals • Nothing that demands the driver’s attention • Quickly comprehensible and accessible • Restricted Content • No video, incidental animations or flashing • No automatic scrolling text • Visual Accessibility • Color contrast – brightness & color differences • Text legibility • Minimum height • Font requirements • Control Accessibility • No two-handed operations • Should not use the keyboard • Control sizing and spacing • Pace of Interaction • Input retention and responsiveness • Notification dismissal Region-Based Certification • Region Specific • North America (AAM) • European Union (EU) • APAC (JAMA) • Global Certification • Superset of NA, EU and APAC guidelines • Can Get Certified for One or Multiple Regions • E.g. Drive in EU & APAC, but not NA
  10. © 2014 Car Connectivity Consortium. All Rights Reserved. 2015/05/18 Drive

    Certification Regions Clarification • EU Requirements are the Minimum Set • Applies to all regions that do not have a requirement set • If your app isn’t targeting NA or Japan, go with EU requirement set • NA Requirements: EU + Driver Workload • Japan Requirements: EU + Strict(er) Driver Workload • Global Requirements are Superset – Japan Requirements • Working on Defining New Regional Requirements All Regions (EU Requirements) North America Japan
  11. http://carconnectivity.org/developers

  12. Certificate Management

  13. None
  14. export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/ https://causeway.carconnectivity.org

  15. Run and Test! • Run and Test ( Mirrorlink QT

    Simulator ) • Ubuntu 12.04 • Kernel 3.8.0-xx-generic • Kernel 3.13.0-xx-generic • Qt 4.8 • Qt Serial port library and a bunch of other libraries • Support Rotary Know ( There are instructions to build by yourself )
  16. None
  17. Global consortium for smartphone-based 
 connected-car solutions Membership open to

    all Over 100 members: automotive, smartphone 
 and tier 1 suppliers Solutions not owned by a single corporation Simple API not SDK to add Pro
  18. Some Cons • Hard configuration for test • Strict certification

    • Test has a cost: ( 1 month, < 10000$ for a “normal” app )
  19. Sync3 with AppLink • An integrated in-vehicle communications and entertainment

    system embedded in Ford and Lincoln vehicles • Suite of APIs for Android and iOS that provide the ability for developer to extend the command and control of a mobile app to the in-vehicle HMI • Based on https://en.wikipedia.org/wiki/SmartDeviceLink
  20. • Handle all of the commands sent from an AppLink

    application and delivers the intended message inside the vehicle • Receive all data from car: speed, sensors, etc. What can I do?
  21. What I Need • Install Eclipse IDE with ADT plugin

    ( WHAT! ) • Register my App to get an AppID • Install the Android SYNC Proxy library • Install an AppLink Emulator • Docs to compile to submit app https://developer.ford.com/
  22. ALE

  23. None
  24. Manifest <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <service

    android:name=".AppLinkService"/> <receiver android:name=".AppLinkReceiver"> <intent-filter> <action android:name="android.bluetooth.device.action.ACL_CONNECTED" /> <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/> <action android:name="android.media.AUDIO_BECOMING_NOISY" /> </intent-filter> </receiver>
  25. Hello World • MainActivity.java: starts and stops AppLinkService and LockScreenActivity

    under certain conditions • SdlReceiver.java: listens for intents and start/stops AppLinkService based on intents • SdlService.java: enables auto-start by creating a SyncProxy, which then waits for a connection from SYNC. This file also sends and receives messages to and from SYNC after connected • LockScreenActivity.java: throws up lock screen on phone when app is running through SYNC while driving https://github.com/nichel/HelloWorld
  26. AppLinkReceiver.java Listen for the following Bluetooth Android intents: • ACTION_STATE_CHANGED

  27. import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log;

    public class SdlReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { final BluetoothDevice bluetoothDevice = (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Log.d("Receiver", intent.getAction()); // if SYNC connected to phone via bluetooth, start service (which starts proxy) if (intent.getAction().compareTo(BluetoothDevice.ACTION_ACL_CONNECTED) == 0) { SdlService serviceInstance = SdlService.getInstance(); if (serviceInstance == null) { Intent startIntent = new Intent(context, SdlService.class); startIntent.putExtras(intent); context.startService(startIntent); } }
  28. SdlService.java • Implement IProxyListener in whichever file you want to

    be able to send RPCs to and from SYNC //Add the vehicle data items you want to subscribe to //proxy.subscribevehicledata(gps, speed, rpm, fuelLevel, fuelLevel_State, instantFuelConsumption, externalTemperature, prndl, tirePressure, odometer, beltStatus, bodyInformation, deviceStatus, driverBraking, correlationID); proxy.subscribevehicledata(false, true, rpm, false, false, false, false, false, false, false, false, false, false, false, autoIncCorrId++);
  29. Pro • Customizable LockScreen • Common APIs for Android and

    iOS Cons • APIs are not so user-friendly • Only Ford • Documentation for app certifications
  30. Android Auto Extending Android to Cars

  31. Functionalities? • Audio apps that allow users to browse and

    play music and spoken audio content in the car. • Messaging apps that receive incoming notifications, read messages aloud via text-to-speech, and send replies via voice input in the car.
  32. What do I Need? • targetSdkVersion to 21 or higher.

    • Install the support library - If you are building messaging apps for Auto, you need the NotificationCompat.CarExtender class contained in the v4 support library. http://developer.android.com/auto
  33. automotive_app_desc.xml <automotiveApp> <uses name="media" /> // or notification </automotiveApp>

  34. Manifest <application> ... <meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc"/> </application>

  35. App Quality • Beware of Driver Distraction • http://www.google.com/design/spec-auto •

    No Animation, no scrolling text, No Games! • Night and Day Modes • Responds to Voice Commands in no more then 2 secs
  36. Run and Test Auto Apps Desktop Head Unit

  37. Extend Notifications .setContentIntent(readPendingIntent) /// Extend the notification with CarExtender. ///

    End /// Extend the notification with CarExtender. .extend(new CarExtender() .setUnreadConversation(unreadConversationBuilder.build())) /// End
  38. Messaging Sample • https://github.com/googlesamples/android-MessagingService

  39. Media App A media app using the media APIs is

    technically able to run on Android Auto as long as it declares the metadata. Android Auto, like Android Wear, relies on the standard MediaBrowserService and MediaSession APIs. When you declare Android Auto compatibility, your app will go through a review process before getting approved on the Play Store. https://codelabs.developers.google.com/codelabs/android-music-player
  40. None
  41. Important Hint! • Important: If your app targets more then

    just Android Auto,will not be available for distribution until the app is approved. You should not use your production APK for Auto support prototyping.
  42. Pro • Familiar Environment for developer • Easy to extend

    your Messaging/Media app for Android Auto • Voice command API Cons • Not so many headunits supporting it right now
  43. Good News

  44. During the waiting for autonomous cars let’s build safer apps

  45. Questions g.laquidara@snapback.io @joaolaq