the Internet Windows Android

Assembling 1C mobile application for Android. Mobile client: Installation, debugging, Android assembly "

This is an article for those who are interested in the mobile client. We will look at the installation of a mobile client on Android, debug connection and assembly apk applications In the configuration "Mobile Application Collector".

Finally, a test mobile platform 8.3.12 appeared, and now we can test the work of the mobile client. I do not know how you, but I have many familiar developers waited for this since the release of the article on "1C: Cool Cool" (Mobile Client).

I guess you are familiar with the installation mobile application and a collector of mobile applications, and that you have already installed Android SDK, Apache Ant and so on. Articles on this topic is already full.

Take for our experiments a demonstration configuration "Managed Application" and, first, let's try to connect it to a ready-made mobile client. In my case, the client distribution is the 1CEM-Client-Arm.apk file. Pre-on the smartphone must be enabled the possibility of installing applications from unknown sources. It looks like this:

Mobile client - This is an analogue of the web client, therefore, to access the database, it must be published on a web server. Here everything is standard, I am public on the IIS web server named "Demo". I have a file file, so you need to give the right to the directory of the user IUSR. I am glad that the system itself reminded this.

We connect the database in the mobile client:

Immediately in the database, of course, did not manage to j, the term is that the administrator opens processing on working with email And attempts to set the icon for the taskbar, which in the mobile client is not. Since this functionality is also not in the web client, the code is framed in the compilation directives "# If not a webcient then". We simply need to find all the places where this directive is used and change it to "# If not a webcient and not MobileCleant then." To begin it, it is quite enough, and we can finally see the work of the mobile client. The command interface is as follows:

But the list of counterparties:

Of course, it is not all the places that need to be adapted to the work of the mobile client. You can check the configuration using the "Main Menu - Configuration - --- Configuration Check":

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

Running under other roles occurs also, it is only necessary to establish the right to launch a mobile client.

If we do not understand what the error is - we will help debugging. It in the mobile client is, but only debugging on HTTP is used. I have a base file, so I will use local server debugging ("Service - parameters - debugging") and configuration automatic connection For Mobile Client ("Debugging - Connection - Automatic Connection"):

Indicate the parameters and are ready:

Setting for a pre-prepared client APK from 1C completed.

Now we will collect your apk, using the collector Mobile applications. To confess, I spent a few hours trying to collect the application for the first time. The assembly was held, but a blank list of bases opened.

And so, we have an archive mobile version platforms. We download it to the "Mobile Version" directory:

In the settings of the collector, an item for SDK 26 and higher appeared separately (who, like me, has not been updated for a long time - launch SDK Manager and load new packages):

Next, you must prepare the configuration file. I had problems at the very beginning with this step. Then I opened the documentation and everything turned out a little. The developer's management says on this matter the following: "Each configuration that can operate in the mobile client contains some auxiliary information that allows you to track the configuration substitution."
The configuration file must be signed. In this case, for each configuration is formed its closed keyAnd in the 1CEMCA.xml file is unloaded the open key (DSAKEY field), with which the configuration signature is compared.

To form a key and signature, go to the "Mobile Client Signature" configuration properties (immediately under the required permissions, if your properties are divided into categories, and not alphabetically) and see the signature settings:

First create a closed key, hiding it from spies and enemies. Next, form the signature of the configuration. For the future, the guide advises to go to "Main Menu - Configuration - Mobile Client - Setting the Use of Mobile Client." In the Dialog, select the Check Mobile Client Signature when updating the database configuration "and click OK. Judging by the leadership, the signature will change if we change the composition or names of object types of metadata, as well as the names and / or the composition of the register record keys. Those. The change in the forms is definitely not affected by the signature and, judging by the description, the change in the composition of the details of existing reference books, documents (but this is not exactly).

Signature is ready, we can continue. Immediately I will say that the background processes in the mobile client are not available, so they need to be disabled in the permissions of the mobile client. The file sharing is also not available. I additionally disconnected geopositioning so that an error does not occur when assembling due to the lack of a key to work with cards. I got the following list of permits:

