📜 ⬆️ ⬇️

About the 1C: Enterprise Mobile Platform

The 1C: Enterprise mobile platform is a set of tools and technologies for the rapid development of mobile applications for iOS, Android, Windows Phone / 8.1 / 10, using the same development environments (Configurator or 1C: Entrprise Development Tools) and the same development methods. what are used for "normal" applications 1C. The result is autonomous, offline applications, but with the ability to exchange information with the outside world using a wide range of integration tools provided by the platform: Web and HTTP services, e-mail, etc. Since the exchange protocols are platform-independent, the 1C mobile platform, among other things, is a means of quickly creating a mobile front-end for virtually any server solution.
image

Prehistory


Back in the days of "1C: Enterprise" version 8.0 (and later versions), there was a software program "Expansion for Pocket Computers". The extension allowed creating products only for Windows Mobile, Windows CE, etc. The product had its own configurator, and server, and was supported until the release of 1C: Enterprise version 8.3. The latest version of the extension (8.2.9) was released in October 2013, and full support ceased on January 1, 2015.
The expansion had limited use even in the heyday of communicators on Windows Mobile, and the withdrawal of such devices from the mobile market clearly did not add to the popularity of this software product. Devices on iOS and Android occupied almost the entire market of mobile devices, and it became obvious that support for these operating systems is one of the key points for the system, which should be used in the modern mobile world. It also seemed obvious that the main approach of the existing 1C: Enterprise platform should also be used on mobile devices: an application developer should first think about solving applied tasks, and secondly, what capabilities of the OS being used for him to solve these tasks . In other words, we need a tool that isolates the application developer from the features of the specific mobile OS and development tool.

Mobile platform


Based on the experience of developing and operating the expansion for handheld computers, it was decided to develop a specialized system that would satisfy several requirements:

The result of the development was the so-called mobile platform , which was released on May 29, 2013 in versions for iOS and Android. The 1C: Enterprise mobile platform is a set of tools and technologies that allows you to create applications for mobile OSs iOS, Android, Windows Phone / 8.1 / 10 using the same development environment (Configurator) and the same development methods as for ordinary applications on the 1C: Enterprise platform. The result is autonomous, offline applications, but with the ability to exchange information with the outside world using a wide range of integration tools provided by the platform: Web and HTTP services, e-mail, etc.
The mobile platform was well received by the community, various articles on this topic began to appear (for example, here , here and here ). In order to develop a full-featured application that runs simultaneously on the vast majority of mobile devices, it now required a minimum of time and knowledge that is not fundamentally different from the knowledge of an “ordinary” application developer on the 1C: Enterprise platform. Of course, such a low threshold of entry attracts developers who need to provide “some blood” with some basic functionality of on-site staff, bosses, and other mobile employees who need to work with the corporate system.
It’s easy to start developing a mobile application on the 1C: Enterprise platform. In the Configurator, set the “Assignment of use” property to “Mobile device” in the configuration. In this case, a part of the application configuration objects will become unavailable (plans for types of characteristics, charts of accounts, etc.), but properties specific to mobile applications will become available (for example, built-in multimedia and mobile device tracking, etc.).
image
In this case, you can debug the main algorithms of the application (not directly related to mobile specifics) directly in the Configurator on the developer’s computer. At the same time, it is recommended to frame the sections of the code in which the “mobile” functionality is accessed with the appropriate preprocessor instructions in order to avoid errors when executing the code on a personal computer:
#    = .(); # 

Starting with version 8.3.7 of the mobile platform, debugging of the application directly on the mobile device has become available (more on this below).

Development on a mobile platform can follow different approaches, but several highlights can be made out. From the point of view of building a mobile application itself, its functional richness and role in the IT infrastructure of an enterprise:

The two situations described above can be considered extreme options. But these are not the only options for development. The application developer can independently choose the possibilities of integration between the mobile application and the information system that acts as a back office for him.
The mobile application is developed as a fully autonomous configuration, but it can share part of the source text with the “parent” configuration. By the way, the “parent” configuration may not physically exist (for example, if you are developing some kind of universal application that can work with different systems using a universal protocol).
')

Device mobile platform


What is a mobile platform and what can it do?
To be fair, the mobile platform is just one of the components of the whole complex, thanks to which 1C: Enterprise 8 runs on mobile devices. So, the application developer operates with the following components:
  1. The mobile platform itself is the mobile part of the 1C: Enterprise framework. It is normal (which is used during the assembly of the application for publication in the application store) and the mobile developer platform, which is used (surprise) during the development of the mobile application.
  2. Mobile configuration is a configuration of the “1C: Enterprise” software system, recorded as an XML file.
  3. The combination of mobile platform and mobile configuration gives a mobile application.
  4. Mobile application builder is a specialized application that can be made from a mobile platform, configuration, screensavers, icons and other components, a ready-made mobile application file that can be downloaded to the Apple AppStore, Google Play, Windows Phone Apps / Windows Apps stores.

