⬆️ ⬇️

1C 8.3.2: we write application for Android

A new version




On September 28 of this year, 1C without much noise and pathos released a trial version of platform 8.3.2.163, which was intended for testing. A complete list of changes and improvements anyone can read here or, if they have a subscription, here .

Of these improvements, the “1C: Enterprise 8 Mobile Platform” seems to be quite “tasty”, which allows you to create an application for Android or iOS mobile operating systems using the usual 1C tools.





')

The mobile platform, as the developers themselves write, “is the common name for a technology that allows you to create applications running on mobile devices running Android or iOS operating systems”.

"The mobile application installed on the 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 Android application (.apk) or iOS (.zip). Then all this stuff can be put on Google Play or the AppStore. However, if the program for Android can be signed with the key created in the same place immediately in 1C, and it will be ready for publication immediately, then to publish the application in the AppStore, you first need to compile it using the Xcode program on a computer running Mac OS X. And Of course, for publication in any of these stores need a developer license.

Everything sounds good, and I naturally wanted to try out new functions in action.



image



Creating a mobile application on 1C




To do this, we need a new version of the platform ( download here ), a file that is taken here , android SDK and JDK.

I’ll warn you right now: I don’t set myself the task of showing the development process of something concrete on 1C, but I just want to check and show you that - yes, the world has gone crazy and you can actually write an Android program on 1C.

Well, let's try to write a kind of “helloWorld” under the google phone. Let's make the program for test purposes - a configuration with one common form, which we will bring to the "desktop".

So, we create a new configuration in a managed mode, and the first thing we have to do if we write for a mobile platform is to indicate the “Purpose of use” in the properties of the configuration itself.







And here we immediately note that many configuration objects have become unavailable for use. We will no longer be able to use subsystems, routine tasks, XDTO packages, Web services, reports, business processes and much more. Also, many procedures and methods for some objects are not available. It is worth considering when developing.

We make a “form”, create a string props with the title: “Hello, Habr!” - and throw it on the form. Also create a button. In the processing of pressing write the message output, for example.



&  1() (" !");  




To test the performance of this is enough for us, therefore we proceed to the most interesting. We save the configuration to a file for the mobile application (Configuration-> Mobile application-> Write to file), launch it in a managed mode, and start processing MobileAppWizard.epf. This file is in the mobile.zip archive, which we downloaded at the very beginning.

And here we are offered to fill in the primary settings, where all the required fields are underlined in red.







The location of the mobile platform is the directory in which the android.zip and ios.zip files are located, which are necessary to form the delivery of the mobile application. They are all in the same archive mobile.zip.

Specify the folder where we installed the Android SDK (you can download it here ). 1C sets the following requirements:

Android SDK Tools version - not lower than 20.0.3;

The Android SDK Platform-tools version is at least 14;

The SDK Platform version is API 8 (at least version 8.3).

And we also need the Java SDK (available at this address). And 1C warns us that JDK7 does not work in conjunction with the Android SDK.

Specify the folder 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, 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 specify “Mobile app configuration” - the same file that we saved. Then the language, and only then click on the button with a “magnifying glass” and enter the presentation there. Specify the “Application ID” —a unique name of the Java class that 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 of the successful creation of the .apk file.

We throw the resulting file onto the phone and install it with our favorite manager, first allowing 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 checked only 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 went on for a long time. After launch, we are welcomed by the splash screen, and after a while the configuration itself starts. (sorry for the photo: fotkal on the calculator)







So far, the new features look quite “raw”: the restriction of the 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 bit surprising! Personally, I have a mixed opinion about this. On the one hand, this “feature” is still more like a toy, because there is no opportunity to do something truly worthwhile. But on the other hand, this is clearly a big step by 1C in the direction of mobility, and if this direction develops actively, then this can bring a lot of benefit. As an example - you can equip storekeepers with tablets. If it is possible to use "onboard" cameras, you can get rid of readers, and scan codes directly from the tablet, you can supply them with drivers of cars, and send tasks for transportation or track the route of the car and time in motion. There are a lot of options, in general, 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.



APK file.

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



All Articles