On September 28 of this year, the company 1c without special noise and pathos released a familiarization version of the platform 8.3.2.163, which was intended for testing. Full list Changes and improvements will be able to read or, if they have a subscription.
From the listed improvements, it seems to me "delicious" Mobile platform 1C: Enterprises 8 ", which allows the usual means 1C Create an application for Android or iOS mobile operatingers

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

That is, speaking easier, you can write your written configuration, compile into the Android application (.apk) or iOS (.zip). Then all this can be put in Google Play. or appstore. True, if the program under android can be signed by the same key immediately in 1C, and it will be ready for publication immediately, then to publish an application in the AppStore it will have to be collected using the XCode program on a computer with Mac OS X operating system. Of course, to publish in any of these stores, a developer license is needed.
It sounds good, and I naturally wanted to try out new features in business.

Creating a mobile application for 1C

To do this, we will need a new version of the platform (), the file that is taken, Android SDK and JDK.
Warning immediately: I now do not keep myself the challenge to show the process of developing something concrete per 1C, but just want to check and show you that - yes, the world went crazy and for 1C really you can write a program for Android.
Well, let's try to write a kind of "HelloWorld" under Google. We will make a program in test purposes - a configuration with one common form, which I will bring on the "Desktop".
So, create new configuration In managed mode, and the first thing we should do if we write under a mobile platform, it is to specify the "assignment of use" in the properties of the configuration itself.

And here we immediately consider that many configuration objects have become not available for use. We can no longer be able to use subsystems, regulatory tasks, XDTO packets, Web services, reports, business processes and much more. Many of the procedures and methods for some objects are not available. It should be considered when developing.
We make a "form", create a string props with the title: "Hi, Habr!" - And throw it on the form. Also create a button. In the press processing, write the message output, for example.

& Complaint procedure Command1 (command) Warning ("It works!"); Extrudresses

To test the performance, we will have enough enough, therefore proceed to the most interesting. We save the configuration to a file for a mobile application (configuration-\u003e Mobile application-\u003e write to the file), start in the controlled mode, and start the MobileAppWizard.epf processing. This file lies in the archive of Mobile.Zip, which we downloaded at the very beginning.
And here we are offered to fill the primary settings, where all the required fields are shaped red.

The location of the mobile platform is a directory where Android.zip and iOS.zip files are located needed to generate a mobile application. They lie everything in the same archive Mobile.zip.
We specify the folder where we installed Android SDK (you can download). 1C exhibits the following requirements:
Android SDK Tools version - not lower than 20.0.3;
Android SDK Platform-Tools version - not lower than 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) and 1C warns us that JDK7 does not work together with Android SDK.
We specify the folders where our.apk file will be placed, place the location of the key for signature and pseudonym with a password. If you do it for the first time, and you do not have a key, you can fill in the "key parameters" and create a key to yourself (in which 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, specify the "mob configuration" - the same file that we saved. Then the language, and only then click on the button with a "magnifier" and enter the presentation there. Indicate the "Annex 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 it with "com.e1c." Fill out the version number and assembly and click the "Create" button. If everything goes well, the system will notify you about successful creating .AP file.
We throw the resulting file to the phone and install your favorite manager, pre-allowing installation in the settings third-party applications. Or set the program to the emulator via ADB. I will say right away: on the emulator everything is terribly slow, on the phone, it also checked on HTC Wildfire S) things are much better, but there is still a problem. For example, my file turned out to be weighing in the whole 34 MB, so the installation went down long enough. After starting, the screen saver screen welcomes us, and after a while the configuration itself starts. (Sorry for a photo: Fotka on the calculator)

While new opportunities look quite "damp": limit the functional 1c, the impossibility of using SDK is directly, plus big size And some "brakes" ... But the opportunity to write a program for a mobile platform for 1c surprises a little! Personally, I have a two opinion about it. On the one hand, this "feature" is still similar to the toy, for there is no possibility to do something truly worthwhile. But on the other hand, this is clearly the big step of 1C in the direction of mobility, and if this direction is actively developing, it can bring a lot of benefit. As an example - you can equip storekeners with tablets. If it is possible to use "onboard" chambers, you can be free from reading devices, and scan codes directly from the tablet, you can provide car drivers, and send tasks for transportation or track the car route and time in motion. Options, in general, a lot, and that it will be all in one information system, I will quite please customers / managers, because for some reason they always have panic fear before use large number various systemsThey want to use the entire functionality on a single platform.

