External Camera Application

Settings Customization

The External Camera application settings can be pre-set and distributed to the end users. Use the user interface of the External Camera application to change to the desired settings. These changes to the settings are automatically exported to the following file: /sdcard/tomtom/camera_settings_export.json.

Once the settings are customized this file should be renamed to camera_settings_import.json before distributing it to the end user devices as /sdcard/tomtom/camera_settings_import.json.

This settings file is read every time the application starts. The values of the settings file will only be imported into the end users application if:

  • The file /sdcard/tomtom/camera_settings_export.json does not exist on the end-user device. (None of the default - or previously imported - settings have yet been changed using the user interface) , and
  • The "reset" attribute of the camera_settings_import.json file equals true.

Settings Attributes

The structure of the settings file is as follows, using the default values as an example:

1{
2 "reset": false,
3 "configurable": true,
4 "view_mode": "fit",
5 "aspect_ratio": "auto",
6 "full_screen": false,
7 "mirrored": false
8 "guidelines": {
9 "enable": false,
10 "left_top_x": 38,
11 "left_bottom_x": 30,
12 "right_top_x": 62,
13 "right_bottom_x": 70,
14 "top_y": 41,
15 "bottom_y": 98
16 }
17}
  • reset - whether or not these settings should overwrite the current settings of the application. The accepted value is a boolean true or false.
  • configurable - whether or not the user is allowed to modify settings of the application. The user interface will show/hide configuration buttons based on this setting. The accepted value is a boolean true or false.
  • view_mode - is the image position in the settings. Accepted value is a string fit, fill or stretch. Important: the value is applied depending on the device’s orientation (portrait or landscape)!
    • fit - Fits the image to the screen. Aspect ratio of the image is maintained and the whole image is always displayed. If you have a 4:3 image then you will have bars on the sides ( landscape) or top and bottom (portrait).
    • fill - Aspect ratio of the image is maintained, but the whole screen will be used. If you have a 4:3 image then the top/bottom of the image will be cut (landscape) and right/left of the image will be cut (portrait).
    • stretch - Will stretch or squeeze the image to fit the screen, aspect ratio is not maintained. If you have a 4:3 image the image will be stretch left to right (in landscape) or top to bottom (in portrait).
  • aspect_ratio - aspect ratio of the video preview. Accepted value is a string sixteen_nine , four_three or auto.
  • full_screen - whether or not the video preview should be shown in full screen. The accepted value is a boolean true or false.
  • mirrored - whether or not the video preview should be mirrored. The accepted value is a boolean true or false.
  • guidelines - The relative position of Guideline points as a percentage of the screen width ( x ) or height ( y ).
    • enable - whether or not the guidelines view should be enabled. The accepted value is a boolean true or false.
    • left_top_x - Distance of the left top point, from left side of screen as percentage of the total width.
    • left_bottom_x - Distance of the left bottom point, from left side of screen as percentage of the total width.
    • right_top_x - Distance of the right top point, from left side of screen as percentage of the total width.
    • right_bottom_x - Distance of the right bottom point, from left side of screen as percentage of the total width.
    • top_y - Distance of the top line, from top side of screen as percentage of the total height.
    • bottom_y - Distance of the bottom line, from top side of screen as percentage of the total height.

All the guideline points are validated as follows:

  • All negative values are converted to 0.
  • All values above 100 are converted to 100.
  • If right_top_x is less than left_top_x, then the values will be switched.
  • If right_bottom_x is less than left_bottom_x, then the values will be switched.
  • If bottom_y is less than top_y, then the values will be switched.
  • The minimum distance between two points horizontally is 10% of screen width and will be enforced, if not set correctly, by adjusting the point at the right.
  • The minimum distance between two points vertically is 10% of screen height and will be enforced, if not set correctly, by adjusting the point at the bottom.