1c 8.3 mobile device error. Mobile client: installation, debugging, assembly for Android ". You have a question, you need a consultant's help

In this small article, which is the beginning of the cycle "Development of 1C mobile applications", I will show how you can quickly create a 1C mobile application "Hello World" based on the 1C mobile platform.

To test the finished 1C mobile application, real device based on Android operating system, using mobile developer platform and HTTP debugging capabilities.

Apache web server installation

1. Download the compiled files of the Apache web server, version 2.2 (At the time of writing, the 1C platform could work only with the specified version). You can choose where to download from at: https://httpd.apache.org/docs/current/platform/windows.html#down section "". For example, we use the ApacheHaus website and download the archive depending on the bitness of your operating system.

Unpack the downloaded archive, along the path: "C: \\ Apache22", make sure that port 80 on your computer is free and not occupied by another application. Further, using " Command line"(Running as administrator), go to the" C: \\ Apache22 \\ bin "directory and execute the commands:

Httpd -k install

Httpd -k start

After that, the "Apache2.2" service will be installed and started, which can be checked in the browser at the address: http://127.0.0.1/ but instead of 127.0.0.1 use the IP address of your network card, through which the data exchange will take place, with the developed 1C mobile application.
If the installation was successful, you will see information about the server and the inscription “It works!”.

In folder with executable files web server, there is an application " ApacheMonitor.exe"Which serves handy utility to stop and restart the server. We place the link to this application in the startup of the operating system, for example, in the folder:

C: \\ Users \\ [UserName] \\ AppData \\ Roaming \\ Microsoft \\ Windows \\ Start Menu \\ Programs \\ Startup

Installation of a mobile platform for 1C developers

2. Download and unpack the archive with a mobile platform for 1C developers, from the addresses available to you:
https://users.v8.1c.ru/distribution/total, http://online.1c.ru/catalog/free/18610155/, http://its.1c.ru/, or from torrent trackers.
The Android folder contains APK files (1cem-arm.apk and 1cem-x86.apk), select required type (arm or x86 (Intel)) depending on what architecture is used in the processor of your device.
Install the application on your device, first enable the permission to install from unknown sources (Settings - section "Security").

Creating a configuration for a mobile application

3. On local computer create a new database and launch the "Configurator". In the configuration properties, for the "Purpose of use" parameter, specify "Mobile device".

Create a general shape and place on it "Decoration - Lettering" with the text "Hello world" and the command "Click me", with the handler:

& OnClient Procedure Click Me (Command) Report ("Hello World !!!"); End of Procedure

After, open "Options" (Tools - Options) and select the "Debug" tab, set the settings according to the screenshot:

Checking firewall settings

4. Check your firewall settings, TCP ports 80 and 45455 should be available. On home computer I use "ESET Smart Security", Version 9, for it you need to go to" Additional settings", Select the section" Personal firewall ", then subsection" General "and" Change "rules.

Check on a mobile device access to the Apache web server and the 1C debugger, for this, in the browser, use the IP address of the network card through which data is exchanged with the developed 1C mobile application, examples of addresses: http://192.168.0.96 and http://192.168.0.96:45455

Setting up the 1C mobile application

5. Open the mobile platform to android device and add a new application, configure as shown in the screenshot (use your IP address):

Testing the 1C mobile application

6. Test your 1C mobile application "Hello World". Additionally, try putting a breakpoint in your button click routine.

In the future, I plan to continue this series of articles "Development of 1C mobile applications", where I will try to explain in a simple and accessible way what needs to be done to learn how to create 1C mobile applications.

On September 28 this year, 1C without much noise and pathos released an evaluation version of the platform 8.3.2.163, which was intended for testing. Anyone can read the full list of changes and improvements or, if they have a subscription,.
Of the above improvements, I think the "1C: Enterprise 8 Mobile Platform" is quite "tasty", which allows you to create an application for Android or iOS mobile operating systems using the usual 1C tools.

