Table of Contents
How to use
Runtime
SDK
Difference
Basic architecture
Webview
plus
JS Bridge
Native
The process of one call execution
Complain about it
Advantages
Insufficient
More suitable scope
Not recommended situations
Similar products
Home Web Front-end H5 Tutorial HTML5plus mobile application development examples sharing

HTML5plus mobile application development examples sharing

Feb 08, 2018 pm 03:23 PM
h5 Development example

What is HTML5plusDCloud provides a solution for developing mobile applications using traditional web technologies. This article mainly shares with you the development examples of HTML5plus mobile applications, hoping to help everyone.

Enhanced version of mobile browser engine brings HTML5 to native level!

Product slogans are always exaggerated, so don’t pay attention to these details.

Tips

  • HTML5plus has a long name, so it is also called HTML5+, or 5+ for short.

  • Mobile applications developed using this engine are also called 5+App.

  • The related SDK is called 5+SDK.

How to use

Runtime

That is, use HBuilder, another product of DCloud company, to directly develop and debug.

SDK

Integrate 5+SDK into your own native application, and you can use its extended JS API in your application.

Difference

  • The Runtime method can directly use the cloud packaging provided by DCloud, and does not require a local packaging environment.

  • Runtime method does not require mastering native development capabilities, just use the extended API reasonably.

  • The SDK method can meet more needs, but it requires the ability to master native development.

Briefly understand the
Runtime method. Developers do not need to develop the base part of the native application themselves. 5+ does it for developers here. They only need to submit the application. Just package the resources in the cloud.
The SDK method is different. In this case, 5+SDK is extended based on the original native application base. Therefore, developers need to build their own native development environment and perform some native development work.

Basic architecture

According to the official documentation, the Android platform third-party plug-in development guidance is roughly divided into a three-layer structure. For easier understanding, the explanation is expanded into four parts.

Webview

can be understood as a simple browser, HTML, CSS, and JavaScript are all here.

plus

This part is in Webview. Based on the original browser environment, the extension can call the API of native functions. These APIs are all in window.plus inside the object.

JS Bridge

is responsible for connecting the JavaScript layer and the Native layer.

  • Receive the request from the JavaScript layer and notify the Native layer to respond accordingly.

  • Receive the response result from the Native layer and notify the JavaScript layer to receive the result.

Native

That is, Android and iOS are also the core and key parts of HTML5plus.

The process of one call execution

Take obtaining the application version number as an example

plus.runtime.version;
Copy after login
  1. JS layer callplus.runtime.version, Webview initiates a request to JS Bridge.

  2. JS Bridge receives the request and notifies the Native layer to read the application version number information.

  3. The Native layer executes and gets the result, and notifies the JS Bridge layer of the corresponding result.

  4. JS Bridge gets the corresponding result from the Native layer and notifies the corresponding Webview result information.

  5. The JS layer obtains the version information of the application.

Complain about it

Personally, I believe that every product and company has its own design philosophy and business strategy. Different users will always have different needs and opinions.
Therefore, when making technology selection, you must understand your own needs and the product information being investigated. In the DCloud community, posts like "Why is there no XXX API", "Why not integrate the XXX SDK", "I don't know how to develop natively, I hope the official can expand the XXX API" and so on often appear. As for the specific reasons for such problems, everyone has their own understanding and will not be discussed here.
When making technology selection, it is best to try it yourself. Don't expect the product supplier to give you the best answer, because they won't stupidly push users away.
------Huali dividing line------
Below, I will share my personal experience and insights, hoping to help other developers make a reference when selecting technology.

Advantages

  1. The learning cost is low, as long as you master the basic web development capabilities, you can get started.

  2. Cloud packaging eliminates the need to build Android and iOS development environments locally for packaging processing.

  3. A set of code can be compiled into two packages for Android and iOS with only a little compatibility processing.

  4. I didn’t expect it, I’ll add it to the discussion.

Insufficient

  1. plus.ModuleName.* The API provided is limited. Although there is a product called Native.js, you need to master a certain amount of native knowledge. Development capabilities.

  2. Depends on the mobile phone's own Webview, so the performance on some mobile phones is not ideal. This has a certain impact on certain business products.

  3. Following point 1, the implementation of certain functions requires developers to integrate the SDK for expansion. For example, Bluetooth, application background persistence, etc. This also requires developers to have native development capabilities.

  4. Some functions are not fully implemented due to compatibility issues. For example, the corner icons of desktop icons, etc. Of course, Android is seriously fragmented, and some shortcomings are understandable.

  5. The document content is not explained clearly enough in some places. Also, the layout of the document is a bit strange.

  6. I haven’t encountered any other pitfalls so far, maybe I’m not familiar with them yet.

More suitable scope

Comprehensive official case presentation and personal development experience. To sum up, 5+App development is more suitable for the following situations or products:

  • Start-up companies that need to quickly launch applications.

  • News information (36Kr), e-commerce (HiMall), content sharing (Fengqiaoju Flowers), takeaway and most other O2O business products, etc.

  • Core business functions do not rely on certain native functions

  • Some enterprise applications can also be determined according to specific needs.