Why is everything so difficult? Why it can not be done on a mobile device exactly as it is done in a large platform? Those. put one mobile platform on a device and load any number of configurations / applications into it? It is forbidden to make licensing restrictions on applications that are distributed through application stores. For example, if your application downloads the executable code (as a script) over the Internet, it will never appear in the Apple app store. However, it should be understood that the ability to download any configuration that exists in the mobile developer platform is not intended for distribution of mobile applications even within the same company, not to mention distribution to the developer’s clients.
After the mobile application is on the target mobile device, there is a need to use some kind of database (data must be stored somewhere). As a database engine, the mobile platform uses its own database engine, which is ported to the mobile platform from the platform for a personal computer. It is compact and fast enough, but the main thing is that it provides exactly the same behavior that application developers are accustomed to, working on a platform for personal computers.
It is also worth noting that inside the mobile application is built in the same way as the work of a regular platform with the file version of the information base: there is a client part, there is a server part, there is a database and there is a client-server interaction.
The mobile platform itself is written as a native application, compiled into binary code for the main processor architectures used in the mobile world now: ARM v5 or higher and x86 architecture.
In addition, special permissions may be required to interact with certain capabilities of a mobile device (telephony, GPS, work with an integrated camera, etc.). For iOS, they are set directly during the operation of the application itself, and for Android, permissions are specified when creating the application. Required permissions are specified when developing a mobile application and are used by the mobile application builder, but about the assembler a little later.

A little bit about the developer platform


While we are developing a mobile application - we are not bound by licensing restrictions imposed on mobile applications distributed through application stores. So, we can use the 1C mobile platform just as we use the “big” platform on a personal computer - install the mobile platform itself on a smartphone / tablet and load mobile application configurations into it. After launch, the platform will show us the list of applications registered in it:
image
To add a new application to the platform, you need to place the XML file with its description on a resource accessible from a mobile device via HTTP. The most convenient way to do this is from the Configurator, through the menu "Configuration \ Mobile application \ Publish". In this case, the XML file with the application configuration is located on the web server on the developer's computer (respectively, this computer must have a web server - IIS or Apache).
image
If you specify the option “Restart from the configurator” for the application, the application on the mobile device will be automatically updated from the developer’s computer each time the developer updates the XML configuration file located on the web server.
If the option “Debugging is enabled” is enabled, step-by-step debugging of the application on the mobile device from the Configurator on the developer's computer is possible (in the Configurator, the option “Debug via HTTP” in the menu “Service \ Options” should be selected). If you put a breakpoint in the code in the Configurator and select the Mobile Application - Start Debugging command, the mobile application on the device will stop when the executable code reaches the breakpoint, and in the Configurator you can see the values ​​of variables, the call stack, etc.

What can?


So, what can a mobile platform? Enough :)
If you do not operate with specific terms "1C: Enterprise", the mobile platform provides the ability to work with regulatory information, draw up documents describing some external actions, view reports, communicate with the outside world using Internet services and much more. Those. it provides an application developer with the opportunity to write a fairly functional application, for example, a home finance accounting program, a field trading program, and the like.
But besides the usual functionality that is on the platform for a personal computer, the mobile platform should provide work with specific capabilities that are unique to mobile devices:

It is clear that some features may not be available on each specific device, therefore, to determine what can be done on the device on which the mobile application is running, special methods are provided that let you know what is available on this device, for example, the ability to dial numbers or not. Thus, approximately the following scheme of use is realized: we check, we can use some opportunity or not, and if we can, we use:
  .()  .(, ); ; 

Hiding from the application developer details about the mobile OS being used, providing it with unified mechanisms for using mobile functionality is an important task for us. We believe that the problem is being successfully solved. Differences in implemented mechanisms are either absent or minimized. Except, of course, cases when there is no functionality in one of the OS at all.
For example, the technique of working with push-notifications is very different from Google and Apple. We have made a lot of efforts to unify the mechanism for working with push-notifications from the application code. In the case of a mobile application, we managed to do it almost 100%: the same application code on a mobile device handles receiving PUSH notifications on both iOS and Android. And the distribution code for push notifications in the server application also looks the same. But in order to achieve such unification, we had to develop a special proxy server https://pushnotifications.1c.com/ , which hides from the developer different techniques for working with Apple Push Notification Service (APNS) and Google Cloud Messaging (GCM) services. The difference is in different settings directly on the proxy site https://pushnotifications.1c.com/ ; To work with APNS, you need to upload an SSL certificate (which Apple issues for an application at the developer’s request) to the site; to work with GCM, specify the unique identifier of the application.
Obviously, it is impossible to immediately realize all the features that you want to have in a mobile application. And you always have to find a compromise between several very useful things. And if something is missing for you, write to us about which business tasks (after all, the platform is first and foremost a tool for implementing business tasks!) You cannot solve it and what mechanism would help you for this.

