Mobile platform 1c how to work with it. Automation Tips. Planning for operational management of production

I think everyone has already heard about the new features of the new 1C release. But people who are far from programming for mobile platforms may not understand some of the features. To do this, we made this "easy" guide.

Update 08/12/2012 or 1C anneals.

Good afternoon. 1C updated the mobile platform to 8.3.3.30.

The fun began, because Google also decided to update the KFOR.

What needs to be done to make it work.

1. The database name is not specified - we climb into the configurator and make the field open for editing.

3. We climb into the KFOR manager and download the KFOR 17. It will not work without it.

4. We climb to the site dl-ssl.google.com/android/repository/tools_r20-windows.zip, unzip it into the SDK folder, look for the tools folder there first, rename it, and merge the archive into the new tools folder.

5. Changes made in processing - attached to the header.

Update 06/06/2013

Having united intelligence with serg_gre, we established how it is possible to write conf for a mobile application, without bothering with compilation.

What an idea - in fact, there are 2 types of apk files (these are those that are installation for the phone):

1. this is a compiled file that you compile yourself and follow the instructions in this article. After compilation - you get a config, and now you can work with it, however, if you want to redo something, then you will have to recompile and reinstall everything.

2. This is the initial apk, which is in the archive mobile8.3.3.24Android1cem.apk, and its trick is that you can prescribe different paths to configurations there yourself. And it will automatically update the database when connected to the server.

And so, it is MUCH more convenient. How to do it?

After you have created a configuration, you can publish it under some name for access via the web (how to do this - there are a bunch of articles, including mine), but we are interested in everything from there, until the publication begins.

Instead of publishing the database in the usual mode, we click in the configurator - Configuration - Mobile Application - Publish.

Of course - we specify the name of the base (I think it makes no sense to say that it should be different from the name of the web access publication) and click publish. Let's give her a name infobase.

To do this, go to 127.0.0.1/ infobase. Please note, without any wsdl and so on. If we see the xml schema, then everything is ok.

After that, everything will be cool. Note that this only updates the configuration, not the data.

One question remains, from the same observant serg_gres:

In the configurator - in the menu Debug - Start debugging - Mobile application.

The question is what kind of animal is this? If anyone knows, welcome to the comments.

Maybe everyone knew about it, but as usual, what is in sight - many do not see :)

Update 05/30/2013

A new version of the platform has been released - 8.3.3

I would like to highlight some features and changes in it.

License:

Licensing of the mobile platform and mobile applications

Mobile application development tools and the 1C:Enterprise 8 mobile platform for development purposes are included in the commercial distribution of the 1C:Enterprise platform and are available at no additional charge to developers of application solutions who legally own the distribution kit of the 1C:Enterprise 8.3 platform.

Mobile applications developed by users and partners on the 1C:Enterprise 8.3 platform are currently allowed to be distributed without payment to 1C if the number of distributed copies does not exceed 50. To distribute more copies, agreement with 1C is required.

In the forum, in the corresponding branch - posted a complete list of changes from 1C. The request there to unsubscribe on the found glitches.

From myself, I want to highlight a few features that I liked:

On the mobile platform it became possible:

  • Set a timeout when interacting with network resources;
  • Use non-ASCII characters in usernames or passwords;
  • Form a URL (and get values ​​from it) in accordance with the RFC 1738 standard (http://www.ietf.org/rfc/rfc1738.txt) if arbitrary text is added to the URL;
  • Programmatically generate an HTTP request and process the response, interact with REST services.
On the mobile platform it became possible:
  • Get slices of the first/last at the very first and latest (current) points in time with greater speed.
At the expense of visual changes - it became much more pleasant to work. Those. buttons and icons began to adjust to the screen size, now it’s really possible to hit them. Subjectively - it became faster to work, less stupid.

However, there were some small things. For example, the information in the input field is shifted up, not much, but it catches the eye.

When you open the directory - the name is normal, and the picture of the props is pushed up a lot, which is very infuriating :) Although this may be intended. I created a report on the ACS - it did not appear in my mobile application.

The installed version of the program eats up 118 meters of phone memory.

Welcome to the forum :)

First version of the article

1C has released a new platform 8.3.2, a feature of which is the ability to develop a configuration for mobile platforms. The bottom line is that after all the manipulations, you get ready-made .apk (for Android) and .zip (for iOS) packages.

The main idea is that a 1C programmer can do this and fully control the development. You can place this file on Google Play or on the AppStore, and people can download it.

The main features are described here http://v8.1c.ru/overview/Term_000000818.htm.

Under android, the .apk file weighs from 38MB. Here it is worth paying attention to the fact that it loads all these megabytes into the phone’s memory, so if you don’t have about 50 MB available on your phone’s memory, then you won’t be able to install it J.

Let's get down to the fun part, namely, let's try to create our own configuration. To do this, you need to update the platform to 8.3.2, and download the file http://users.v8.1c.ru/getdist.jsp?path=mobile/8_3_1_20/mobile.zip.

Unzip it into some folder, then we need to install the Android SDK and Java SDK.

In section Java Platform Standard Edition press JDK Download, check the box that you accept the license agreement and download the file according to your operating system. Installation shouldn't be a problem. After that, it is advisable to reboot. Please note - Java must be 1.6! On 1.7 everything will compile, but it will not work :)

The Android SDK includes the tools you need to develop Android apps. It is recommended to download the EXE file, but I suggest downloading the ZIP version and unpacking it yourself into a directory convenient for you (if there is no ZIP link, click the Other Platforms link).

Please note that this should be a "forever" directory. And it is better not to move it anywhere, otherwise you will have to reconfigure the development environment. I suggest creating an Android directory somewhere. It is highly desirable that the path to it be short. Ideal - :android. For ourselves, remember this directory under a pseudonym. And unpack our SDK archive into it, we get android-sdk-windows.

Then we go there and make sure that we have downloaded the Android 2.2 platform - open the plus sign - SDK Platform, if not installed, then check the box and install it.

