Development system based on Android system, decoupling method and device

A development system and message management technology, applied in the computer field, can solve the problems that Activity or Fragment coupling cannot realize reuse, complex relationship chain, low readability and maintainability, etc.

Active Publication Date: 2019-06-07
ALIBABA GRP HLDG LTD
View PDF6 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 1. When creating, binding or configuring View in Activity and Fragment, it contains a large amount of view-related code. If you want to write a unit test for it, you must first decouple the business logic and view code, otherwise it is difficult to complete the unit writing test
[0005] 2. Due to the need to create, bind and configure View in Activity and Fragment, each class is very swollen, and the coupling between Activity or Fragment cannot be reused, and the readability and maintainability are low
[0006] 3. In actual business, the interdependence and state transfer between various components lead to complex relationship chains, deep state transfer paths, and extremely complicated state update notifications

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
  • Development system based on Android system, decoupling method and device
  • Development system based on Android system, decoupling method and device
  • Development system based on Android system, decoupling method and device

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0246] Based on the existing Activity and Fragment processing mechanism, Figure 4A The realization of →4B→4C involves the following process:

[0247] Card bag (CardBag), card list (CardBagList), and card (CardItem) are all created in Activity. These three are common business classes, and card (CardItem) is an internal class of card list (CardBagList).

[0248] The corresponding execution process is: click the card—the card responds to the click—read the expansion status of the card bag (CardBag.isPopup)—expand if the card bag is not expanded (CardBag.popup())—expand the card list

[0249] CardBagList is used as a card list, which aggregates card CardItem, and listens to the click event onClick in CardItem. When clicking, you need to first read whether the status in the card bag CardBag has been expanded CardBag.isPopup, and then call the card bag expansion method CardBag.popup() . Since it is necessary to directly read the status of the card package and execute the...

example 2

[0253] After the page is switched to the background, it is necessary to return to the state of the card package, that is, Figure 4B , Figure 4C →4A.

[0254] Based on the existing Activity and Fragment processing mechanism, Figure 4B , Figure 4C → The realization of 4A involves the following processes:

[0255] Call CardBag.isPopup(), CardBag.packup(), CardBagList.isListPopup(), CardBagList.packupList() in the life cycle method onpause() of the Activity. With more and more components, there will be a lot of business logic code stacked in onPause(), and the Activity will become bloated and difficult to maintain due to a large number of business logic code stacks. And, since business components are not related, portability and maintainability will be greatly reduced.

example 3

[0257] Based on the existing Activity and Fragment processing mechanism, when the business changes, creating other page reuse components involves the following processing process:

[0258] Create a new page, take the CardBagList and put it in the Activity page, but because CardBagList and CardBag are strongly referenced, all the logic code related to CardBag needs to be removed to pass the compilation, and the onPause() method of the new page Activity is also required Add the CardBagList.isListPopup() call and the CardBagList.packupList() call in , the migration cost is high, and the function is easy to be lost.

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 embodiment of the invention provides a development system based on an Android system, a decoupling method and device. The development system comprises a component management unit Controller whichis used for managing a service component in an Android system, and the Controller has a related attribute which is matched with the life cycle of the registered service component; a life cycle management unit LifeCycle used for providing a life cycle interface of the service component, and distributing the life cycle of the service component to a corresponding Controler; and a message management unit Messager used for processing the communication between the Controllers. According to the embodiment of the invention, through adoption of a modular programming solution, the modularization of large-scale application can be realized, the programming complexity and the dependence coupling degree are reduced, the business components are independent of each other, and the flexibility of the business components is higher.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to an Android system-based development system, an Android system-based decoupling method, an Android system-based decoupling device, and one or more computer-readable media. Background technique [0002] In the Android system, Activity is the most basic and commonly used component. Activity can provide a screen, and each Activity is given a window on which the user interface can be drawn. Windows usually fill the screen, but can also be smaller than the screen and float above other windows. Activity is a component responsible for interacting with users, and all operations are closely related to users. In order to complete a certain task, the user can interact through the Activity. For example, dialing, taking pictures, sending E-mail, viewing maps and so on. Some controls can be displayed on the Activity (such as displaying specified controls through setContentView(Vi...

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
IPC IPC(8): G06F9/451G06F9/48
Inventor 谭博颖
Owner ALIBABA GRP HLDG LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products