What does it look like?


The graphical interface of the mobile platform is a separate topic. In 1C: Enterprise, as is known, the interface is described declaratively. This, on the one hand, imposes some restrictions on the development of the UI (for example, there is no possibility of pixel-by-pixel positioning), but, on the other hand, allows the platform to consistently draw the interface on screens of different sizes, in the thin and web client. We tried to adhere to the same principle in the mobile platform. How well did we do it? Let's try to figure it out.
In the first versions of the mobile platform (up to 8.3.5 inclusive), the graphical interface of applications looked quite familiar to sophisticated 1C users; in fact, he was transferring the interface interface familiar to the “desktop” versions of 1C to the mobile world. But from the point of view of users who previously were not familiar with 1C, the interface looked somewhat archaic.
Taking into account the comments and suggestions, we fundamentally revised our approach to the mobile interface in version 8.3.6. We can say that we have made a completely new mobile interface for our applications. It has a lot in common with our Taxi interface. The development model for developers of mobile applications corresponds to the development model in Taxi. At the same time, the mobile interface is fully consistent with the approaches to design and UX adopted in mobile applications. The interface fully takes into account the specifics of the mobile world: the small size of the screen (which means that the design of graphic elements should become more ascetic - without shadows, gradients), there is support for finger gestures, etc. Interesting fact: the new mechanism of the platform responsible for placing elements in the form (layouter) was so successful and timely for the mobile platform that it was released earlier (in version 8.3.6) than in the platform for PC (in version 8.3.7) , for which it was primarily intended.
In the picture you can see how our interface has changed.
The “Small Firm Management” application on the mobile platform version 8.3.5:
image
It is on version 8.3.6:
image

And this is how the live interface of the mobile platform looks like:


Collector - and what kind of beast?


As mentioned earlier, a mobile application consists of several components (the mobile platform itself, configuration, various resources), which must be a single unit for placing the application in a store. To facilitate the transformation of components into an application, a mobile application builder was developed. This is a configuration (application) created on the 1C: Enterprise platform, which stores in its database all the components necessary to form a mobile application. In order for the collector to do its work, you need to download and install various software packages that are needed for its work (Java and Android SDK, etc.), then specify the paths to these packages in the settings of the collector and set some additional parameters (development keys etc.).
image
After setup the collector is ready to work. In general, working with the collector is as follows:
  1. Download the version of the mobile platform 1C, on which we will build the application
  2. We load a configuration from which we will collect mobile application
  3. We create a mobile application in which we specify which platforms (Android, iOS, Windows) should be assembled, which configuration and platform should be used (in particular, indicate which certificate to build under iOS to use if the application works with PUSH- notifications).
  4. Perform one-click build of a mobile application for all selected platforms.
  5. "Another click" send the collected mobile applications to the app stores (if this is an application for iOS or Android). In Windows Apps / Windows Phone Apps stores, the application must be loaded manually, because Microsoft does not yet provide an API for placing an app in the store.

It should be noted separately that the collector is not needed to develop and debug a mobile application. To do this, you can use the mobile developer platform and the Configurator tools to transfer the configuration to a mobile device. But for the distribution of mobile applications - need a collector.

Mobile applications


1C itself releases a number of applications on a mobile platform that are mobile clients of 1C server applications (1C: Document Management, 1C: Management of a Small Firm, etc.). These applications implement a subset of the functionality of “regular” clients. In the case of the mobile version of “1C: Small Firm Management”, the functionality is sufficient for the full use of the program, and we have often seen a situation where customers need a mobile version of the application for their business.
Our partners use the mobile platform both for the development of production mobile applications distributed through application stores, and for customized applications created at the request of specific customers. Among drawing applications there are applications that use a non-1C-based back-end as a central data repository.
Among the mobile applications created by the order of customers, we can mention the mobile client for "1C: Manufacturing Enterprise Management", created by order of a large engineering holding. About a hundred employees of the holding use the mobile application in hot workshops, where, for safety reasons, it is impossible to install stationary computers. The built-in camera of the mobile device is used to read the barcodes of the products and search them in the nomenclature reference book, the mobile application allows you to understand at which stage of the technological chain the product is located, mark the next operation of the product, etc.

Conclusion


We tried very superficially to describe the mobile platform, what it allows you to do and why it turned out the way it turned out. In this article, almost nothing is said about mobile Windows. : -, Windows («1:» 8.3.7), - - . , Windows . . , – ; ( «» ), , - .
«1:» -. 1 . 1 – , (iOS, Android, Windows Phone / 8.1 / 10). - (Web- HTTP- ..) 1 — , , 1 (Web- HTTP-, .).

Source: https://habr.com/ru/post/283198/


All Articles