Please note that the synonym and comment must be empty, because then the parser will not work adequately. Thanks to the community for being vigilant :)

After that, unzip the archive, which was downloaded to a folder with an adequate name.

We open the configuration in the managed forms mode and open the processing that was in the archive and fill in the fields.

Everything is a little fun here - first we select the file that we saved, then we select the language, then we click on the magnifying glass, on the application view - we write the view.

If the language cannot be selected, then you have a comment or description in the configuration. Read above.

The application ID is also critical, if it matches an existing one on the store, the market will not allow it to be downloaded, but for now it doesn’t matter to us, and we’ll get it somehow, just keep in mind that the name should contain only Latin letters (and it’s advisable not to contain capital letters).

Here everything is no less fun, in the location of the mobile platform we indicate the address of the unpacked archive, i.e. the top folder, which contains more folders for Android and iOS.

We choose where we will write the result.

And here is the fun with the key. You need to understand that this is an important file, if you previously published the application on the market under one key, then in case of loss it will be fun. But we'll leave that for now. And so, since we don’t have a key, we need to create it, for this we essentially specify the Login and Password of the key, then data about ourselves and form the key, then select it and click OK, if everything is fine, then the console window will appear, which will describe the stages of the operation. After all this, you will receive files that you can download to your phone and install.

Please note that you must disable the Install only from known sources option to install.

And finally, the nuances:

When developing a mobile application, it is necessary to take into account the limitations that

imposes a mobile platform in comparison with the 1C:Enterprise platform for

personal computer:

  • Limited list of available configuration objects and mechanisms;
  • Limited set of attribute properties;
  • Limited set of managed form elements;
  • Simplified implementation of some mechanisms (for example, a dynamic list or desktop);
  • Absence of usual forms and normal launch mode;
  • Lack of debugging tools for the mobile application;
In a nutshell, this is how to do it.

I will attach a couple of pictures of the created conf. Do not forget that for tests, if there is no android, you can download http://bluestacks.com/. It certainly looks miserable there, but for a start it will do.

If you have any questions - welcome to the comments.

Here you can download a test conf from 1C on Android

https://play.google.com/store/apps/details?id=com.e1c.mobile.orders&feature=search_result.

It has already appeared for the UNF conf, you can download it from the link:

https://play.google.com/store/apps/details?id=com.e1c.MobileSmallBusiness

However, it is empty, i.e. ready to work with your base.

Mobile application development is always associated with the need to learn additional technologies. But what if we reconsider the question and use already familiar tools?

For the first time, 1C tried to enter the mobile development market in 2006. At that time, there was a real boom in automating the work of remote employees using a PDA. New programs for solving such problems appeared like mushrooms, and such a vendor as 1C with successful products for automating various business areas could not miss the chance to enter the profitable market.

By the middle of 2006 the company presented the release of a new product with the promising name "1C:Enterprise 8. Extension for PDAs". The developers of 1C, who saw the prospects of the 8th platform, had a hope that now on one tool it became possible to carry out development under the popular Windows Mobile operating system in those years without much difficulty.

In practice, things looked much worse. This tool did not allow to embody original ideas. Package " PDA extension”was more of an add-on for certain typical configurations than a full-fledged development solution. It was not intended to expand the functionality of the configuration by adding new metadata objects. At the mercy of third-party programmers were very simple things: creating new forms for interacting with the user, processing user events.

Yes, there were all sorts of circumventions of the restrictions, but even they did not allow for a real turn around. In addition to technical limitations, consumers have experienced a serious financial barrier. Companies that decided to implement a solution from 1C needed to purchase high-performance PDAs, purchase licenses for Windows Mobile, and also pay 1C for the delivery of the solution and the final application.

The solution from 1C was too expensive. Companies accustomed to save money continued to use alternative solutions. Moreover, the developers of alternatives managed to provide their products with functionality for interacting with typical 1C solutions.

Technical limitations, high cost did not allow the product to repeat the enormous success of the desktop platform. The idea to conquer the mobile market corp.

applications failed miserably.

Step forward

Loss and losses from an unsuccessful project did not put an end to the development of a promising direction. In 2013, 1C introduced the first stable version of the new 8.3 platform, which has the function of developing mobile applications.

1C completely rethought the approach to solving the mobile "theorem" and took into account the mistakes of the previous unsuccessful product. The result is a completely new tool that has nothing in common with its predecessor and is focused on the latest mobile platforms - Android and iOS.

Mobile applications in 1C style

For a full acquaintance with the possibilities of developing for mobile platforms, let's try to develop a small configuration. Using a cross-cutting example, you can better evaluate the available functionality and decide on the possibility of using the 1C platform to solve problems.

To work, you need the latest release of the 1C:Enterprise 8.3 platform. The educational version of the distribution kit is available on the official 1C website. To recreate an example, its capabilities are more than enough.

In addition to the 1C:Enterprise 8.3 platform, we will need a number of additional tools. The article will consider an example of developing an application for Android. In this regard, you will have to download: Android SDK and Apache WEB server. The first component contains everything you need to build the application and an emulator for testing, and the WEB server is useful for quickly downloading the application to a mobile OS.

We will also need to supply the "Mobile Developer Platform". It contains a configuration to simplify the process of building the created mobile application, as well as a mobile developer platform. It must be installed on a mobile device or emulator.

To build an application ready for distribution via Google Play, you will need to download Apacheant And JavaJDK. This topic is beyond the scope of the article, so you can learn more about working with these tools and building an application in the corresponding section of my .

Configuring tools

Platform " 1C:Enterprise 8.3' and the Apache web server come with installers and are installed in the standard way. Android SDK you just need to unzip it into a separate directory and run “ sdk manager.exe". You will see a window with a choice of available packages for installation. For testing, considered within the framework of the example article, you will need to select and install: Android SDK Tools, A Android Platform Tools, SDK Platform API 17.