An example of a mobile application for 1C: PІDPRIEMSIY 8.3 for the work of the online store courier when delivering goods to customers. For development used configuration "Mobile Application Collector"

An example of the development of a mobile application for the courier of the online store using the "Mobile Application Collector"

So, we have developed a mobile application for the work of the online store courier when delivering goods to customers. Of course, it is sufficiently schematically and cannot cover all tasks that actually arise during the courier process. But it implements all the functionality that we wanted to show in this book.

Now, after the development is completed, we can only gather our mobile application in one file and download it to the tablet.

Although for the assembly we will use a special configuration Mobile Application Collector, facilitating the assembly process, still the first time to do it is not easy and not fast. Therefore, you need to be patient and carefully and carefully perform the sequence of actions described below.


Where to download and how to install a mobile application collector

Configuration Mobile Application Collector Comes in a mobile platform. In the first chapter of the book in the section "Mobile platform 1C: Pіdprommia" we unpack the archive with a mobile platform to a computer. In this directory there is a MobileAppmaker folder with the setup.exe file to install the configuration template. Let's start this file and set the configuration template in the Catalog of the templates "1C: PІDPRIєMI" (Fig. 5.1).

Fig. 5.1. Installing the configuration template "Mobile Application Collector"

Then I will add a new information base to the list of information bases "1C: PІDPRIєMI" and create an information base from the template created earlier (Fig. 5.2).

Fig. 5.2. Creating an information base "Mobile Application Collector" from the template

Then I will then open this database in the configurator and add the user administrator with the properties of the 1C authentication properties: Підпристь, rally administrator and user and Russian language (Fig. 5.3).

Fig. 5.3. Creating a user "Administrator"

Save the configuration, close it and open it in 1C mode: Підприствой on behalf of the user administrator. Now this base is empty. We must fill in it all the necessary parameters for the assembly that will be saved and used for further assemblies.

First (if the base is empty) on start page Applications offer general reference information about the collector of mobile applications. You can also go to it from the Main Menu - Main Menu\u003e Help\u003e Help Contents\u003e Mobile Application Collector. In addition, additional pages of mobile application assembly pages are taken away from individual configuration forms (Fig. 5.4).

Fig. 5.4. Help on the configuration "Mobile Application Collector"


Setting Application Settings

First we must configure the settings of the collector. To do this, from the Tools menu, call the application settings. We will not collect your mobile application for Apple now, therefore, the corresponding checkbox is left blank.

In the form of the settings, we need to fill in the table of component catalogs on computers involved in the assembly process, which will contain paths to the software components necessary to build a mobile application. To do this, click the Create button above this table (Fig. 5.5).

Fig. 5.5. Creating a table entry "Component catalogs ..."

The form of the path to components will open. Calling a certificate from this form, you can see links to obtain software components and their description (Fig. 5.6).

Fig. 5.6. Help describing paths to components

First you need to install Java SDK and specify the directory in the JDK field to which this component is set. Java SDK can be obtained at: http://www.oracle.com/technetwork/java/javase/downloads/index.html. It is recommended to download the Java Platform package (JDK).

On the page that opens, you need to click on the download button (Fig. 5.7).

Fig. 5.7. Getting Java SDK

On the next page, you need to accept the license agreement (set the Accept License Agreement mark) and click on the link with the desired distribution in the download column (for 64-bit Windows - this is a JDK-8U60-Windows-x64.exe package), Fig. 5.8.

Fig. 5.8. Getting Java SDK

The resulting installer must be launched and installing Java SDK, for example, in the directory: C: \\ Program Files \\ Java \\ jdk1.8.0_60 (Fig. 5.9).

