Mobile application development

Memory management

Since mobile device resources are limited compared to desktop PC resources, mobile developers should pay special attention to performance optimization and memory usage optimization.

This article lists the problems that require a special approach. You might want to implement alternative solutions to these problems on mobile devices and desktop PCs. This is an attempt to generalize our experience as a set of recommendations, rather than a strict requirement.

Designing a set of objects stored in a mobile Infobase

The set of mobile application metadata objects and their attributes should be designed apart of the main configuration. Despite the fact that implementing data exchange goes easier with identical object structures, this might lead to storing excess data on the mobile device, and wasting resources on transferring and processing this data.

If the data structures differ, we recommend that you run the data conversion script in the main configuration because this provides better efficiency.

Designing data exchange with a mobile device

We recommend that you carefully plan automatic registration of changes in exchange plans. During the generation of a batch of changes discard data that is not relevant to the current workstation. For example, when dumping a list of products, apply a filter to include only the product groups that are managed by a specific employee that works on a mobile device.

The batch size matters. If the expected size exceeds 5 MB, we strongly recommend that you split it into smaller batches for transferring to the mobile device. You can implement this by saving a batch to a file and then running the SplitFile() function. Splitting a batch into smaller ones provides the following advantages:

  • You can avoid occupying a large amount of mobile device memory when parsing a batch

  • You can implement downloading of data lost due to connection issues, starting with the first small batch that is lost

  • You can visualize the data transfer progress in the configuration, which improves the usability

Report generation

You can use the following report generation methods: 

  • Generate reports locally based on the mobile Infobase data

  • Generate reports remotely based on main Infobase data

If your report is based on data that is only available locally (or remotely), the choice is obvious.

Otherwise, we recommend that you generate reports locally.

Designing forms

Adjusting forms for screens with different DPI settings

Form controls are automatically resized based on the DPI value, with the exception of bitmap images, which might serve as buttons or have other uses in a form. To have images displayed properly, prepare picture variants for each DPI.

Adjusting forms for screens of different sizes

You can use the following  methods to ensure that a form looks properly on screens of all sizes:

  • Use managed interface capabilities

              o Develop a form for the smallest screen and use controls that feature automatic resizing as much as possible. On larger screens these controls are resized to fill all available space.

  • Redefine forms using 1C:Enterprise script tools

              o Implement a set of forms that serve the same purpose for different screen sizes. Select the required form using 1C:Enterprise script tools.

  • Change a single form using 1C:Enterprise script tools 

             o Depending on the screen size, show or hide form controls. You can also change the control view (for example, you can display a button as a picture or as text).

Combining all three methods provides the best result.

Rational usage of screen space

Some forms have a small number of controls. For example, a form where a user starts some operation only has buttons that lead to other forms. In this scenario consider increasing the size of controls at cost of the free space.

Horizontal scrolling

When designing a form, avoid horizontal scrolling of forms and tables. This is because the scrollbars only appear on the screen when it is touched (it is a way to save space). So users can only know whether scrolling is available when they attempt to scroll something. As for vertical scrolling, users often expect it, so generally implementing vertical scrolling is a better solution than any other one (such as using tabs within a form).

Next page: Working with mobile ads


Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.