Mobile platform, as the developers themselves write, “This is the general name for a technology that allows you to create applications that run on mobile devices running operating android systems or iOS ".
"A mobile application installed on a device is a combination of a mobile platform and an information base."

That is, in simpler terms, you can compile your written configuration into an application for Android (.apk) or iOS (.zip). Then all this goodness can be laid out in Google play or AppStore. True, if a program for Android can be signed with a key created in the same place immediately in 1C, and it will be ready for publication immediately, then in order to publish an application in the AppStore, it will first have to be compiled using the Xcode program on a computer with an operating system. mac system OS X. And, of course, you need a developer license to publish in any of these stores.
Everything sounds good, and I naturally wanted to try the new features in action.

Creation of a mobile application on 1C

For this we need a new version platforms (), the file being taken, android SDK and JDK.
I will warn you right away: now I do not set myself the task of showing the development process of something specific on 1C, but just want to check and show you that - yes, the world has gone crazy and on 1C you can really write a program for Android.
Well, let's try to write a kind of "helloWorld" for a Googlephone. Let's make a program for testing purposes - a configuration with one common form, which we will put on the "desktop".
So, we create a new configuration in a managed mode, and the first thing we have to do, if we are writing for the mobile platform, is to specify the "Purpose of use" in the properties of the configuration itself.

And here we immediately notice that many configuration objects have become unavailable for use. We will no longer be able to use subsystems, routine tasks, XDTO packages, Web services, reports, business processes and more. Also, many procedures and methods for some objects are not available. This should be taken into account when developing.
We make a "form", create a string property with the title: "Hello, Habr!" - and throw it on the form. Let's also create a button. In the processing of pressing, write the message output, for example.

& OnClient Procedure Command1 (Command) Warning ("It works!"); End of Procedure

This is enough for us to check the performance, so we proceed to the most interesting. We save the configuration to a file for the mobile application (Configuration-\u003e Mobile Application-\u003e Write to File), run in a controlled mode, and start processing MobileAppWizard.epf. This file is in the mobile.zip archive, which we downloaded at the very beginning.
And now we are offered to fill in the initial settings, where all the required fields are underlined in red.

Location of the mobile platform - the directory where the android.zip and ios.zip files are located, which are required to form the delivery of the mobile application. They are all in the same mobile.zip archive.
We indicate the folder where we installed the Android SDK (you can download it). 1C sets the following requirements:
Android SDK Tools version - at least 20.0.3;
Android SDK Platform-tools version - at least 14;
SDK Platform version - API 8 (not lower than version 8.3).
And we also need a Java SDK (you can get it at this address) And 1C warns us that JDK7 does not work in conjunction with the Android SDK.
We indicate the folders where our .apk file will be placed, the location of the signature key and the alias with the password. If you are doing this for the first time and you do not have a key, then you can fill in the "key parameters" and generate a key for yourself (in this case, in the "key file" field you must specify the folder where this key will be created).
Click "OK" and go to the second window.

In it, first of all, we indicate the "Configuration of the mobile application" - the same file that we saved. Then the language, and only then we click on the button with the "magnifying glass" and enter the representation there. We indicate the "Application ID" - a unique name of the Java class, which will be used later to perform the update. The identifier must be written in the Latin alphabet, and 1C recommends starting its name with "com.e1c." Fill in the version and build number and click the "Create" button. If everything goes well, the system will notify you of the successful creation of the .apk file.
We drop the resulting file onto the phone and install it with your favorite manager, after allowing the installation in the system settings third party applications... Or install the program on the emulator via adb. I will say right away: everything slows down terribly on the emulator, but on the phone (I checked it only on HTC Wildfire S) things are much better, but there are still problems. For example, I got a file weighing as much as 34 Mb, so the installation took a long time. After launching, we are greeted by a splash screen, and after a while the configuration itself starts. (sorry for the photo: photo on the calculator)