Fig. 5.9. Installing Java SDK.

Then you need to specify this path in the JDK field form settings to the application components of the Mobile Application Collector (Fig. 5.10).

Fig. 5.10. Configuring paths to the components of the Mobile Application Application Application

In the following settings field, the working directory and cache collector need to specify any directory on the Latin, where the build program will place service files. The user, on behalf of which the mobile application assembly, must have full rights for this directory (Fig. 5.11).

Fig. 5.11. Configuring paths to the components of the Mobile Application Application Application

In the Android SDK field, specify the path to the directory in which the SDK Manager is located. Android SDK we installed in chapter 1, in the "Android SDK" section (Fig. 5.12).

Fig. 5.12. Configuring paths to the components of the Mobile Application Application Application

Then you need to install Apache Ant and specify the directory in the Apache Ant field to which this component is set. Apache Ant is required to build a mobile application for Android. Apache Ant can be obtained.

From this page, we need to download Apache-ant-1.9.6-bin.zip archive (Fig. 5.13).

Fig. 5.13. Getting Apache Ant.

Unzipping this file to the computer and specify the path to it in the form of path settings to components (Fig. 5.14).

Fig. 5.14. Configuring paths to the components of the Mobile Application Application Application

Then you need to install the PUTTY system and in the Putty field, specify the directory in which this component is set. Putty can be obtained.

Putty is used if the mobile application is assembly for Apple. To build mobile applications, the utilities are required PSCP.exe and plink.exe. Just in case, download the entire installation package Putty-0.65-Installer.exe (Fig. 5.15).

Fig. 5.15. Receiving Putty.

The resulting installer must be started and installing Putty, for example, in the catalog: C: \\ Program Files (x86) \\ Putty (Fig. 5.16).

Fig. 5.16. Installing Putty.

Then point the path obtained when installing PUTTY, in the form of ways to configure paths to components (Fig. 5.17).

Fig. 5.17. Configuring paths to the components of the Mobile Application Application Application

On this setting the paths to the components is completed. Click write and close.


Setting up the parameters of the supplier

Now we need to configure the settings of the supplier. To do this, call from the service menu item Edit Supplier Parameters.

A form of the Suppliers in which you need to bookmark will open. Common parameters Specify an arbitrary name of the supplier, as well as set an application identifier prefix. This field should be filled on Latin and start from the "COM" string. The rules for filling this field can be viewed in the contextual help, opening on the button with the sign "?".

Then you need to note for which operating systems Mobile application is assembling. In our case, check the Android OS checkbox.

To work with push notifications through the auxiliary service "1C: PІDPRIєMI", specify the access parameters to the service. To do this, click the Add button to the table below the supplier shape. In the window that opens, the access parameters to the subsidiary service "1C: PІDPRIEMSTVIE" Note the Register option for - the selected user, select the user collector - administrator and point electronic address And the password under which we have previously been registered on the service when testing work with push notifications. Press the Save and Close button. In addition, you can register on the 1C: PІDPRIEMSTVO service directly from this form using the Sign up button in the 1C: PІDPRIEMSTVO service, if this has not yet been done (Fig. 5.18).

Fig. 5.18. Configuring application provider settings "Mobile Application"

Also, call the window for setting the access parameters to the service "1C: PІDPRIEMOSTI" from the service menu, the item of access parameters to the service "1C: PІDPRIєMI".

After that, you need to bookmarked the parameters for Android OS Fill the Developer Wrench field group. To do this, first create a developer key by clicking on the New Developer Key link. In the form that opens, the creation of a developer key arbitrarily fill in the field (for the country the country must specify the code of Russia in iSO standard - RU) and click the Select key button (Fig. 5.19).

Fig. 5.19. Configuring application provider settings "Mobile Application"

After that, the field-parameters of the developer key will be filled automatically (Fig. 5.20).

Fig. 5.20. Configuring application provider settings "Mobile Application"

The value in the Hesh Sha1 key of the developer key will be used in the future to obtain the key to work with google maps. This value is necessary if the mobile application will use geopositioning tools on the Android platform.