The last step is to create a new infobase. For those who are not involved in the development of under on " 1C:Enterprise»I will explain that any solution for this platform consists of an information base and configuration. Adding a new database is carried out by clicking the button " Add» start window. After adding the base, open it in the " Configurator».

First mobile configuration

In the main menu of the configurator, find the section " Configuration” and select the item “Open configuration”. The configuration tree (of the objects that the future application will consist of) will be displayed in the left part of the window. Select the configuration root in it and press the key combination " Alt+Enter". The properties editor will open in the right part of the configurator window.

Let's call the configuration " TODO” and in the “Destination of use” property, specify “ Mobile device". Please note that after completing the last step, some nodes of the configuration tree will become inactive. Unfortunately, you won't be able to use all the metadata objects on the mobile platform.

To solve our problem, we need to create several metadata objects in the configuration tree:


Procedure AddTask(Task) ExportRecordManager = CreateRecordManager(); RecordManager.Period = CurrentDate(); RecordManager.Task = Task; RecordManager.Status = Task.Status; RecordManager.Write(); EndProcedure

Listing 2. Code for GetList of Unclosed Tasks() function

Function GetList of Unclosed Tasks() Export Request = New Request; Query.Text = "SELECT | TaskStatusLastSlice.Task AS Task, | TaskStatusLastSlice.Task.DueDate AS DueDate |FROM | DataRegister.StatusTasks.SliceLast(&CurrentDate, Status<>VALUE(Enumeration.TaskStatuses.Completed)) AS TaskStatusSliceLast | |ORDER BY | DueDate DESC"; Query.SetParameter("CurrentDate", CurrentDate()); Return Query.Execute().Upload(); EndFunction

We have dealt with obtaining data from the information register and recording them, now we will teach our reference book to work with the register. To do this, add a common module named " WorkWithTasks". You can do without it, but I immediately want to focus on the possibility of splitting the code into modules. Many 1C developers still neglect this recommendation and describe all the logic in one place, thereby making subsequent code maintenance difficult. Let's create a new procedure in the module " Create New Task» (see Listing 3).

Listing 3. Code for the "Create a New Task" procedure

Procedure CreateNewTask(Reference) Export If Reference.ThisGroup Then Return; EndIf; Request = New Request; Query.Text = "SELECT | TaskStatusLastSlice.Status |FROM | DataRegister.StatusTasks.SliceLast(&CurrentDate, Task = &Task) AS TaskSliceLastStatus"; Query.SetParameter("CurrentDate", CurrentDate()); Request.SetParameter("Task", Link); Result = Query.Execute().Select(); If Result.Next() Then If Result.Status<>Link.Status ThenRegistersInformation.StatusTasks.AddTask(Link); EndIf; Otherwise, DataRegisters.TaskState.AddTask(Reference); EndIf; EndProcedure

Before creating a new record, a check is made for the presence of existing records for the task. If the record already exists, then you need to compare the task statuses. If the status from the register does not differ from the status of the item being written, there is no need to create an additional entry.

With the final touch, open the form of the "Tasks" directory element and create an event handler " AfterRecordingOnServer". In it we will write a call to the procedure described in the third listing:

WorkWithTasks.CreateNewTask(CurrentObject.Reference);

Working on the interface

The main functionality of the application is ready - the user can create tasks, and each new task forms an entry in the periodic information register. Now let's take a look at the interface. Let's bring the work with tasks to the fore. After all, it is logical to display a list of non-closed tasks and the ability to create a new one immediately after launching the application?

Let's find the node " General forms" and add a new form named " Desktop". Let's open the created form in the interface constructor and add an attribute like " Value Table". Let's call it "OpenZachi". The table will contain two columns - " A task" (Reference Link. Tasks) and " Execution Date" (Date of).

The next step is to drag the added attribute onto the form. We should get the interface of the simplest table. We will not indicate any dimensions, we will leave the concern about scaling the interface to the platform.

For the created table, in the property inspector, check the box for the property " View only", and the property " Command Bar Position» Specify the value «No». We will fill the table with dynamic information, so there is no point in editing by the user.

Now let's describe the form's event handler "OnCreateOnServer". Let's add one line of code to it:

OpenTasks.Load(InformationRegisters.TaskStatus.GetList of NotClosedTasks());

In the code, we refer to the procedure we described " GetList of Unclosed Tasks” and the result of its execution is placed in the table.

Let's go back to the form constructor and add a group of type "Normal group without display" with two buttons: " Create" And " Refresh". Property " grouping» Set the value of the added group to «Horizontal». For a more expressive design of the buttons, we will add images and change the default font.

Now select the button Create" and give it a global command " Tasks: create". This will allow you to create tasks without entering the directory itself. By pressing the second button, we will update the contents of the table with tasks. To do this, you will need to create an additional form command.

All new form commands are created on the tab of the same name " Teams". The principle is simple - we add a new command, describe the action code in it and then associate the command with the interface, in our case with the button.

We should also not forget that we are developing a managed application, so we need to clearly distinguish between client and server code. When the button is clicked, the context will be " OnClient”, and we will receive data from the database from the server. In code it looks like this:

&At the Client Procedure UpdateTaskList(Command) UpdateList(); EndProcedure &OnServer ProcedureOnCreateOnServer(Abandon, StandardProcessing) OpenTasks.Load(InformationRegisters.TaskStatus.GetList of UnclosedTasks()); EndProcedure

Now let's define our desktop form as the homepage area. Open the configuration properties (select the topmost node and click " Alt+Enter”) and for the property “Initial Page Workspace” set the value to “ One column”, then add our form to the list “ Desktop».

The application is completely ready and it's time to test it in operation. Try running the example and create some tasks with a status other than " Completed". The information register has been replenished with new entries (this can be viewed through the menu item " All features”) and some of them are displayed on the desktop.

Landing on Android

The configuration works great on desktop, and now is the time to test it on a mobile OS emulator. To prepare a new emulator, run a shell ( cmd.exe) and go to the "toos" directory of the Android SDK distribution. Execute the command " android.bat avd”, which will launch the virtual Android device manager. In it, click the "Create" button and in the window that appears, specify the parameters of the virtual device. In my working environment, I decided to emulate Nexus S with Android version 4.2.2. (API Level 17).