So far, the new features look very crude: limited functionality of 1C, the impossibility of using the SDK directly, plus a large size and some “brakes” ... But the very ability to write a program for a mobile platform on 1C is a little surprising! Personally, I have a double opinion about this. On the one hand, this "feature" is still more like a toy, because there is no opportunity to do something really worthwhile. But on the other hand, this is clearly a big step for 1C in the direction of mobility, and if this area is actively developing, then this can bring a lot of benefits. As an example, you can equip storekeepers with tablets. If it will be possible to use "onboard" cameras, then you can get rid of readers, and scan codes directly from the tablet, you can supply them to car drivers, and send tasks for transportation or track the route of the car and the time in motion. There are, in general, many options, and the fact that it will all be in one information system, will greatly delight customers / managers, because for some reason they always have a panic fear of using a large number different systems, they want to use all the functionality on a single platform.

The practice of developing a mobile application 1C 8.3 (part 1)

This article will talk about what I had to try and what rakes to step on before I managed to make a more or less normal application for tablets. The application was initially sharpened only for Android, based on the 1C: Orders configuration and a mobile application for development.

Initially, the "wrong" approach was chosen with compiling the application and throwing it onto the tablet manually. Let me remind you that the MobileAppWizzard is used to build mobile applications. Then, on one of the forums, a beautiful solution was found using a mobile application for development. This application is included with the installation of the mobile platform. At the time of development, the platform version 8.3.3.24 was used. In the Android folder you can find the 1cem.apk file. This is a mobile development application. Its biggest plus, which saved us a lot of time, is that you can publish a mobile application on a web server, and specify a path like http: // [ Web server address]/[ Mobile app name].

On a tablet PC, in the settings of the added application, you can check the "Update from configurator" checkbox, and each time the application is launched, the application will try to connect to the web server and check for updates.

After the mobile application was deployed, the process of its finalization began.

What was required:

1. Set up the exchange between the central base and the mobile device.

2. Organize asymmetric synchronization: download data on the stock list, counterparties, stock balances and settlements from the central database, and download only customer orders from the mobile application.

3. Implement a simple interface for managers, where they can quickly view balances, prices and settlements.

At the testing stage, an intermediate base "Managed application" was used, since the 1C: Orders demo application was originally designed for exchange with the Managed application.

The first pancake came out lumpy. Literally. V82.ComConnector was used to exchange with the central database. I will not go into the details of its settings, there is a bunch of separate materials about this. I will only go through the difficulties that I encountered.

1. Using com- objects on a 64-bit server OS. To solve the problem, a wrapper was usedCOM + Applications, which is configured inComponent Services.

2. Remote callCom from another server. The called server must have the roleApplication Server, and it should be configuredCOM + Network Access. Also, the serverApache must have the appropriate rights (i.e. run as a service as an authorized user)

Having worn out with Com-connections, we decided to transfer the working base toweb services.

Much has also been written about publishing web services, but it’s written about how it works. How it does NOT work, I will share below.

The working base is deployed on the 8.2 platform, the mobile application, respectively, on 8.3.

When publishing annex 8.3 first and then 8.2. periodically snatched the "Stream format error" glitch in the 8.3 web client, or the error message "client and server platform versions differ". Republishing does not help, nor does restartingApache. But disabling the publication and connecting again helps.

Next, I caught a funny error when authorizing a user (when creatingws Definitions). When testing on a computer, authorization with a long name is easy. When trying to authorize the same user from a tablet runningAndroid, the authorization ended before it started. Experimentally, it was possible to calculate that the length of the login in Cyrillic is limited to 22 characters. At the same time, a combination of Cyrillic characters and numbers allowed to log in with a login of 27 characters. There is a suspicion that this is due to the conversion of Cyrillic characters. So, for example, in the browserFirefox a string from Wikipedia "ivo "is converted to"».

