background

On February 8, 2020, UniApp, a well-known cross-end development technology framework, released the applets SDK. To paraphrase the official line explaining the SDK’s functionality:

Uni Applets SDK, an SDK for integration in native apps, helps native apps quickly implement applets capabilities.

As an approved cross-end development technology framework in the industry, UNIApp has taken another big step forward in the road of cross-end development.

The release of the small program SDK marks the advent of the era of comprehensive competition in the field of small program technology.

It allows native apps to build their own mini-app ecosystem (their own, mind you) at very low technical cost. It solves the infrastructure problem of small program ecological construction from the technical side.

The author has been engaged in the software development industry for a long time, and started to enter into uniAPP in 19, which is used to replace the traditional VUE technical scheme. In the production environment, the realization of H5, small program, APP multi-terminal rapid and low-cost development.

Technology-driven innovation

Future UniApp-based applications will have a whole new application scenario — seamlessly embedding native apps, a solution that challenges the h5 integration.

As we all know, traditional APP integration mostly adopts SDK encapsulation, WebView embedding and interface docking. However, these schemes are often difficult to get a good balance in terms of development cost and user experience.

1.SDK encapsulation. Suitable for low-level business, such as various live SDK, IMSDK, push SDK. However, for some business-heavy applications, SDK integration has a relatively big defect, and different terminals need to develop different SDK. Whether the business layer can be extracted is a big concern for developers. In the past, for large business applications, packaging as SDK is obviously not appropriate.

2. The embedded form of Webview has poor experience. The experience of web pages is ultimately on the server side. Due to the power of webView, many page switches are unsatisfactory.

3. Interface docking is undoubtedly the best experience, but also the highest cost. Currently, a large part of the work of APP development is in the front end of the business.

Based on the above three common integration methods, an integration mode with excellent experience and low cost has been required by the industry, but has not been satisfied.

The UNIApp applets SDK seems to have captured this demand and launched applets SDK. Currently, open source is limited to large vendors obtaining source code independently.

practice

In my early career, I also learned the development of Android applications, so I set up a set of Android development environment by myself. Having not been engaged in Android development for many years, the process of building an environment is also very bumpy. However, the project sample provided by UniApp was successfully run.

Let’s start with an official example:

The following is the author of the transformation, a company’s products for docking. You can set different APPids by judging the selected boxes to open different interfaces.

As you can see, we’ve successfully opened our application. You can also launch directly to the corresponding sub-page.

Here is the application scenario of opening the child page directly.

During service interconnection. For example, the application scenario of the developer is to connect with a community on his original business APP for community-based operation. At this time, we often make an application scenario that he needs to implant a release button in the original interface of the APP. Click this button to open the community directly and jump to the publishing interface.

It’s a great experience.

Corresponding startup code:

How do I entrap startup parameters?

This code sets a parameter, a, with a value of 1, to be used as a startup parameter at startup time.

In UniApp, you only need to get this parameter through the corresponding API.

In development, developers are concerned about how the host program interacts with the embedded application. Especially when we are doing the requirement of user login free, h5 WebView mode only needs to entrap the token of the current user in the URL to achieve login free. The UniApp side can gracefully implement this requirement in the form of startup parameters.

In addition, the official also provides a complete set of small program SDK API documents for developers to refer to. The author has a preliminary look, can achieve some regular interface UI adjustment. It can be used in different service scenarios. Closing and triggering callback functions are also provided. Basically, it can meet business requirements.

Weaknesses?

After the author real machine test. After putting our product short Community system 1.9.0 full version into practice. Got a good performance, but still had some shortcomings.

First is the V3 compiler, uniapp recently launched the latest compiler, official said to improve performance and so on, due to historical reasons, short talk community based on the old compiler development, in the real machine test, there is a bit of style compatibility problem under V3. That leads to a bit of dislocation.

After packaging resources, put into the demo, found that the small program SDK environment after running, there is also the problem of style dislocation. But fortunately the overall interaction is ok. The operation is smooth and the trunk function is not affected.

After actual practice, the general feeling is that the small program SDK currently provided by UniApp has the following shortcomings:

  1. Compiling and testing is quite troublesome. At present, we can only simulate running the small program version in the development environment, and export the resource package and put it into the APP after no major problems in the test. Then the real machine debugging. If compilation differences do not exist, such debugging is generally acceptable. I’m afraid there are some compiler differences, resulting in some of the pits.
  2. Backward compatibility issues with V3 compiler itself. I believe that some applications developed based on V3 do not have this problem, but for some accumulated apps, such as my company’s product, it is more headache. You need to debug one by one, adjust and repair. I have tested older compilers and found them to be extremely misaligned. The use of V3 has improved. Prove that the compiler and SDK itself are in a process of refinement.
  3. Package size problem, because the author’s hand is the official demonstration case. So there’s no before and after comparison. However, according to the reviews on the official website, some developers found that the package size increased by 48MB after integrating the small program SDK, while others only increased by 12MB by scaling back features. However, the size of the exported resource bundle is acceptable and can be ignored.
  4. The problem of dynamic downloading and loading resource packs is not clearly documented on the official website. If you can achieve dynamic download resource package and run, it means that you can achieve such ecology as micro channel small program. There’s a lot of room for imagination. Especially for apps with tens of millions of users, it is very attractive.
  5. The API is still good, but it will take some time to develop. More API support is needed for complex application scenarios.
  6. At present, due to the official open source strategy, app manufacturers need to communicate with the official to obtain the source of small program SDK, the official note is free of charge.

The last

At present, increment is difficult to obtain in the Domestic Internet market, and the cost is high. In the stock market, how to develop more business scenarios and integrate the applications provided by ready-made software manufacturers with lower cost and faster speed is an important application scenario in the next few years.

Uniapp’s mini-program SDK, if it sticks, will one day move out of the lab and into production.

The future has arrived, the technical problems have been solved, and it is time to compete for operational strength. Domestic APP manufacturers, it is time to think about the future direction.

Author: Yi Xiao (wechat id yixiao100), short short OSX community forum system product director, 5 years of social community product management experience. Founder of Tianxiang Software.