After creating the device, we will immediately launch it. While android is loading, let's go back to the configurator and publish our application on the web server. In the main menu of the configurator, select the item " Configuration» -> « Mobile app» -> « Publish". In the publishing settings window, specify the application name (it can be anything), the web server (in our environment, it should be one) and the directory for storing the settings.

Specifying " todo-mobile", the application will be available at the address - " http://host/todo-mobile". Click "ok" and try to access the published application using a browser. If successful, the server will return the XML code of the created configuration.

We return to the emulator and load the application with the developer's mobile platform into it. The application file itself is available along with the developer's mobile platform delivery and is called "1cem-arm.apk". To install this application in the emulator, we will use the utility " adb.exe» from the directory « platform-tools»: adb.exe install –r 1cem-arm.apk.

After successful installation, open the list of applications in the emulator and launch the developer's mobile platform. In the window that opens, click " Add application” and in the “address” field specify the URL to our web server. I have it http://192.0.168.106/todo-mobile. Press " Add” and our configuration is successfully moved to the mobile platform. The application is ready to go. Test the result and return to the configurator, it's time to provide applications with "mobile functionality".

Sending SMS/MMS messages

Functions for working with SMS/MMS Messages are supported differently by mobile platforms. For example, when running an application on Android, the developer has the opportunity to subscribe to SMS and get access to new messages immediately after receiving them. Alas, the same feature is not available on iOS, so the documentation should be at hand during development.

An object is provided for sending SMS messages. SMSMessage. Consider an example:

&OnClient Procedure SendSMSMessage(Recipient,MessageText) NewMessage = New SMSMessage(); NewMessage.Text = MessageText; NewMessage.Recipients.Add(Recipient); Telephony Tools.SendSMS(NewMessage); EndProcedure

The code is quite simple and hardly needs comments. Now let's look at the registration of a subscription to incoming messages:

&OnClient Procedure ConnectMessageReceiveHandler() MessageSubscription = NewNotificationDescription("ProcessingNewMessages", ThisObject); Telephony Tools.ConnectSMSMessageHandler(MessageSubscription); EndProcedure &AtClient Procedure NewMessageProcess(Message, AdditionalParameters) //Process new message //Message.Sender, Message.Text; EndProcedure

Procedure " Handling New Messages” will be called each time a new SMS is received. Through the parameter " Message» an object of type « SMSMessage” and we can easily get the text of the message and information about the sender.

Working with MMS messages is done in a similar way. We first create an SMSMessage and then add an attachment to it (for example, images). With this simple action, SMS turns into MMS:

NewMessage= New SMSMessage(); Attachment = New MMS Attachment; Attachment.Data = Image; Attachment.ContentType = "image/jpeg"; MMSMessage.Attachments.Add(Attachment);

Making calls from a mobile app

A call is made programmatically using the "DialNumber" method of the "Telephony Tools" global object. Before calling the method, it is highly desirable to check the possibility of making a call:

If TelephonyTools.SupportedDial() Then TelephonyTools.DialNumber(PhoneNumber, Call Immediately); EndIf;

Parameter " Call Immediately” affects dialing performance. When it equals True”, dialing is performed automatically through the standard calling application. If set to False, the user will also see the standard dialer interface, but will need to press the button to make a call. summon».

Call log

The mobile platform allows the developer to interact with the call log. For example, you can easily get a list of outgoing, missed or incoming calls. This feature is only supported on Android:

CallLog = TelephonyTools.GetCallLog(); Selection = New DataComposition Selection; Selection Element = Selection.Elements.Add(Type("DataComposition Selection Element")); Selection Element.LeftValue = New DataCompositionField("Call Type"); Selection Element.ComparisonType = DataCompositionComparisonTypeData.Equal; Selection Element.RightValue = CallLogCallType.Missed; SelectionItem.Use = true; List of Call Log Records = Call Log. Find Records (Selection); //In the List of Records of the Call Log there will be a collection of records

Geopositioning

Almost any modern smartphone has geolocation functions. You can use this functionality from the built-in 1C language. Obtaining the current coordinates of the device can be conditionally divided into 2 stages: choosing a geopositioning provider and processing the received coordinates:

//Let's let the platform choose the provider IdealProvider = Geolocation Tools.GetMost AccurateProvider(); Coordinates = Geolocation Tools.GetLastLocation(IdealProvider); //If the coordinates were received a long time ago, then update If Coordinates = Undefined OR CurrentDate() - Coordinates.Date > 3600 Then GeopositioningTools.UpdateLocation(IdealProvider, 60); Coordinates = Geolocation Tools.GetLastLocation(IdealProvider); EndIf;

Working with multimedia features

The developer has the opportunity to take pictures, video recordings, audio recordings using the built-in language: Take a photo(), Make a video recording(), Make an audio recording().

Under what mobile OS is it better to develop on 1C?

Despite my love for Apple technology, it is best to create mobile applications using the 1C platform for Android. There are several reasons for this, but the most important of them is the supported functions. Unfortunately, under iOS, many necessary things are not supported. For example, the inability to programmatically subscribe to SMS messages or interact with the call log may make it impossible to implement some ideas. Android is more friendly in this regard. Do not forget about the cost of the devices themselves. Not every company will be ready to splurge on the acquisition of mobile devices from Apple.

Instead of completing

Platform " 1C:Enterprise 8"in practice has proven its willingness to become a simple tool for the development of corp. Applications for mobile platforms. The examples discussed in the article are additional confirmation of this. It is not at all necessary to spend resources on learning native tools if the functionality of the application fits into the capabilities of the mobile platform and the company is dominated by 1C products.

On September 28 of this year, 1C released a trial version of the 8.3.2.163 platform, which was intended for testing, without much noise and pathos. Those interested can read the full list of changes and improvements or, if they have a subscription, .
Of these improvements, it seems to me that “Mobile platform 1C: Enterprise 8” 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 of a technology that allows you to create applications that run on mobile devices running Android or iOS operating systems."
"A mobile application installed on a device is a combination of a mobile platform and an information base.".

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