Technologically, mobile platform 8.3.3 currently has a number of limitations. The most anticipated innovation, in my opinion, is support for requests. But, since the mobile platform does not yet support arbitrary queries in dynamic lists, we had to "go the other way."

The following approach was used to solve the problem of displaying an item catalog with prices and balances:

1. Two tables have been created in the form of an item reference book. The first is a dynamic list, the directory itself. Filter dynamic list configured to display only groups. The second table is the actual balances and prices. When a row of a dynamic list is activated, the table of values \u200b\u200bis filled on the server, which is then displayed in the second table. The object model was used to obtain prices and balances. All these dances with a tambourine were performed only because there is no method “when outputting a line” or “when receiving data”, which is usual for a fat client, and it is impossible to dynamically draw numbers in a column.

A similar approach was used in the form of selection

2. FormattedString is perfect for displaying a line with current prices.

Below is a sample code.

& OnServerWithoutContext Balance FunctionWhenActivatingRowOnServer (num) RecordSet \u003d Information Registers.ProductsPrices.CreateRecordSet (); SetRecords.Selection.Product.Value \u003d number; SetRecords.Selection.Tovar.Use \u003d True; Recordset.Read (); FormattedStrings Array \u003d New Array; For Each RecordSetStringFormattedRows Array Loop.Add (New FormattedString (SetString.Price.Name, WebColors.Blue)); ArrayFormattedStrings.Add (New FormattedString ("" + String (SetString.Price) + "")); End of Cycle; Returns New FormattedString (FormattedString Array); // Insert the content of the handler. EndFunction

3. To load directories, balances and prices into the mobile application, a web service was used, which at the input receives the structure of parameters, and at the output returns the store of values. Another unpleasant discovery was the crash of the exchange with too long processing on the server side. The impression is that there is some kind of timeout, after which the application "considers" that the connection has been interrupted (although in fact, the data is still being processed in the working database via a ws-connection), and stops the exchange with an error.

To avoid this, it was decided to split full exchange on portions with focus back to the mobile application. Those. synchronize the item first, then the counterparties, then the balances, etc.

4. To obtain reports, the same approach is left as in the 1C: Orders configuration. A web service with parameters is called, a spreadsheet document is generated on the server side of the working base, and then the ready-made spreadsheet document is returned to the mobile application.

Mobile platform "1C: Enterprise 8" is the name of the technology that allows developing solutions that work on smartphones and tablets Google Android or Apple iOS. An important advantage of the 1C platform is that solutions are developed in one version for both mobile operating systems and then just exported to Androidand for iOS without any additional modification and writing platform-dependent program code.

On mobile device both the 1C: Enterprise platform and the infobase itself (configuration, in terms of 1C) are installed immediately. Information base on the device contains a version of the file database (for storing various data with which the user works or will work) and the application itself (program byte code that is executed on a tablet or smartphone).

An example of a mobile client for the EDMS "Corporate Document Flow" created on the mobile platform "1C: Enterprise 8.3"

The platform supports downloading and deploying applications by users to their devices from stores App Store or Google Play. The distribution kit contains all the components necessary to get started.

Various solutions can be created on the basis of the 1C mobile platform, but the main solution is mobile off-line clients for accounting systems. These solutions are designed to support mobile users in remote workplaces. The exchange of data is carried out by means of regular synchronization with a central database. Data exchange is possible through the following mechanisms:

  • Web services
  • File sharing
  • Email
  • and other mechanisms
    An alternative option is to work online in the web client mode.

The developed mobile application is a separate, complete software product and can exchange data with several central databases at once. For example, in one mobile application, you can implement access and work with documents from an accounting database and tasks from an enterprise document management system.


This article is for those who are interested in a mobile client. We will consider installing a mobile client on Android, connecting debugging and building an apk application in the "Mobile Application Builder" configuration.