This configuration of the parameters of the provider is completed. Click write and close.


Loading mobile platform

Now we need to download the mobile platform "1C: PІDPRIєMI", under the control of which the collected mobile application will work. Versions of the mobile platform may be several, but they should be no lower than version 8.3.4.

Directory Mobile platforms are intended for downloading and storing various versions of the mobile platform. For each version of the platform, a separate entry must be created in this directory.

From the Application Command Panel, open the Mobile Platform Directory and click the Create button. After that, a file selection dialog will appear in which you want to select the file with the Mobile Mobile.zip mobile platform archive, which we maintained on the computer when receiving a mobile platform in the first chapter of the book, in the "Mobile Platform 1C: Pіdprom" section. Select it and press the Open button.

If the platform is successfully downloaded, the Mobile Platform Element element will open, in which the fields of the mobile platform and the name will be filled automatically, and the Mobile Platform Files check box are downloaded (Fig. 5.21).

Click write and close.


Loading mobile configuration

we need to load the mobile configuration of the CourierintertMagazine developed by us. Open this configuration in the configurator. In the configuration properties palette, set Properties supplier - MyFirm and version - 1.0.0 (Fig. 5.22).

Fig. 5.22. Properties mobile configuration "CourierrintertMagazine"

Then unload this configuration to the file by executing the configuration configuration\u003e Mobile application\u003e Write to the file ...

For download and storage of various versions of mobile application configurations, Mobile configuration reference is intended. The directory assumes a two-level structure: groups describe applied solutions, and elements in groups - various versions configurations of these applied solutions. For loading new version Configurations need to go into a group corresponding to the applied solution and in this group to create new element.

From the Application Command Panel, open the Mobile Configurations Certificate and click the Create Group button with the name of our Configuration of the online store courier (Fig. 5.23).

Fig. 5.23. Creating a group of reference book "Mobile configurations"

Then in this group will create a new element of the reference book.

After that, a file selection dialog will appear, in which you want to select the 1cema.xml file, in which we just saved our mobile configuration. Select it and press the Open button.

If you successfully download the configuration, all form fields will be filled automatically and should not be changed manually. The table of permissions will indicate all the permissions on the operation of the mobile application with multimedia, geopositioning, notifications, etc., which we installed when developing it. In addition, messages will be shown about the impossibility of working with calendars and contacts, the permissions on which we were not installed (Fig. 5.24).


Click write and close.


Description of mobile application parameters

Now we need to describe the parameters of the mobile application that we will collect, in the Mobile Applications directory.

The directory must have a two-level structure, where the group describes the basic parameters of the assembly, and the group element specifies the assembly parameters for a specific version of the mobile application. For each mobile application, a separate group must be created, and for each version of the mobile application in this group you need to create your own item.

From the application's command panel, open the Mobile Application Handbook and click the Create Group button. In the form that opens, set the name of the mobile application of the online store courier.

We have one supplier - my company. It will be filled automatically. And also will be installed checkbox for the Android OS. The Mobile Platform field will be left blank - when assembling will automatically be used the most "fresh" version of the platform.

In the Solution ID field, we specify an arbitrary string on the Latin. The following field will be filled automatically (Fig. 5.25).

Fig. 5.25. Creating a group of reference book "Mobile applications"