Creation of a mobile application on 1C

To do this, we need a new version of the platform (), the file that is taken, android SDK and JDK.
I’ll warn you right away: now I don’t set myself the task of showing the process of developing something specific on 1C, but I just want to check and show you that - yes, the world has gone crazy and you can really write a program for Android on 1C.
Well, let's try to write a kind of "helloWorld" for Googlephone. Let's make a program for test 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 need to do if we write for a 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, scheduled tasks, XDTO packages, Web services, reports, business processes, and much more. Also, many procedures and methods for some objects are not available. This should be taken into account during development.
We make a “form”, create a string prop with the title: “Hi, Habr!” - and throw it on the form. We will also create a button. In the handling of pressing, we will write the output of a message, for example.

&AtClient Procedure Command1(Command) Warning("It works!"); EndProcedure

To check the performance, this is enough for us, so we proceed to the most interesting. We save the configuration to a file for the mobile application (Configuration->Mobile application->Write to file), run in managed 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 primary settings, where all the required fields are underlined in red.

Mobile platform location - the directory where the android.zip and ios.zip files are located, which are necessary to generate the mobile application delivery. They are all in the same mobile.zip archive.
Specify 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 (can be obtained at this address) Moreover, 1C warns us that JDK7 does not work with the Android SDK.
We specify the folders where our .apk file will be placed, the location of the key for the signature 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. Specify "Application ID" - the unique name of the Java class, which will be used later to perform the update. The identifier must be written in Latin, 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 about the successful creation of the .apk file.
We upload the resulting file to the phone and install it with our favorite manager, having previously allowed the installation of third-party applications in the system settings. Or install the program on the emulator via adb. I will say right away: everything is terribly slow on the emulator, but on the phone (I only checked it on HTC Wildfire S), things are much better, but there are still problems. For example, my file turned out to weigh as much as 34 Mb, so the installation took a long time. After launch, we are greeted by a splash screen, and after a while the configuration itself starts. (sorry for the photo: I took it with a calculator)

So far, the new features look very “raw”: limited functionality of 1C, the inability to use the SDK directly, plus a large size and some “brakes” ... But the very possibility of writing a program for a mobile platform on 1C is a little surprising! Personally, I am of two minds 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 towards mobility, and if this direction is actively developed, then this can bring a lot of benefits. As an example, you can equip storekeepers with tablets. If it is possible to use "on-board" cameras, then you can get rid of the reading devices, and scan the 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, a lot of options, and the fact that all this will be in a single information system will greatly please customers / managers, because for some reason they always have a panic fear of using a large number of different systems, they want to use all the functionality on single platform.

Mobile platform 1C:Enterprise is a set of tools and technologies for rapid development of applications for mobile OS iOS, Android, Windows Phone / 8.1 / 10, using the same development environments (Configurator or 1C:Entrprise Development Tools) and the same development methods, that are used for "normal" 1C applications. 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 almost any server solution.

background

Back in the days of 1C:Enterprise version 8.0 (and subsequent versions), there was a software product "Extension 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 ended on January 1, 2015.
The extension was of limited use even during the heyday of Windows Mobile communicators, and the departure of such devices from the mobile market clearly did not add popularity to this software product. iOS and Android devices have occupied almost the entire mobile device market, and it has become clear that support for these operating systems is one of the key points for a system that must be operated in today's 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 of all think about solving applied problems, and secondly, about what features of the OS he uses to solve these problems . In other words, you need a tool that isolates the application developer from the specifics of a specific mobile OS and development tool.

Mobile platform

Based on the experience of developing and operating an extension for pocket computers, it was decided to develop a specialized system that would satisfy several requirements:
  • it must support modern popular mobile operating systems and devices running them. First of all, these are iOS by Apple and Android by Google.
  • this system should allow the use of developed applications in the style adopted on modern mobile devices. In particular, the interface should rely on manual control (in the literal sense of the word) using touch screens.
  • the system should provide a uniform programming interface for implementing various specific mechanisms, regardless of the mobile OS used.
  • the developer must use the same tool and the same development approaches as when developing applications for a "regular" computer.
  • an application developer should develop an application solution in a familiar development environment, using a single code for desktop and mobile systems, if possible.
  • the interface of an application solution running on a mobile device should be similar for different platforms and generally unambiguously recognizable.
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 iOS, Android, Windows Phone / 8.1 / 10 mobile operating systems using the same development environment (Configurator) and the same development methods as for regular 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, email, etc.
The mobile platform was well received by the community, various articles on this topic began to appear (for example, and). In order to develop a full-featured application that runs simultaneously on the vast majority of mobile devices, it now required minimal time and knowledge, which is not fundamentally different from the knowledge of a “regular” application developer on the 1C:Enterprise platform. Of course, such a low entry threshold attracts developers who need to provide some basic functionality for employees working on the road, bosses, and other mobile employees who need to work with the corporate system.
It is easy to start developing a mobile application on the 1C:Enterprise platform. In the Configurator, you need to set the configuration property "Purpose of use" to the value "Mobile device". In this case, some of the application configuration objects will become unavailable (characteristics type plans, charts of accounts, etc.), but mobile application-specific properties will become available (for example, built-in multimedia and geolocation tools for a mobile device, etc.).


At the same time, you can debug the main application algorithms (not directly related to mobile specifics) directly in the Configurator on the developer's computer. At the same time, it is recommended to frame sections of the code in which the "mobile" functionality is called with appropriate instructions to the preprocessor in order to avoid errors when executing the code on a personal computer:
#If MobileApplicationClient Then Data = GeolocationServer.GetProviderName(); #EndIf
Starting with version 8.3.7 of the mobile platform, debugging the application directly on a mobile device has become available (more on this below).

