Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Event bus registration template implementation method, storage medium, device and system

A technology of event bus and implementation method, which is applied in the direction of software engineering design, program control design, multi-program device, etc., can solve problems affecting the stable operation of applications and redundant codes on multiple pages, so as to reduce redundant codes and improve The effect of interactive efficiency

Active Publication Date: 2021-07-23
WUHAN DOUYU NETWORK TECH CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the actual development of an application, the work of an application is usually completed by multiple pages working together. As the number of pages increases, the business codes for registration and de-registration of pages on the event bus also increase, resulting in multiple There is a large amount of redundant code on this page, which affects the stable operation of the application

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Event bus registration template implementation method, storage medium, device and system
  • Event bus registration template implementation method, storage medium, device and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0025] see figure 1 As shown, the embodiment of the present invention provides a registration template implementation method of the event bus, which is suitable for page development of Android applications. The communication between various components in Android is relatively troublesome, and the communication between various components can be easily realized through the event bus. The registration template implementation method of the event bus in the embodiment of the present invention specifically includes:

[0026] S1: Add a template Activity between the user Activity and the Android system AppCompatActivity, and make the user Activity inherit from the template Activity, and the template Activity inherit from the Android system AppCompatActivity. AppCompatActivity is an Activity component used to replace Activity in the support.v7 packag...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses an event bus registration template implementation method, storage medium, equipment and system, and relates to the field of application development. The method includes: adding a layer of template activity between the user activity and the Android system AppCompatActivity, and making the user activity inherit In the template Activity, the template Activity inherits from the Android system AppCompatActivity; in the template Activity, rewrite the onCreate method in the Android system AppCompatActivity to realize the registration of the user page in the event bus, and the onDestory method to realize the anti-registration of the user page in the event bus; in the template Activity Write the get instance method to expose the Android system AppCompatActivity to the user Activity, realize the event sending of the user Activity, and rewrite the event callback function in the user Activity to realize the event receiving of the user Activity. The invention can effectively reduce redundant codes.

Description

technical field [0001] The invention relates to the field of application development, in particular to a method for realizing a registration template of an event bus, a storage medium, a device and a system. Background technique [0002] During the development of the Android application, an event bus is used to transmit messages to each page of the application. Pages that use the event bus need to register with the event bus, and when the page is destroyed, the page needs to be unregistered with the event bus. [0003] In the actual development of an application, the work of an application is usually completed by multiple pages working together. As the number of pages increases, the business codes for registration and de-registration of pages on the event bus also increase, resulting in multiple There is a large amount of redundant code on this page, which affects the stable operation of the application. Contents of the invention [0004] Aiming at the defects in the pri...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/54
CPCG06F8/38G06F9/542
Inventor 张磊陈少杰张文明
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products