Hybrid App development can also use the theory of the father of computer

With the vigorous development of the mobile Internet, traditional native applications and Web applications are gradually integrated, and the von Neumann structure provides a solid theoretical foundation for this. By storing the core logic and data of applications in the cloud, application separation is achieved, which not only provides developers with more convenient maintenance and update methods, but also provides users with a more lightweight experience. Mini program technology further promotes this trend. With its low entry threshold and rapid development characteristics, developers can more flexibly build feature-rich applications.

However, the development of cloud hybrid applications also faces some challenges. Issues such as network connection stability, security, and user privacy need to be carefully considered and resolved. At the same time, the development of technology should also be closely integrated with user needs to ensure that application performance and user experience can be continuously improved. The integration of cloud storage, applet technology and other elements is leading the new trend of mobile application development. In the future, we can expect more innovations and breakthroughs to make the development of mobile applications more intelligent, convenient and in line with user expectations. Both developers and users will benefit from this wave of change. More and more software is provided in the form of saas or cloud. Therefore, the development of hybrid apps accounts for an increasing proportion, and major manufacturers are turning to this type of development. I have seen some articles recently, and the development of hybrid apps can also use the theory of the father of computers - the von Neumann structure to open up brain holes. In this article, we will briefly introduce it.

Front science popularization: Which apps can be put on the app market?

Many people have a misunderstanding when Apple puts it on the shelves. They think that as long as they are not natively developed apps (even with a little function), they cannot be put on the shelves.

This is not the case. The software received by Apple does not distinguish between Web App, Hybrid App or native App: 1. Web App: The webview in the App opens the remote website. The biggest disadvantage of Web App is: the loading resources are remote and reload every time, which will slow down the speed, commonly known as website packaged APP. 2. Hybrid App: The webview in the App opens local H5, js, css and image resources without reading remote data. The reduction of loaded resources greatly speeds up the opening of the App. It is commonly known as a hybrid developed APP. 3. Native App: The logical framework and image resources are local, and the data is rarely read. When submitted to the application market for review, because they are all packaged locally Loading, so there are not many business processes that can be changed after the App is launched, so the native App cannot flexibly respond to market demand. This is one of the important factors why many Apps and even major manufacturers now need to switch to hybrid App development.

​Hybrid App development method-1: webview loads web pages

WebView is a component that embeds web content in mobile applications and is used to implement Hybrid App development. In Hybrid development, you combine local native app code (usually written in a language such as Java (Android) or Swift/Objective-C (iOS)) with web technologies such as HTML, CSS, and JavaScript to simultaneously Take advantage of native apps and web content.

The working principle of WebView is roughly: 1. Embed web content: This is the most basic component. Developers can use the WebView component to create a view to display a specified web page (local or remote); 2. Load HTML, CSS and JavaScript to create a more interactive and dynamic interface, thereby enhancing the user experience of the application; 3. Communication bridge creation, native function call: JavaScript code can use the device's local functions by calling native interfaces, such as accessing the camera, location information, storage, etc. Native code can expose these functions to JavaScript scripts for use in WebView; 4. Performance and security: Although WebView can embed Web content, its performance is far less than that of a completely native application. In addition, WebView essentially runs in the sandbox environment of the application and is separated from the rest of the application, so security can be guaranteed to a certain extent. This type of App was once favored by developers at the technical level at the beginning of the Internet 2.0 stage when web pages were popular. However, with the improvement and progress of the application market review mechanism, after the development of this type of App is completed, it needs to go through many times. It can only be put on the shelves after review, or it may never pass. As a result, hybrid App development using Java classload has entered the mainstream of App development.

Hybrid app development method-2: java classload class loading mechanism