Development on a mobile platform can follow a variety of approaches, but there are a few main points that stand out. From the point of view of building the actual mobile application, its functional richness and role in the IT infrastructure of the enterprise:

  • a mobile application can be an integral and integral part of an existing enterprise information system. The mobile application will provide an interface and other features (including data exchange) tailored to the capabilities of the existing information system. In this case, the mobile application is very tightly connected with the "normal" information system and cannot be operated in isolation from it.
  • the mobile application performs specific tasks that are practically unrelated to the enterprise information system. There is only a minimal set of data that is exchanged between the mobile application and the information system. In this case, most likely, the mobile application will exchange using some standardized protocol, which makes it possible to use this mobile application in completely different cases and situations.
The two situations described above can be considered extreme options. But these are not the only development options. The application developer can independently choose the integration options between the mobile application and the information system that acts as a back office for it.
The mobile application is developed as a completely standalone configuration, but may share some of the source code 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).

Mobile platform device

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 works 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 comes in the form of regular (which is used during app build for publishing to the app store) and mobile developer platform which is used (surprise) during mobile app development.
  2. A mobile configuration is a configuration of the 1C:Enterprise software system written as an XML file.
  3. The combination of mobile platform and mobile configuration results in a mobile application.
  4. Mobile application assembler is a specialized application solution that can make mobile platform, configuration, splash screens, icons and other components into a ready-made mobile application file that can be uploaded to Apple AppStore, Google Play, Windows Phone Apps / Windows Apps stores.
Why is everything so difficult? Why can't it be done on a mobile device exactly as it is done on a large platform? Those. install one mobile platform on the device and load any number of configurations/applications into it? This prohibits making licensing restrictions on apps that are distributed through app stores. For example, if your app downloads 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 is in the developer's mobile platform is not intended for the distribution of mobile applications even within one company, not to mention distribution to the developer's clients.
After the mobile application is on the target mobile device, it becomes necessary to use some kind of database (the 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 the personal computer. It is compact and fast enough, but the main thing is that it provides exactly the same behavior that application developers are used to when working on a platform for personal computers.
It is also worth noting that inside the mobile application is built according to the same scheme as the work of a conventional platform with a file version of the infobase: 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 currently used in the mobile world: this is the ARM v5 and higher architecture and x86.
In addition, special permissions may be required to interact with certain features of the mobile device (telephony, GPS, work with the built-in camera, etc.). For iOS, they are set directly during the operation of the application itself, and for Android, permissions are specified when the application is created. Required permissions are specified when developing a mobile application and are used by the mobile application builder, but more on the builder later.

A little 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. This means that we can use the 1C mobile platform in the same way as we use the “large” 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 a list of applications registered in it:

To add a new application to the platform, you need to place an XML file with its description on a resource accessible from a mobile device via the HTTP protocol. 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 placed on the web server on the developer's computer (accordingly, this computer must have a web server - IIS or Apache).

If you specify the "Restart from configurator" option for the application, then the application on the mobile device will be automatically updated from the developer's computer every time the developer updates the XML configuration file hosted on the web server.
When the "Debugging enabled" option is enabled, it is possible to debug the application step by step on a mobile device from the Configurator on the developer's computer (in the Configurator, the "Debugging via HTTP protocol" option in the "Tools \ Options" menu must be selected). If you set breakpoints in the code in the Configurator and select the "Mobile application - start debugging" command, then the mobile application on the device will stop when the executable code reaches the breakpoint, and you can view the values ​​of variables, the call stack, etc. in the Configurator.

What can?

So what does the mobile platform do? Enough:)
If you do not use the specific terms of 1C:Enterprise, then the mobile platform provides an opportunity to work with regulatory and reference 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 program, a mobile sales program, and the like.
But in addition to the usual functionality that is on the platform for a personal computer, the mobile platform must provide work with specific features that are unique to mobile devices:
  • work with calls and call log;
  • work with short messages (SMS) and their list;
  • contacts;
  • calendars;
  • geopositioning (without laying routes);
  • allows you to take pictures, as well as video and audio recording;
  • respond to screen orientation changes;
  • work with notifications (local and PUSH, both directly and through a special intermediary service);
  • scan barcodes and QR codes with the camera
  • Monetization of mobile applications (i.e. a way to give a mobile application developer opportunities for additional income):
    • Working with Apple In-App Purchase (for iOS OS) and Google Play In-App Billing (for Android OS) purchase services, with which you can organize various kinds of subscriptions, purchases of functionality, etc. in a mobile application
    • Show ads in mobile apps (iAd for iOS and AdMob for Android are currently supported).
  • etc.
It is clear that some features may not be available on each specific device, so to determine what can be done on the device on which the mobile application is running, special methods are provided that allow you to find out what is available on this device, for example, the ability to dial numbers or not. Thus, approximately the following usage scheme is implemented: we check whether it is possible to use some possibility or not, and if possible, we use:
If TelephonyTools.SupportedDial() Then TelephonyTools.DialNumber(PhoneNumber, Call Immediately); EndIf;
Hiding details about the mobile OS used from the application developer, providing him with unified mechanisms for using mobile functionality is an important task for us. We believe that we have successfully solved the problem. Differences in the implemented mechanisms are either absent or minimized. Except, of course, for cases where there is no functionality in one of the operating systems at all.
For example, the technique for working with push notifications is very different between Google and Apple. We have put a lot of effort into unifying the mechanism for working with PUSH notifications from the application code. In the case of a mobile application, we succeeded almost 100%: the same application code on a mobile device processes the receipt of PUSH notifications on both iOS and Android. And the code for sending 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). The whole difference lies in the different settings directly on the proxy site https://pushnotifications.1c.com/ ; to work with APNS, you need to upload an SSL certificate to the site (which Apple issues for the application at the request of the developer), to work with GCM, you must specify a unique application identifier.
Obviously, it is impossible to implement all the features that you want to have in a mobile application right away. And you always have to find a compromise between several very useful things. And if something is missing for you, write to us about what business tasks (after all, the platform is, first of all, a tool for implementing business tasks!) You cannot solve and what mechanism would help you for this.

