September 15, 2015, Apicloud held the one-year open source sharing meeting, released the open source plug-in support sublime user development cross-platform App,apicloud Open source technology leader Zhou Xinghei share sublime about the plug-in aspect related content.
Sublime is a highly focused development tool with the following features:
Mainstream front-end development editor
Small size, fast running speed
Powerful text features
Supports compilation and can see output in the console
Embedded Python interpreter supports plug-in development for extensible purposes
A large number of plug-ins supported by the package control:st can be managed
Zhou Xinghei then showed the Apicloud three plugins:
The first one is the loader plugin;
The second one is the snippet plugin;
The third one is the package plugin;
The above three plug-ins for everyone in sublime text based on the Apicloud development app to provide more convenience, the first two has been approved by the package control, can now be directly downloaded through the package control to use.
He further stressed: through the above plug-in, the first in the development process can automatically prompt completion of the code, after the development of the app can be pushed to the Android phone or the hippocampus simulator, and through the loader to the widget package for the real-time demo Finally, the developed package can be compressed in the format of the Apicloud upload code, so that the user could upload the code directly to the cloud platform.
Next the main explanation of the Apicloudloader directory files and structure, the key files are as follows:
The first is load.apk, this is the official loader, can be downloaded through the Apicloud website directly, the name must be load.apk. The load.conf is the appropriate configuration file. Custor-loader the definition of custom loader in the directory, the structure is similar to the official loader, if you want to install a custom loader, create a new folder, put in the appropriate apk file and configuration file.
The Widget folder contains 4 widget template packages, each with the default widget project, bottom navigation item, home navigation item and side navigation item template, when creating the app, you can select one of the four options from the menu, then copy the code from the template to the target directory of the project, and replace the application name in CONFIG.
StartInfo, because the Apicloud official loader supports multiple widget applications to which apps need to be read from a file named StartInfo, by default. This file will be automatically pushed to the remote device.
Next Zhou Xinghei shows how to do plug-ins based on sublime text on the spot:
First sublime text to have a console window, through the View->show console display console, this console is very important, pay attention to the console output, through the console can understand the plugin Python file syntax errors and the corresponding console output.
There are three types of commands supported by the Sublimetext plugin, namely:
Applicationcommand
Windowcommand
Textcommand
The activity scene also carries on the real machine synchronization realization principle and the source code related explanation, the real machine synchronization plug-in contains the following 3 sub-commands, respectively:
New Apicloud Project
Real-Machine synchronization
Compress Widget Packages
The tools directory contained in the real machine synchronization is an ADB command, the plug-in for real-computer synchronization is to call the ADB command to copy the local package to the remote device, and start the Loader,loader will automatically find the corresponding file location of the widget package, Then launch the app based on the widget package. The detailed usage of several ADB commands for real-computer synchronization is then explained in detail.
Finally, we mainly show the structure of the source code of the real-machine synchronization command:
This paper introduces the usage and scene of the two functions of is_enabled and is_visible in the frame, then introduces the detailed code contents. The command main function in real-machine synchronization, mainly by calling the load function, encapsulates the invocation logic structure of all ADB commands. Some of the other functions are encapsulated in the ADB command. Next, the load function is explained:
First check the basic environment information, such as the existence of the ADB command, after the detection through, you need to see whether custom-loader under the same name to be synchronized AppID directory. If you do, you will need to use the APK installation package for your custom load.
When the widget information is pushed to the remote device, it is necessary to compare the loader version of the current device with the local loader version information. If the device loader version information is not found, then the device loader is not installed, it is necessary to install the local loader, if the device version number than the local version number is also installed loader, first to uninstall the loader package on the device, and then install the new loader, after loading, Real-machine synchronization can be done by starting the remote loader.
Then, create an app for this subcommand. New Apicloud Project This operation mainly uses the function Show_input_panel, this is a sublime text API, it has a total of five parameters, detailed reference to the official document. When the user enters the user name and clicks Enter, the relevant template is copied to the current project directory and the copied project name is modified.
Finally he also said Apicloud very encouraged to do some more suitable for their own development of plug-ins, I hope that we can use their own plug-ins and our official plug-in together to better help everyone in the sublime text inside to develop Apicloud-based applications, improve the efficiency of everyone.
September 15, 2015, Apicloud release a variety of development tool support policies, use any of your favorite HTML5 tools, you can develop Apicloud applications, including similar sublime Text3, Eclipse, Webstorm, notepad++ , VIM, Aptana Studio3 and Microsoft's latest visual Studio code, and so on, to promote the China Mobile platform industry ecosystem development of cooperative mentality, service developers and enterprises. "The more than 10 open source project code is shared on the Git-based code hosting and online collaboration platform Gitcafe, hoping to bring developers more convenience through open source on Gitcafe. 」
Transfer from 51cto:http://mobile.51cto.com/anews-492410.htm
Sublime how users can quickly and efficiently develop cross-platform apps