You will automatically be automatically filled with a key receiving key to work with Google maps (in this field, the value of the HEST SHA1 key of the supplier's software driver My company from the application parameter setting form, see fig. 5.20 + solution identifier string) - it will be needed to get the key To work with Google maps. To do this, we must contact google service And after receiving the key to write it in the key field to work with Google maps.

In this article, I will show how to collect (compile) Mobile application 1c under iOS, using the free Apple developer account.

There are many similar articles and video on the Internet, but in each of them a paid developer account is used, which is not a lot of $ 99. Not every novice developer wants to immediately spend money on something that may not be engaged.

According to the License Agreement on the internal (free) use of products iOS developmentThe application cannot be distributed, sell, etc. (License Agreement with Apple Developer Program). You can only test the developed software on registered apple devices (that is, on your personal iPhone, iPad). From here, the conclusion implies - the developer (with free account) can test its application only on personal devices, disseminate the application in the network will not work.

Ready annex iOS. Presented as a file with an extension * IPA. In our case, the developer can only upload it to its device connected to a computer with Mac OS. In this performance, the application is not forever, it is limited in time (my application worked no more than 7 days, then simply did not start).

So, that we need to build a mobile application 1c under iOS:

1. Software:

  • The main OS to prepare an application 1c is Windows 7. In general, you can use a virtual machine.
  • Program for creating virtual machine. I used VMWare 12.5.7
  • Mac OS image. It is better to use the version of the OS as newer as possible. In my case, this is "Mac OS Sierra 10.12.6". By the way, you can download the finished image under VMware, on the Internet the sea links.
  • To compile an application on Mac OS, you need to download Xcode (you can download it directly from the virtual machine, well, or separately (it will be faster)). It is also best to use the serial version. In my example, this is version 9.0.1.
  • Configuration for assembling mobile applications 1C. It usually goes along with the 1C distribution.

2. Test configuration 1C:

We prepare the test configuration that in the future we will turn into a mobile application. On an infostar, a bunch of articles with examples, the only thing that remind is - to specify the "Mobile Device" and "Personal Computer"

2.2. We will save the designed configuration using the "Configuration" command -\u003e "Mobile application" -\u003e "write to the file". At the output, we must get the * xml format file, in which the structure of our configuration will be saved.

3. Setting up a collector of mobile applications

I will not tell in detail, since it was not once published on an infostar. Let me remind you only important moments:

  • You must correctly enter the data for connecting to a computer from the IOS OS

You can check the availability on the network through command line with the help of the command:Ping. + "Computer Name in Network. For example "ping. mAC- admin.»

And also check the correctness of the specified login and password (using the PUTTY utility). You can perform it using the command: "E.:\ Program Files.\ Pytty.\ plink. eXE" - ssh. - l. admin. - pw. 123 mAC- admin.

  • Create an element of the "Mobile Applications" reference book in the collector of mobile applications. Run the "Collect Application" command, after which "get the application". Save the archive with the Mobile Application Project.

4. Transferring an application to a mobile device.

For this you need:

Copy the archive with the Mobile Application Project on Mac and unpack it

Open the project in Xcode

In the upper left corner of the project that opened the project to select the device from the IOS OS (in my case it is iPhone)

Start the compilation of the application. In this case, the application automatically moves to the connected device.

Attention!Connect the device to the USB port, which is selected in the virtual machine settings. If the settings are specified uSB port 2.0, connect the device to the USB 2.0 port.

After that, you can open your device and see what happened.

Full instructions with all screenshots, starting with creating a test configuration and ending with the launch of the application on mobile device, are in the attached * PDF file.

Somehow quietly and without special descriptions of 1C, the "Mobile Application Collector" configuration has released, which is designed to become a certain organizer to develop mobile applications.

In current latest version 1.0.3.17 There are several no big problems that at first glance look like bugs.

The first problem with which is faced, it is the impossibility of running a configuration without a user, we get this error:

"The configuration version differs from the information base version. You need to update the configuration, running the application decision on behalf of the user with the rights of the "Administrator"

This problem is solved simple enough, you just need to start the configurator and add a user with the administrator rights.

The second problem closes when we are trying to create an item in the Mobile Configurations directory. Click the "Create" button and get the error "Elements can be created only in groups":

Not a problem, press the "Create Group" button and suddenly get an error message "Elements can be created only in groups."

The output is the following actions:

On the top panel there is a "Create" button, which causes the submenu. In it, press the "Mobile Configuration" item:

After that, a fairly friendly window opens, you can create groups in the kitter:

There is also a problem when creating an element of the "Mobile Applications" directory, we obtain the following error message:

"The application identifier prefix in the Supplier settings is not specified":

The output is also pretty close:

And begin to enter data into the element of the reference book "Mobile Solution Suppliers".

The prefix must necessarily be with the "point" inside. And click "Create a Developer Key."