Go Up to
Form Designer OptionsTools > Options > User Interface > Form Designer > Device Manager
The Device Manager shows a grid with the device presets. The device presets are the list of available devices to use at design time for example in the
Multi-Device Preview Window. These devices can be used as
views of your multi-device project if the view has been registered by installing the package of such view. By default, only generic devices have registered views. See how you can
create your own views.
From this page you can
add,
edit, and
delete a device preset. You cannot edit or delete built-in device presets, you can only edit or delete device presets that you add yourself to the .
The Device Manager manages the DevicePresets.xml file, when you
add,
edit, or
delete a device preset from the Device Manager, the DevicePresets.xml file updates automatically to reflect such changes. You can also .
You can double-click a device in the list to
edit it. You can use the or the to access other actions.
Contents
[]
Buttons and Context Menu
At the bottom of the page, you can find the buttons to manage the device presets. If you right-click anywhere in the page, a context menu pops up.
By using the buttons or the context menu, you can do one of the following actions:
ItemDescription
AddOpens the
New device settings editor to
create a new device preset.
EditOpens the
Device Settings Window editor to
edit the selected device preset.Note: This action is disabled when you select a built-in device preset. You cannot edit built-in device presets.
DeleteDeletes the selected device preset. See
Deleting a Device Preset.Note: This action is disabled when you select a built-in device preset. You cannot delete built-in device presets.RAD Studio asks you for confirmation before it actually deletes the selected device preset.
DevicePresets.xml
The DevicePresets.xml file defines the device presets information, these devices can be used at design time.
Warning: We recommend to carefully check the modifications on the DevicePresets.xml file. Please revise the xml tags to ensure that they are properly cased. Otherwise the designer could not understand them and behave unexpectedly.
This file allows you to edit the following device information:
A friendly name for your view
Available orientations
Display size for each orientation
Status bar position and size
Image for the device frame
To add a new device preset to the DevicePresets.xml file:
Go to C:\Users\<username>\AppData\Roaming\Embarcadero\BDS\20.0.
Note: This is a hidden folder. If you are not able to see it, make active the Show hidden files, folders, and drivers on the Folder Options dialog box in the Windows Control Panel.
Open the file with a text editor.
Inside the <MobileDevices RepositoryVersion="3"> tag, add a new MobileDevice element as follows:
<MobileDevice> <Name>TestView</Name> <!-- Same unique ID used in the creation package if you are registering a new View --> <Displayname>My Android Phone</Displayname> <!-- Name to show in the Device Manager, View Selector and Multi-Device Preview --> <DevicePlatform>3</DevicePlatform> <FormFactor>2</FormFactor> <UserData>True</UserData> <Portrait Enabled="True" Width="360" Height="640" Top="61" Left="44" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> <UpsideDown Enabled="True" Width="360" Height="640" Top="68" Left="47" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> <LandscapeLeft Enabled="True" Width="640" Height="360" Top="44" Left="68" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> <LandscapeRight Enabled="True" Width="640" Height="360" Top="47" Left="61" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> </MobileDevice>
Note: You need to replace ARTWORK_PATH with the correct path to your artwork.
Warning: If you are
adding a customized view to the view selector, you need to ensure that the name added between the <Name></Name> tags matches the ViewName of the
package of that view.
Restart the IDE for the changes to take effect.
DevicePresets.xml Elements
Each MobileDevice element may use any combination of the following elements:
ElementDescriptionExample
NameIdentifier used to
create the package to add a new view.Warning: The name must be unique, if you add a new device preset with the same name as an already existing device preset, the existing device preset is overwritten by the new one when the DevicePresets.xml file gets updated by the IDE.
<Name>TestView</Name>
DisplaynameFriendly name to display where necessary, like for example in the
View Selector, the , and the
Multi-Device Preview.<Displayname>My Android Phone</Displayname>
DevicePlatformPlatform of the device.NumberDefinition
0Windows
1OS X
2iOS
3Android
<DevicePlatform>3</DevicePlatform>
FormFactorForm factor of the device.NumberDefinition
0Desktop
2Phone
3Tablet
4Media Player
5Automotive
6Industrial
7Embedded
8Watch
9Glasses
Note: When selecting Desktop as form factor, there is no need to configure any of the orientation since these are not enabled for this particular form factor.
<FormFactor>2</FormFactor>
UserDataDetermines whether the device can be edited from the .<UserData>True</UserData>
Portrait
UpsideDown
LandscapeLeft
LandscapeRight
Orientation definition.
You may use any combination of these four elements. Use each element as a self-closed XML tag (<Tag />), and use any combination of the following attributes on each tag:
PropertyDefinition
EnabledSet this property to True if you want to use this orientation.
Width
Height
Measures (in pixels) of the form. Represents the available area.
Top
Left
Represents the most top left corner of the available area. It is the offset from the origin of the screen.
StatusbarHeightThe height of the status bar.
Default: 0.
StatusBarPosThe position of the status bar, 0 meaning on top.
Default: 0.
ValuePosition
0Top
1Bottom
2Left
3Right
ArtworkThe fully qualified path to the file. When the field is empty, a slim black frame appears by default.
MaskThe fully qualified path to the Mask file. It is an optional field that is used to apply a mask to the Artwork in order to define non-rectangular shapes in customized views. Therefore, the Mask defines the visible and non-visible parts of the Artwork on the form. When the field is empty, no mask is aplyied to the Artwork.
To apply a Mask to the Artwork take the following steps:
Make the Mask the same size as the form ( Width and Height).
Add transparency to the background and to the screen area of the device on the Artwork.
Make the visible part of the form transparent on the Mask.
Make the non-visible part of the form white (#FFFFFFF) on the Mask.
<Portrait Enabled="True" Width="360" Height="640" Top="61" Left="44" StatusbarHeight="25" StatusBarPos="0" Artwork="$(BDS)\ObjRepos\en\Devices\images\Android35.cpng" Mask="$(BDS)\ObjRepos\en\Devices\images\AndroidMask35.cpng" />
After saving new changes in the , the DevicePresets.xml file updates when the IDE closes to include the <Thumbnail></Thumbnail> tags. The <Thumbnail></Thumbnail> tags are automatically generated to include the location of the thumbnail images of the device presets used in the and the
Multi-Device Preview. You should not edit or delete the <Thumbnail></Thumbnail> tags.
See Also
Form DesignerAdding a Customized View to the View SelectorAdding a Device PresetEditing a Device PresetDeleting a Device PresetDevice Settings WindowMulti-Device PreviewMulti-Device Application