The test mobile platform 8.3.12 has finally appeared, and now we can test the work of the mobile client. I don’t know about you, but I have many familiar developers have been waiting for this since the publication of the article on "1C: Through the Looking Glass" (Mobile client).

I assume that you are familiar with the installation of the mobile application and the collector of mobile applications, as well as that you already have the Android SDK, Apache Ant, etc. installed. There are already a lot of articles on this topic.

Let's take a demo configuration "Managed Application" for our experiments and, for starters, try to connect it to a ready-made mobile client. In my case, the client distribution is the file "1cem-client-arm.apk". Previously, the smartphone must be enabled to install applications from unknown sources. It looks like this for me:

Mobile client is an analogue of a web client, therefore, to access the database, it must be published on a web server. Everything is standard here, I post on iIS web server named “demo”. I have a file base, so you need to give the rights to the directory to the IUSR user. I am glad that the system itself reminded of this.

We connect the base in the mobile client:

Of course, it was not possible to enter the database right away J The thing is that the Administrator opens processing for working with by email and tries to set an icon for the taskbar, which is not in the mobile client. Since this functionality is also absent in the web client, the code is framed in the compilation directives "# If Not WebClient Then". We just need to find all the places where this directive is used and change it to "# If Not WebClient And Not MobileClient Then". This is enough for a start, and we can finally see the mobile client work. The command interface looks like this:

And here is a list of contractors:

Of course, these are not all places that need to be adapted to work with a mobile client. You can check the configuration using "Main menu - Configuration - --- Check configuration":

I got 84 errors including unsupported metadata objects. Plus those three places in the code that I have already limited to directives. So you still have to work on adaptation, but this is certainly not the same as writing a mobile application from scratch.

Launching under other roles also occurs, only you need to set the right to launch the mobile client.

If we do not understand what the error is, debugging will help us. The mobile client has it, but only HTTP debugging is used. I have a file base, so I will use local server debugging ("Tools - Options - Debugging") and setting automatic connection for a mobile client ("Debug - Connect - Auto connect"):

We indicate the parameters and you're done:

Setting up for a pre-prepared apk client from 1C is completed.

Now let's build our apk using the collector mobile applications... Frankly, I spent several hours trying to build the application for the first time. The assembly proceeded, but an empty list of bases opened.

And so, we have an archive mobile version platforms. We load it into the "Mobile versions" directory:

A separate item for SDK 26 and higher has appeared in the collector's settings (who, like me, have not updated for a long time - launch SDK Manager and download new packages):

Next, you need to prepare a configuration file. It was with this step that I had problems at the very beginning. Then I opened the docs and it cleared up a bit. The developer's guide says the following about this: "Each configuration that can work in the mobile client contains some auxiliary information that allows you to track the configuration change."
The configuration file must be signed. In this case, a private key is generated for each configuration, and the public key (DSAKey field) is uploaded to the 1cemca.xml file, which is used to compare the configuration signature.

To generate a key and a signature, go to the "Mobile client signature" configuration properties (right below the required permissions, if your properties are divided into categories, not alphabetically) and see the signature settings:

First, we create a private key, hide it from spies and enemies. Next, we form a configuration signature. For the future, the management advises to go to "Main menu - Configuration - Mobile client - Setting up the use of a mobile client". In the dialog, check the box "Verify the signature of the mobile client when updating the database configuration" and click the "OK" button. Judging by the manual, the signature will change if we change the composition or names of the metadata object types, as well as the names and / or composition of the register recording keys. Those. changing the forms definitely does not affect the signature and, judging by the description, changing the composition of the requisites of existing directories and documents (but this is not accurate).

The signature is ready, we can continue. I must say right away that background processes in the mobile client are not available, so they must be disabled in the permissions of the mobile client. File sharing from a PC is also not available. I additionally disabled geolocation so that during the assembly there was no error due to the lack of a key for working with maps. I ended up with the following list of permissions:

Problems