There are many differences between a mobile application and a PB desktop application. It is highly recommended that you read through iOS Human Interface Guidelines and Android Design, especially the UI Design Basics part of iOS Human Interface Guidelines, to get familiar with the basics of the mobile UI design. What are listed below are the most important differences that you must keep in mind when designing the user interface and user experience for the mobile application in the PowerBuilder IDE.
Mobile devices mainly use the human finger for input; desktop computers mainly use a mouse for input. Designing a user interface for interaction with the finger is very different than designing for mouse.
-
First of all, you would need to design larger UI controls for a finger than you would for a mouse pointer in the desktop environment. For example, iOS recommends the comfortable minimum size of a tappable target is 44 x 44 points, which is approximately 176 x 176 PBUs.
-
Secondly, a mouse can have a hover state, so tool tips and other roll-over effects can be used in the desktop application. Besides that, a mouse can have a right mouse button, so right-click popup menu can be easily supported. However, these design elements are less natural on a mobile application.
A desktop application can take advantage of a real keyboard to help people type fast and correctly, and enable shortcut key functionalities, while a mobile application mainly uses a virtual keyboard which takes up the precious screen space, and is typo-prone, therefore, you should avoid using the virtual keyboard whenever possible, and try to design the user interface for selection rather than for typing, for example, use a ListBox, TrackBar, or spin control to replace a text field.
Compared to desktop applications, mobile applications are running on a more compact screen, therefore, their window size must be smaller, while the UI controls must be large enough to be easily tapped. This means that only the primary functionalities can be displayed at the screen at a time, the secondary functionalities should be hidden. This requires you to carefully design the application structure, the user interface, and the window navigation, especially for smartphones such as iPhone.
Memory is more tightly constrained for the mobile device than it is for desktop computers, therefore, it is very important to build the application as memory efficient as possible. Here are some advices for PB developers to make their application more memory efficient:
-
Do not retrieve (or cache) any more data in DataWindows or DataStores than is absolutely necessary. The more data is retrieved into DataWindow and DataStores the more memory is consumed. More data means more rows and/or columns.
-
Use SDI instead of MDI. Then the user cannot have multiple windows open. The more windows open the more memory is consumed. If necessary, use the API to check the memory in use, and prompt or close some windows to release memory.
-
Use stored procedures as much as possible. Then heavy calculations and data processing are not happening on the mobile device.
-
Minimize use of global functions, global objects, global structures, etc. except when truly necessary. Global things are always resident in memory so it consumes memory.
-
Whenever possible, release objects directly (by calling the PowerBuilder DESTROY statement) rather than auto-release them, because iOS does not support garbage collection.
By contrast to desktop PC which mainly uses wired networks, mobile devices use wireless networks exclusively due to its "mobile" nature, while wireless networks tend to be unstable or even not available when the device is travelling. Therefore, when you are designing for the mobile application, you may need to take the network connectivity into consideration, you can develop the mobile application with offline capabilities so that it can run against the local database if no network connection and then synchronize data with the server-side consolidated database when network is available, or even develop an offline mobile application which can run on the local device without needing network connections at all.
Device orientation can change in the mobile device and people often expect to use their mobile devices in any orientation, therefore, you will need to consider how to support orientation change when you design the application.
Fonts that are available in the mobile platform and the PC platform may not be exactly the same, because fonts are largely dependent on the platform manufacturers. You can choose from the fonts that commonly exist in both the mobile platform and the PC platform, such as Arial (recommended font), Courier New, Euphemia, Georgia, Trebuchet MS, Verdana, Times New Roman, etc.
Arial is the most recommended font to use in the PB application, because it looks very similar to Helvetica (the iOS default font) and Roboto (the Android default font). If you choose a font that is available in the PC platform but not available in the mobile platform, the font will be mapped to the default font (Helvetica in iOS or Roboto in Android) automatically at runtime. For the mapping rules, please see Font.
The RGB color used in the PB application will be displayed as the exact same RGB color in the mobile application at runtime. But the system colors may not, because the Windows system colors (such as ButtonFace) are different from the mobile system colors. If you have used or intend to use the system colors in the application, you may notice there are minor differences.