What does it look like?

The graphical interface of the mobile platform is a separate issue. In 1C:Enterprise, as you know, the interface is described declaratively. On the one hand, this 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, it allows the platform to render the interface uniformly on screens of different sizes, in thin and web clients. 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 and including 8.3.5), the graphical interface of applications looked very familiar to sophisticated 1C users; in fact, he transferred the interface familiar from the "desktop" versions of 1C to the mobile world. But from the point of view of users who were not previously familiar with 1C, the interface looked somewhat archaic.
Taking into account the comments and suggestions, we have radically 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 mobile application developers corresponds to the development model in Taxi. At the same time, the mobile interface is fully consistent with the design approaches adopted in mobile applications and . The interface fully takes into account the specifics of the mobile world: a small screen size (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 platform mechanism responsible for placing elements in the form (layout) turned out to be so successful and timely for the mobile platform that it was released on it earlier (in version 8.3.6) than in the PC platform (in version 8.3.7) for which it was primarily intended.
In the picture you can see how our interface has changed.
Application "Management of a small company" on the version of the mobile platform 8.3.5:


It is on version 8.3.6:

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

Collector - and what kind of animal is this?

As mentioned earlier, a mobile application consists of several components (the actual mobile platform, configuration, various resources), which must be a single whole in order to place the application in the store. To facilitate the transformation of components into an application, a mobile application assembler has been 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 assembler to perform its work, you need to download and install various software packages that are needed for its operation (Java and Android SDK, etc.), then specify the paths to these packages in the assembler settings and set some additional parameters (developer keys etc.).


After setting up the collector is ready to work. In general, work with the collector looks like this:
  1. We download the version of the 1C mobile platform on which we will build the application
  2. Loading the configuration from which we will build the mobile application
  3. We create a mobile application in which we indicate for which platforms (Android, iOS, Windows) we need to build, what configuration and platform should be used (in particular, specify which certificate to build for iOS to use if the application works with PUSH- notifications).
  4. We perform “one-click” assembly of a mobile application for all selected platforms
  5. With another click, we send the collected mobile applications to the application stores (if this is an application for iOS or Android). In the Windows Apps / Windows Phone Apps stores, the application must be uploaded manually, because Microsoft does not yet provide an API for hosting an app in the store.
It should be noted separately that the assembler is not needed for developing and debugging a mobile application. To do this, you can use the developer's mobile platform and the Configurator tools to transfer the configuration to a mobile device. But to distribute a mobile application, you need an assembler.

Applications on the mobile platform

The 1C company itself releases a number of applications on the mobile platform that are mobile clients of 1C server applications (1C: Document Management, 1C: Small Company Management, etc.). These applications implement some subset of the functionality of "regular" clients. In the case of the mobile version of 1C: Small Business Management, the functionality is sufficient for the full use of the program, and we have often seen a situation where a mobile version of the application is enough for customers to run a business.
Our partners use the mobile platform both for the development of mass-produced mobile applications distributed through app stores, and for custom applications created at the request of specific customers. Among the circulation applications, there are applications that use a non-1C back-end as a central data repository.
Among the mobile applications created by 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 shops, where it is impossible to install desktop computers for safety reasons. The built-in camera of a mobile device is used to read the barcodes of products and search for them in the stock list directory, the mobile application allows you to understand at what stage of the technological chain this product is located, mark the passage of the next operation by 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. There are several reasons for this: firstly, the version of the mobile platform for Windows was released relatively recently (“1C:Enterprise” version 8.3.7), and secondly, this version of the mobile platform does not have any significant differences from the implementation for other mobile operating systems. . Naturally, we will increase the functionality for Windows OS. As well as increasing the functionality of the mobile platform as a whole. So, in the near future we have - support for external components in the mobile platform; this mechanism (which has long been available in the “large” platform) will allow developers to implement functionality that is not available for any reason in the mobile platform.
Traditionally, the strengths of the 1C:Enterprise technology platform are ease of use for the developer and the speed of creating and modifying business applications. The 1C mobile platform has transferred both of these trump cards to the mobile world. The 1C mobile platform is an opportunity to quickly develop an application that runs on the three most popular mobile platforms (iOS, Android, Windows Phone / 8.1 / 10). And thanks to a wide range of available platform-independent integration tools (Web and HTTP services, etc.), the 1C mobile platform is an opportunity to quickly create a mobile client for three mobile platforms for almost any server application that supports any of the integration methods available in the 1C platform (Web and HTTP services, file exchange, etc.).

Only registered users can participate in the survey. Come in, please.

Good afternoon, dear readers, we bring to your attention a short article on creating a simple mobile application based on the 1C: Enterprise mobile platform for Android without compiling into an apk file.

To begin with, let's briefly define the basic concepts and software that we need for development.

1.Basic concepts

Mobile platform- a tool that allows you to implement applications that operate on mobile devices running operating systems iOS, Android, Windows Phone.

Mobile app - is the end result of the development . It is installed on a mobile device and has the ability to exchange information with the main application in Off-line mode. The following information transfer channels are available for exchange: File exchange, e-mail, Web services, etc.

The configurator acts as a development environment, the only thing to take into account is that not all configuration objects and system mechanisms are supported by the mobile application.

2.Software setup

2.1 Installationweb servers

First, let's install the Web server. Work is possible with Internet information services from Microsoft and Apache. In our example, we will consider Apache because it is easier to set up and stable in operation.

With the key " Next » go to the next window:

Into the fields Network Domain And Server name write " localhost" (or 127.0.0.1). This means that the server will run on the local computer.

In field « Administrators Email Address» specify the mailing address, server responses will be sent to it.

Default Apache works with port 80. Many popular programs work with the same port by default, for example teamviewer, Skypee, which in the future will not let you run Apache. There are 2 options for solving this problem, disable the use of this port in these programs, or change the port Apache.

To find out which programs occupy port 80, you need to run cmd.exe (click Start - type cmd into the search - right-click "Run as administrator") in the window that appears, enter the command netstat-ab.

In the screenshot, we see that port 80 is occupied by Skype.

Leave the default port 80. Click " Next » choose a typical installation. Press " Next » , change the installation directory if necessary, in the next window click " Install, then the installation process will start.

After the installation is completed, an icon will appear in the system tray, if we double-click on it, the following window will open:

If you still have problems with the standard port, you can always change it manually, for this you need to go to the folder where it is installed Apache, select the folder " conf", in it open the file " httpd.conf". Find the parameter in it "Listen" and change its values ​​to the port you need, for example 8080.

After changing the port number, save the file and restart Apache. To do this, in the tray, click on the icon

left-click on the menu that appears, select " Restart».

Let's make sure that the Web server is working, go to the browser and enter http://localhost:8080/ in the address field (where 8080 is the port that we set), the following page should appear on the screen:

2.2 Platform setup

For successful operation, the following components must be installed:

2.3 Mobile platform installation

Download the mobile platform from the 1C website https://users.v8.1c.ru/. In our example, version 8.3.8.70 is used.

The downloaded platform is an archive that consists of the following folders:

  1. Android- contains files for assembly under Android;
  2. iOS- contains files for assembly under iPhone;
  3. Windows- contains files for assembly under Windows Phone;
  4. Mobile AppMaker- contains "Application Builder" configuration files.

Since we will be developing the application for a device running the Android OS, we are interested in the first directory.

Let's see its contents:

  • 1cem-arm.apk is the most commonly used mobile development platform for ARM architecture;
  • 1cem-x86.apk - mobile development platform for x86 architecture, used for processors from Intel;
  • prjandroid-arm.zip - mobile platform for building mobile applications (for ARM architecture);
  • prjandroid-x86.zip is a mobile platform for building mobile applications (for x86 architecture).

Install the mobile platform on the device, to do this, copy the “1cem-arm.apk” file to the phone’s memory, or if your device uses an Intel processor, “1cem-x86.apk”.

Let's go to the file manager on the mobile device, find our file and run it

During installation, you may receive a message about blocking applications not received from the Play Store.

In this case, you need to click the " Settings” and in the window that appears, check the box “ unknown sources»

and repeat the installation.

2.4 Configuration setup

After all the software is set up, let's start developing our mobile application. Let's create a new infobase and enter it in configuration mode.
We go to the menu Service -> Options and check the boxes as shown in the screenshot:

Do you have a question, do you need the help of a consultant?

Next, we call the properties of the configuration root node and set the "Destination of use" parameter as "Mobile device", remove the "Personal computer" flag. After that, the objects of the mobile application will become available. Some configuration objects will become unavailable.

2.5 Publishing the application configuration

The next step is to transfer the configuration to the phone. To do this, first of all, we will create a directory, the path to this directory must be short, contain no spaces and consist only of Latin characters, for example C:\MobileApp. Further go to Configuration -> Mobile Application -> Publish . In the window that appears, fill in the parameters:

  • Name - The name of the mobile application. The name must not be the same as the base publish name for the thin client.
  • Refresh mobile application - if this option is checked, then each time the configuration is updated, the configuration on the device will be automatically updated
  • Directory - the path to the folder where the mobile application files will be stored.

To make sure everything works, go to http://localhost:8080/Mobapp/ in a browser, we should see the following xml file:

In the address field, enter the IP of the computer on which the configuration is published and the name of the publication itself, separated by a slash. In our example, a non-standard port is used, so the address will look like this:

Click the download button, after downloading the following settings window should appear:

Set parameters:

  • « Restart from the configurator» - The application will be automatically updated when the XML configuration file hosted on the web server is updated.
  • « Debugging allowed» - step-by-step debugging of the application on a mobile device is possible from the Configurator on the developer's computer. Press the button " OK».

If after pressing the button Download' you will get an error like this:

Now our base has been added on the mobile device, and we can launch it by clicking on it in the base selection list. The window that appears is blank because we haven't added any metadata objects yet. Let's start developing.

  1. Setting up the exchange between the Central Bank and the mobile application

Let's assume that we have a certain source base that contains only one reference book: "Nomenclature". And it should share information with our mobile application.

Let's go to the mobile application configurator, create a hierarchical reference called "Nomenclature". Let's add a list form.

Let's go to the workspace of the home page and add the "Nomenclature" directory list form there, set the "Start page template" parameter as "One column".

Press the button " Refresh”, the app on your phone should update automatically. If not, then display the button on the panel and press it. The following window should appear on the screen:

The next step is to create a new IB. We will add the “Nomenclature” directory to it, the structure of which will completely repeat the “Nomenclature” directory of the mobile application. This database will act as the Source.

Let's create a new Web service, let's call it "MobileExchange". In the properties, set the URI of the "MobileExchange" namespace. In this Web service, we will add a new operation and call it “LoadProducts”

Now let's write a code that will return a list of products from the source database as an xml file. Let's go to the properties of the "LoadProducts" operation and create a new function from the field " Method name". Let's write the following code in the function:

Let's publish a Web service, for this we go Administration -> Publish to web -Server . In the window that appears, set the name of the Web service "MobileExchange" and uncheck "Publish thin client and Web client". After that, press the button " Publish».

After publishing the Web service, let's go to the configuration of the mobile platform, open the "Nomenclature" directory list form and add a new command "Update nomenclature" to the form's command panel. Before doing this, it is recommended to uncheck the " Autocomplete» for this panel.

Create a new action for the Update Item command and write the following code:

We update the configuration.

This completes the development. We switch to the user configuration mode of the Source and fill in the nomenclature reference book in an arbitrary way

We go to the mobile device, launch the application, and click the "Update nomenclature" button. If everything is done correctly, then the following data should appear on the screen:

Conclusion

Let's summarize our work - we managed to set up and develop a mobile application from scratch and set up its exchange with another database. It is worth noting that the 1C Mobile Platform allows you to do this quickly and conveniently.