Each head unit manufacturer supports a set of user interface templates. These templates determine the position and size of the text, images, and buttons on the screen. Once the app has connected successfully with an SDL enabled head unit, a list of supported templates is available on ((DisplayCapabilities) sdlManager.getSystemCapabilityManager().getCapability(SystemCapabilityType.DISPLAY)).getTemplatesAvailable()
.
To change a template at any time, send a SetDisplayLayout
RPC to Core.
SetDisplayLayout setDisplayLayoutRequest = new SetDisplayLayout(); setDisplayLayoutRequest.setDisplayLayout(PredefinedLayout.GRAPHIC_WITH_TEXT.toString()); setDisplayLayoutRequest.setOnRPCResponseListener(new OnRPCResponseListener() { @Override public void onResponse(int correlationId, RPCResponse response) { if (((SetDisplayLayoutResponse) response).getSuccess()) { Log.i("SdlService", "Display layout set successfully."); // Proceed with more user interface RPCs } else { Log.i("SdlService", "Display layout request rejected."); } } @Override public void onError(int correlationId, Result resultCode, String info){ Log.e(TAG, "onError: "+ resultCode+ " | Info: "+ info ); } }); sdlManager.sendRPC(setDisplayLayoutRequest);
There are fifteen standard templates to choose from, however some head units may only support a subset of these templates. The following examples show how templates will appear on the Generic HMI and Ford's SYNC 3 HMI.