Using Java's class loading mechanism to read bytecode from a network stream to load classes is often referred to as Remote Class Loading. This technology can be used to achieve hybrid App development in specific cases, especially when it is necessary to dynamically update application functions or modules. Here are the basic principles:

  1. Generating and transmitting bytecode: In hybrid app development, you can compile the bytecode of some Java classes into binary form and transmit it to the mobile application over the network. These bytecodes represent some new functionality or module that you want to introduce, or update existing functionality.

  2. Custom class loader: In your application, you need to implement a custom class loader to read bytecode from the network stream and load the corresponding class. Java's class loading mechanism allows you to create custom class loaders by extending the ClassLoader class, which can override the default behavior of loading classes.

  3. Class loading process: When the application code needs to use a certain class, it will first be found and loaded through a custom class loader. If the class has not been loaded, the class loader will read the corresponding bytecode from the network stream and convert it into a Class object. The loaded class can be instantiated and used in the application just like a class loaded in a regular way.

  4. Security and isolation considerations: Remote class loading involves security and isolation issues. You need to ensure that only trusted bytecode is loaded to prevent the injection of malicious code. In addition, you also need to pay attention to avoid problems such as class conflicts and memory leaks.

  5. Dynamic updates and modularization: Remote class loading allows you to introduce new features, fix bugs, or modify existing features by updating remote bytecode without redistributing the application. This is very useful when you need to quickly respond to user needs or conduct A/B testing.

Hybrid App Development Method-3: Referring to the von Neumann structure, the packets transmitted over the network can be either data or code

Referring to the von Neumann structure, storing code and data in the cloud for hybrid App development can achieve an architecture similar to a "cloud hybrid application". The basic principle of this architecture is to store the core logic and data of the application on the cloud server, while the application on the mobile device is mainly responsible for displaying the interface, user interaction and communication with the cloud.

Here are the basic principles:

  1. Separate front-end and back-end: In this architecture, the application on the mobile device mainly plays the role of front-end, responsible for the display of the user interface, response to user input, and communication with the cloud. The core logic and data storage of the application are placed on the cloud server, acting as a back-end role.

  2. Cloud logic and data: The core logic, business processing and data storage of the application are all performed in the cloud. This includes the application's business logic, database, file storage, etc. The application on the mobile device communicates with the cloud server to obtain the required data and perform necessary operations.

  3. Mobile interface: Applications on mobile devices are mainly responsible for displaying the user interface, receiving user input and passing it to the cloud. Mobile applications can use local technologies (such as native UI components or local WebView) to build user interfaces, and at the same time initiate requests to the cloud server through network requests.

  4. Cloud communication: The mobile device communicates with the cloud server through a network connection. This can be done via HTTP protocol, WebSocket, etc. The mobile application sends a request to the cloud, and the cloud executes logic according to the request and returns corresponding data or results.

  5. Dynamic update and maintenance: Under this architecture, the core logic and data of the application are stored in the cloud, so it is possible to dynamically update the application's functions, fix bugs, or introduce new features without the need for users to manually update the application. This enables faster response to user needs and market changes.

The construction technology of modern super apps such as WeChat, Alipay, Baidu, Meituan, etc. is a similar concept: small program + App shell

Compared with traditional native application development technology, mini program technology has the advantages of being lightweight, rapid development, cross-platform, no installation required, and more user-friendly. Mini programs can be used without downloading and installing by users. At the same time, the development cost of mini programs is relatively lower, the development speed is faster, and it is easier to maintain and update. Mini program technology also supports cross-platform operation and can run on multiple mobile devices at the same time, greatly expanding the coverage of applications and bringing greater business value to enterprises and developers. Some of the more well-known mini program container technology products on the market include: WeChat, Alipay, Baidu, Douyin mini programs, etc. They are all designed to improve the technical base of large social platforms’ own mini program ecology and can provide third parties for privatized deployment. The products include: FinClip, mPaaS and other products. It is understood that FinClip’s self-developed mini program container technology can enable corporate apps to quickly run mini programs. Their SDK can also be embedded in functional device terminals other than apps (such as Linux, Windows, MacOS, Kirin etc. operating system).

Supongo que te gusta

Origin blog.csdn.net/pingpinganan0828/article/details/132537337
Recomendado
Clasificación