Some situations cannot be generalized, so explanations are based on specific situations.

  • Heavily relies on some native functions, such as the need to implement custom map line drawing in the application, the Bluetooth module for data communication, etc.

  • The core business involves instant messaging (IM), and we do not want to use third-party JS version SDK.

  • Needs to read and write files, such as recording short videos, editing pictures, editing videos, etc.

  • Some more "rogue" functions, such as application background persistence, push service persistence, etc.

  • Control application permissions, such as prohibiting screenshots and so on. This can only be handled in the native layer, and you know Android compatibility.

Many of the above situations need to be solved through the development of the native layer. Of course, 5+ SDK can be integrated at the same time, and the relevant extension APIs can still be used.

Similar products

  • cordova

  • apicloud

  • appcan

  • ionic

  • weex

  • react native

##Currently This is what I have learned below. Some products have been briefly sampled, and some products have not been experienced at all, so I will not make comparisons or excessive comments here.

Supplementary:

  • HBuilder is an IDE and is also the name of the base during real machine debugging. Together, these two are the environment and tools for developing 5+ Apps.

  • HTML5plus has many names. The DCloud official website says it is 5+Runtime. Responsible for extending the JS API and enabling JS to call native functions.

  • MUI UI framework for mobile development encapsulates several methods involving HTML5plus to facilitate development, which is often misunderstood. But it is really just a UI framework, and calling native capabilities has nothing to do with it.

Related recommendations:

Detailed introduction on how to use WeChat developer mobile application to create and obtain APP ID (picture)

The above is the detailed content of HTML5plus mobile application development examples sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What does h5 mean? What does h5 mean? Aug 02, 2023 pm 01:52 PM

H5 refers to HTML5, the latest version of HTML. H5 is a powerful markup language that provides developers with more choices and creative space. Its emergence promotes the development of Web technology, making the interaction and effect of web pages more Excellent, as H5 technology gradually matures and becomes popular, I believe it will play an increasingly important role in the Internet world.

How to distinguish between H5, WEB front-end, big front-end, and WEB full stack? How to distinguish between H5, WEB front-end, big front-end, and WEB full stack? Aug 03, 2022 pm 04:00 PM

This article will help you quickly distinguish between H5, WEB front-end, large front-end, and WEB full stack. I hope it will be helpful to friends in need!

How to implement h5 to slide up on the web side to load the next page How to implement h5 to slide up on the web side to load the next page Mar 11, 2024 am 10:26 AM

Implementation steps: 1. Monitor the scroll event of the page; 2. Determine whether the page has scrolled to the bottom; 3. Load the next page of data; 4. Update the page scroll position.

How to use position in h5 How to use position in h5 Dec 26, 2023 pm 01:39 PM

In H5, you can use the position attribute to control the positioning of elements through CSS: 1. Relative positioning, the syntax is "style="position: relative;"; 2. Absolute positioning, the syntax is "style="position: absolute;" "; 3. Fixed positioning, the syntax is "style="position: fixed;" and so on.

How to implement H5 form validation component in vue3 How to implement H5 form validation component in vue3 Jun 03, 2023 pm 02:09 PM

The rendering description is based on vue.js and does not rely on other plug-ins or libraries; the basic functions remain consistent with element-ui, and some adjustments have been made to the internal implementation for mobile terminal differences. The current construction platform is built using the uni-app official scaffolding. Because most mobile terminals currently have two types: h6 and WeChat mini-programs, it is very suitable for technology selection to run one set of code on multiple terminals. Implementation idea core api: use provide and inject, corresponding to and. In the component, a variable (array) is used internally to store all instances, and the data to be transferred is exposed through provide; the component uses inject internally to receive the data provided by the parent component, and finally combines its own attributes with method submission

What Does H5 Refer To? Exploring the Context What Does H5 Refer To? Exploring the Context Apr 12, 2025 am 12:03 AM

H5referstoHTML5,apivotaltechnologyinwebdevelopment.1)HTML5introducesnewelementsandAPIsforrich,dynamicwebapplications.2)Itsupportsmultimediawithoutplugins,enhancinguserexperienceacrossdevices.3)SemanticelementsimprovecontentstructureandSEO.4)H5'srespo

H5 Code: Accessibility and Semantic HTML H5 Code: Accessibility and Semantic HTML Apr 09, 2025 am 12:05 AM

H5 improves web page accessibility and SEO effects through semantic elements and ARIA attributes. 1. Use, etc. to organize the content structure and improve SEO. 2. ARIA attributes such as aria-label enhance accessibility, and assistive technology users can use web pages smoothly.

Summary and introduction to the new H5 promotion tag (with examples) Summary and introduction to the new H5 promotion tag (with examples) Aug 03, 2022 pm 05:10 PM

​This article will give you an introduction to the new H5 promotion tags. I hope it will be helpful to friends in need!

See all articles