One more interesting thing is that the application that you have developed with almost no efforts can be started on iOS or Android mobile devices. This feature is provided by the mobile platform, which is a part of 1C:Enterprise 8.3 platform.
The look and feel of applications for Android and iOS devices can be slightly different.
Note: In this chapter you are going to run your application in the mobile platform for developers on iPad. Full example of building the application ready to be published and building the application for Android-based devices is given in the Mobile application building example chapter.
You can also find information about features of applications based on 1C:Enterprise platform for mobile devices in Chapter 25. Developing solutions for the mobile platform of 1C:Enterprise Developer Guide.
To install and start the application on iOS devices in the developer mode, the need an iOS developer account. Moreover, you will need a Mac computer with Xcode developer environment.
For Android-based devices, you only need to install 1C:Enterprise mobile platform for developers using packages that are available in the distribution kit of 1C:Enterprise mobile platform.
1C:Enterprise 8 mobile platform is a set of tools that let you to create applications that work on Android or iOS mobile devices. Those devices are mostly smartphones and tablet computers.
The 1C:Enterprise mobile application that you install on the mobile device is a combination of the mobile platform and the infobase. The mobile infobase is similar to the file infobase. It consists of a database that stores data in a file and a mobile applied solution that is a program, which can be started on a mobile device and manage data in the database.
Figure 15-1. 1C:Enterprise 8 mobile platform
Thanks to the mobile platform you can right now, without using any third-party IDE, install and start your application and see how it works on the mobile device. As an example, you will do this for an iOS-based device.
To install the 1C:Enterprise mobile platform, perform the following steps:
- Plug the mobile device to the Mac computer.
- Unpack prjios.zip on your Mac.
- Open the project with mobile platform for developers in Xcode. For this, double-click the 1cem.xcodeproj file or start Xcode, click File, then click Open, and select the project file.
- In Xcode, click Window and then click Organizer to open the Organizer tool.
- In the pane on the left, select your iPad.
- The device you have selected must be marked with the green. If it is not, click Use for Development.
- Organizer will automatically request certificates and provisioning profile from the Apple website and prompt you for iOS developer password.
- In the Product menu, point to Edit and then click Edit Schema to open the scheme settings window. In the scheme settings window:
- Select 1cem as Schema.
- Select your iPad as Destination.
- Set Build configuration equals to Release.
- Click OK.
- In the Product menu, click Run, to start the project.
- The mobile platform will be installed and started on your mobile device. You will see 1C:Enterprise icon among other application icons.
- Now you can unplug the mobile device and start the application using its icon. If the 1C:Enterprise mobile platform is started by Xcode, it is spoped during the unplugging.
Figure 15-2. Use for Development button
Figure 15-3. Schema settings window
The last step is to upload and start this application on the mobile device. You will use the tool that is similar to publishing on the web server that was described in the Web client chapter.
The web server will store the application as a single XML file. The mobile platform for developers connects to this web server, downloads that XML file, and install it on the mobile device. After that, the application can be started on the mobile device.
In Designer mode, on the Configuration menu click Mobile application, and then click Publish.
Figure 15-4. Publishing the mobile application
Select the Create virtual directory on web server and Update mobile application when a database configuration is updated check boxes, and type mm in Name. Note that the last folder in Directory is also changed to mm. Then click Publish.
Figure 15-5. Publishing the mobile application
Confirm all actions that the platform will request confirmation for, and your application will be published.
All actions involving the computer are done. Start the 1C:Enterperise platform on the mobile device. And click to add the application.
Figure 15-6. Adding a new application
In Address, type http://<your computer IP>/mm. Instead of <your computer IP>, type the IP address of the computer where you run the web server with the published mobile application.
Note: To find out the computer IP, see its network connection properties. The mobile device and the server must be located in the same network. The easiest way of doing that is using a Wi-Fi router. Both the computer with the web server and the mobile device should be connected to it.
Then tap Download.
Figure 15-7. Downloading the application
The mobile platform will download the application. Then it will suggest you to adjust some properties. Leave Application name as it is and select the Restart from designer check box. Then tap Done.
Figure 15-8. Installing the application
Set Restart from designer to On.
Figure 15-9. Application details
You will see the application in the list of applications. To start it, tap the application name or tap and hold it, tap Edit, and tap Open.
Figure 15-10. List of applications
Figure 15-11. Starting the application
Figure 15-12. Mobile application desktop
Figure 15-13. Application menu
If you flick right, you will see the application menu. Note that the command interface of the Main section is displayed in the application menu on the mobile platform (we discuss this in the Improving interface chapter). The buttons on the desktop have become even more useful.
Important. The application that you developed and filled with data, when it is opened on the mobile device, contains no data except the predefined items. This is not an error. The data synchronization between several applications is an interesting but separate topic. The 1C:Enterprise platform can solve these problems with ease. For example, see Homework 3.
In this chapter you developed a mobile version of your application, which is compatible with Android and iOS mobile devices.
To distribute your application for end users you need to create a package containing the mobile platform, the applied solution, and the database. For this, 1C:Enterprise platform has packing tools. You can read more about it in the Mobile application building example chapter. The packed application can be published in Play Store and App Store.
Figure 15-14. Publishing the mobile application