CN114490140B - Low-delay input method for android application on Linux platform - Google Patents

Low-delay input method for android application on Linux platform Download PDF

Info

Publication number
CN114490140B
CN114490140B CN202210370501.3A CN202210370501A CN114490140B CN 114490140 B CN114490140 B CN 114490140B CN 202210370501 A CN202210370501 A CN 202210370501A CN 114490140 B CN114490140 B CN 114490140B
Authority
CN
China
Prior art keywords
edit box
android application
android
display unit
proxy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210370501.3A
Other languages
Chinese (zh)
Other versions
CN114490140A (en
Inventor
温研
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Linzhuo Information Technology Co Ltd
Original Assignee
Beijing Linzhuo Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Linzhuo Information Technology Co Ltd filed Critical Beijing Linzhuo Information Technology Co Ltd
Priority to CN202210370501.3A priority Critical patent/CN114490140B/en
Publication of CN114490140A publication Critical patent/CN114490140A/en
Application granted granted Critical
Publication of CN114490140B publication Critical patent/CN114490140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04812Interaction techniques based on cursor appearance or behaviour, e.g. being affected by the presence of displayed objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/545Gui
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a low-delay input method of android application on a Linux platform, which is characterized in that Linux edit box controls with the same appearance and the same position are established for an android application edit box which currently obtains an input focus in a Linux system to serve as a proxy edit box, a user uses the proxy edit box to complete the input of the android application, the proxy edit box realizes the interaction of user input operation and an android compatible environment, the data communication between an android application display unit and an android application compatible service is effectively reduced, the system resource overhead is reduced, the problem of response delay of the android application to the user input is further solved, and the user experience is improved.

Description

Low-delay input method for android application on Linux platform
Technical Field
The invention belongs to the technical field of development of running mobile applications on a desktop operating system, and particularly relates to a low-delay input method of android applications on a Linux platform.
Background
The Linux system android compatible environment (hereinafter abbreviated as android compatible environment) is a technology for running an android application (App) on a Linux system, and has important significance for enriching the Linux system application ecology. The android compatible environment generally comprises a Host end and a Guest end, wherein the Host end runs on a Linux system and mainly comprises an android container and a user interaction window, the android container is used for isolating partial kernel resources from the Linux system to support the Guest end to run, the Guest end mainly comprises a specially customized android application frame, an android running library and the like, and the android application runs on the Guest end. When the android application is used in the Linux system, the android application window is implemented as follows: and the window of the Linux system sends the handle to the android system running in the android container, and the android system renders the handle to obtain an android application user interface. In the prior art, a typical android compatible environment includes an android application display unit and an android application compatible service, the android application display unit is used for implementing an android application user interface on a Linux system, the android application compatible service is used for providing the android compatible environment running on the Linux system, and the android application is effectively run on the Linux system through the mutual cooperation of the android application display unit and the android application compatible service. In the existing android compatible environment, an xDSL in the xDSL is used as an android application display unit, and an xDSL is used as an android application compatible service.
When a user uses an android application in an android compatible environment, the user generally has a requirement for inputting content, and typical application scenarios are as follows: when a user uses the WPS Office App, the user needs to edit a file in the xDreidUI of the WPS Office App, and the file is edited by adopting an input method to input contents, wherein the input contents comprise English, Chinese and the like. At this time, the user can input the content by using the input method carried by the android system, but since the android input method is used only for receiving english letters input by a keyboard and cannot input Chinese characters by using the keyboard, the user can only click an input interface by using a mouse when the user wants to input Chinese content, which brings inconvenience to the operation of the user.
In order to solve the above problems, a method of using a Linux input method as an input method of an android application is proposed in the prior art, however, a process of using the Linux input method to input content into an android compatible environment needs to be completed by data communication among processes in a Linux system for many times, which may bring large system resource overhead, thereby causing a delay problem that a user inputs content operation to content display, and in addition, a problem that the android compatible environment and an android application display unit are not synchronized in refreshing may also occur, which may reduce the experience that the user uses the android application on the Linux system.
Disclosure of Invention
In view of this, the invention provides a low-latency input method for an android application on a Linux platform, which can reduce the latency of the android application input in an android compatible environment.
The invention provides a low-delay input method of android application on a Linux platform, which specifically comprises the following steps:
when an edit box is created in an android compatible environment, if the edit box inherits from a TextEdit class, the android application compatible service sends an edit box registration message to an android application display unit, and stores the current display content and the cursor position in the edit box, otherwise, the flow exits; when the edit box obtains a focus, the android application compatible service creates a shared memory as a drawing cache of the edit box for storing a display interface background of the edit box, draws the edit box to the drawing cache after emptying the edit box, restores the edit box by adopting the stored current display content and the cursor position, and then sends an agent edit box creation message to the android application display unit; when the edit box loses focus, the android application compatible service sends a proxy edit box destroy message to an android application display unit;
the edit box registration message is a message containing the name of the new edit box, the View _ ID, the Activity _ ID and the Activity process ID information; the agent edit box creation message is a message containing a View _ ID, an Activity process ID, a focus enable, a View upper left corner coordinate, a View size, a current display content, a cursor position, a text listener textChangedListener and a View attribute of an edit box for obtaining a focus; the agent edit box destroy message is a message containing View _ ID, Activity process ID and focus lost of an edit box with focus lost;
when the android application display unit receives the edit box registration message, adding the class name, the View _ ID, the Activity _ ID and the Activity process ID of the edit box in the message into an edit box queue as records; when the android application display unit receives the agent edit box creation message, modifying a corresponding record in an edit box queue according to the message content, creating an agent edit box, wherein the agent edit box is a self-drawing edit box, and the agent edit box adopts a shared memory as a drawing cache and uses data in the shared memory to realize drawing; and when the android application display unit receives the agent edit box destroying message, modifying the corresponding record in the edit box queue according to the message content, and destroying the agent edit box.
Further, when the edit box obtains a focus, before the android application compatible service creates a shared memory as a drawing cache of the edit box for storing a display interface background of the edit box, if the allocated shared memory exists in the current android compatible environment and the size of the shared memory meets a space requirement, the android application compatible service uses the shared memory as the drawing cache of the edit box; if the shared memory does not exist or the space requirement is not met, establishing the shared memory by the android application compatible service; the space requirement is that the shared memory is not less than the sum of the size of the display interface of the edit box and a memory threshold.
Further, when the android application display unit receives the agent edit box creation message, the process of creating the agent edit box according to the record corresponding to the message content modification edit box queue further includes the following steps:
step 3.1, searching the upper left corner coordinate, the View size and the View attribute of the edit box in the edit box queue according to the message; if the font textStyle in the View attribute does not exist in the Linux system, copying the font in the android compatible environment into the Linux system;
3.2, determining the relative position of the agent edit box and the android application window according to the upper left corner coordinate and the View size of the View, setting the font and the font size of the agent edit box, displaying the current display content according to the input type inputType, and setting the current cursor according to the cursor position;
3.3, if the name of the class of the edit box is AutoCompleteTextView or text listener textChangedLister is not null, when the input content of the proxy edit box changes, the proxy edit box sends the latest content and cursor position to the android application compatible service, and when the input is finished, the proxy edit box destroys the proxy edit box after sending an input completion event to the android application compatible service; otherwise, when the input is finished, the proxy edit box sends an input completion event to the android application compatible service, and the proxy edit box is destroyed after the input content and the cursor position are sent to the android application compatible service.
Further, when the input content of the proxy edit box in step 3.3 changes, the implementation manner of sending the latest content and cursor position to the android application compatible service by the proxy edit box is as follows: and when the input content reaches the set number of characters, the agent edit box sends the latest content and cursor position to the android application compatible service.
Further, the method for destroying the agent edit box in step 3.3 includes the following steps:
when the android application compatible service receives an input completion event, disabling a vsync signal of an android system and informing an android application display unit to hide an agent edit box; the android application display unit informs the android application compatible service of recovering the vsync signal, and after the vsync signal is recovered, the android application compatible service informs the android application display unit of destroying the proxy editing frame; and the android application display unit destroys the proxy edit box and deletes the edit box from the edit box queue.
Further, the android application display unit also provides a response to the android application window moving, and the method comprises the following steps:
when the android application display unit receives a mouse left button pressing event, emptying a moving window event queue, wherein the moving window event queue is used for storing the position coordinate of the upper left corner of the android application window in the android application window moving process; when the android application display unit receives a mouse moving event, a timer is created, the position coordinate of the upper left corner of an android application window is calculated, the position coordinate is added into the moving window event queue, when the timer event is received, the latest position coordinate in the moving window event queue is sent to an android application compatible service, and the moving window event queue is emptied; the signal precision and the time interval of the timer are the same as those of a vsync signal of the android system; and when the android application display unit receives a mouse left button lifting event, destroying the timer.
Further, the android application display unit also provides a response to the scaling of the android application window, and the method comprises the following steps:
when the android application display unit receives an android application window scaling event, the android application compatible service is informed of disabling a vsync signal of an android system, and the latest size of an android application window is sent to the android application compatible service; the android application compatible service sets an android application window by using the latest size, forcibly refreshes the edit box to generate a drawing cache, and updates the shared memory by adopting the display interface background of the new edit box; and after the android application display unit refreshes the proxy edit box by adopting data in the shared memory, informing the android application compatible service to recover the vsync signal of the android system.
Has the advantages that:
according to the android application display unit and the android application compatible service interaction method, the Linux edit box controls with the same appearance and the same position are created for the android application edit box which obtains the input focus currently in the Linux system to serve as the proxy edit box, the user uses the proxy edit box to complete the input of the android application, the interaction of the user input operation and the android compatible environment is realized through the proxy edit box, the data communication between the android application display unit and the android application compatible service is effectively reduced, the system resource overhead is reduced, the problem of response delay of the android application to the user input is further solved, and the user experience is improved.
Drawings
Fig. 1 is a flowchart of a low-latency input method for an android application on a Linux platform according to the present invention.
Detailed Description
The invention is described in detail below by way of example with reference to the accompanying drawings.
The invention provides a low-delay input method of android application on a Linux platform, which has the following basic ideas: an edit box control with the same appearance and the same position is established for an android application edit box which obtains an input focus currently in a Linux system to serve as an agent edit box, and the user input operation on the android application is actually realized through the input of the agent edit box so as to shield the intermediate response interaction process of the android application compatible service on input contents in the user input process.
The invention provides a low-delay input method of android application on a Linux platform, the flow of which is shown in figure 1, and the method comprises the following steps:
in the android compatible environment, the android application compatible service performs the following processing:
when the edit box is created, if the edit box is inherited from the TextEdit class, the android application compatible service sends an edit box registration message to an android application display unit, and stores the current display content and the cursor position in the edit box; otherwise, the android application compatible service does not process the edit box. When the edit box obtains a focus, the android application compatible service checks whether the distributed shared memory exists in the current android compatible environment, if so, the size of the shared memory is judged whether to meet the space requirement, if so, the shared memory is taken as a drawing cache of the edit box, after the edit box is emptied, the edit box is drawn to the shared memory, the saved current display content and the cursor position are adopted to restore the edit box, and then an agent edit box creation message is sent to the android application display unit; and if the shared memory does not exist or the space requirement is not met, establishing a Bitmap shared memory as a drawing cache of the edit box for storing interface data of the edit box, drawing the edit box to the drawing cache after emptying the edit box, recovering the edit box by adopting the stored current display content and the cursor position, and then sending an agent edit box establishing message to the android application display unit. When the edit box loses focus, the android application compatible service sends a proxy edit box destroy message to the android application display unit. The space requirement means that the shared memory is not less than the sum of the size of the display interface of the edit box and a memory threshold.
The edit box registration message is a message containing attribute information of a newly-built edit box in the current android compatible environment. The attribute information comprises a class name to which the edit box belongs, a View _ ID, an Activity _ ID and an Activity process ID.
The agent edit box creation message is a message containing focus identification information of an edit box which obtains a focus in the current android compatible environment. The focus identification information comprises a View _ ID, an Activity process ID, a focus enable, a View upper left corner coordinate, a View size, a current display content, a cursor position, a text listener textChangedLister and a View attribute, wherein the View attribute refers to a View general attribute comprising an input type inputType, a hint text hint, a font textStyle, a font size textSize and the like.
The agent edit box destroy message is a message containing the information of the focus losing identification information of the edit box losing focus in the current android compatible environment. The lost focus identification information comprises View _ ID, Activity Process ID and lost focus.
In the invention, in order to further improve the reliability of the proxy edit box creating and updating process, the size of the shared memory SharedBitmap is set as the sum of the bitmap size of the edit box display interface background and the set memory threshold, for example, the size of the shared memory is 1MB increased on the basis of the bitmap size of the edit box display interface background, namely the set memory threshold is 1MB, and the set memory threshold is used for storing bitmap header information. In addition, the drawing cache operation with the shared memory as the edit box is realized in a mode of setting the DrawingCache direction of the edit box as the initial position of the shared memory; the header + DrawingCache forms a Bitmap in a standard format by building a Bitmap header in front of the DrawingCache (adding the header makes the map a standard bmp image on Linux). In the invention, the display interface background refers to the content except the characters in the edit box interface, and comprises a background, a frame, a structure and the like.
In the Linux system, an android application display unit performs the following processing:
when the android application display unit receives the edit box registration message, the edit box registration message is analyzed, and then the class name, the View _ ID, the Activity _ ID and the Activity process ID of the edit box in the message are added to an edit box queue as a record.
When the android application display unit receives the agent edit box creating message, analyzing the agent edit box creating message, searching corresponding information in an edit box queue according to the message content, modifying the content in the edit box queue, creating an agent edit box, wherein the agent edit box is a self-drawing edit box, and the agent edit box adopts a shared memory as a drawing cache of a display interface background and realizes drawing by using data in the shared memory; when the android application display unit receives the agent edit box destroying message, the agent edit box destroying message is analyzed, corresponding information is searched in an edit box queue according to the message content, the content in the edit box queue is modified, and the agent edit box is destroyed.
Specifically, when the android application display unit receives the proxy edit box creation message, the following operations are performed:
s1.1, analyzing the agent edit box to create a message, and searching the information of the edit box in the edit box queue according to the message content, wherein the information comprises the upper left corner coordinate of the View, the View size and the View attribute.
S1.2, according to font textStyle information in the View attribute, searching a font identical to the font textStyle in the Linux system, and if the font textStyle information is not in the Linux system, copying the font in the android compatible environment into the Linux system.
S1.3, adopting interface frames such as Qt or GTK and the like, adopting data in a shared memory, and creating an agent edit box in the Linux system, wherein the relative position of the agent edit box and an android application window and a display interface of the agent edit box are the same as those of the edit box. Specifically, the relative position of the agent edit box and an android application window is determined according to the upper left corner coordinate and the View size of the View, the font and the font size of the agent edit box are set according to the font and the font size of the edit box, the current display content is displayed according to the input type inputType, and the current cursor is set according to the cursor position.
If the class name of the edit box is AutoCompleteTextView or the text listener textChangedLister is not empty, the edit box can give out corresponding prompt information according to the content input by the user, when the user inputs in the proxy edit box, the latest content and the cursor position are sent to the android application compatible service, the android application compatible service synchronizes the latest content to the edit box and then informs the android application display unit to display in the android application of the Linux system, until the user finishes inputting, the proxy edit box sends an input completion event to the android application compatible service, and meanwhile, the proxy edit box is destroyed.
Further, in order to improve execution efficiency, in the process of inputting by the user in the proxy edit box, the proxy edit box may send the latest content to the android application compatible service when the user input content reaches the set number of characters.
If the class name of the edit box is not AutoCompleteTextView or the text listener textChangedLister is null, the edit box is explained not to give prompt information according to the content input by the user, the proxy edit box sends an input completion event to the android application compatible service when the user finishes inputting, sends the input content and the cursor position to the android application compatible service, and destroys the proxy edit box.
Further, in order to better improve user experience, when the agent edit box is created, the android application display unit calculates the font size used in the agent edit box according to the proportion between the DPI of the android compatible environment and the DPI of the Linux system and the font size textSize; the currently displayed content is displayed according to the input type inputType, for example, when the input type is a password textword, a password symbol of the currently displayed content is displayed in an edit box.
When the android application display unit receives the agent edit box destroying message, the agent edit box sends an input completion event to the android application compatible service, and sends the input content and the cursor position to the android application compatible service to destroy the agent edit box.
The mode for destroying the agent edit box provided by the invention comprises the following steps:
s2.1, when the android application compatible service receives an input completion event, disabling a vsync signal of an android system and informing an android application display unit of hiding an agent edit box;
s2.2, after the agent edit box is hidden by the android application display unit, informing the android application compatible service to recover the vsync signal, and after the vsync signal is recovered by the android application compatible service, informing the android application display unit to destroy the agent edit box;
s2.3, destroying the proxy edit box by the android application display unit, and deleting the edit box from the edit box queue.
In order to improve the effect of creating the agent edit box, before the interface of the agent edit box is drawn by using the data of the shared memory, the invention processes the data in the shared memory or sets the interface of the agent edit box according to the size relation between the size of the data of the shared memory and the size of the agent edit box: if the size of the data in the shared memory is larger than the size of the proxy edit box and the size difference is smaller than or equal to a set threshold, cutting the data in the shared memory; if the size of the data in the shared memory is smaller than that of the proxy edit box and the size difference is smaller than or equal to a set threshold, setting the area covered by the interface data in the shared memory in the proxy edit box to be transparent; if the size of the data in the shared memory is larger than the size of the agent edit box and the size difference is larger than the set threshold, the image processing libraries such as Qt and GTK can be called to compress the data in the shared memory. The set threshold may be 3 pixels.
In order to further improve the synchronism of the agent edit box and the android application window, the invention also adds a response to the movement of the android application window in the android application display unit, and specifically comprises the following steps:
when a user presses a left mouse button, the android application display unit receives a left mouse button pressing event, and the android application display unit empties a moving window event queue which is used for storing the position coordinates of the upper left corner of the android application window in the moving process of the android application window;
when a user drags a mouse, the android application display unit receives a mouse moving event, at the moment, the android application display unit creates a Timer, the signal precision and the time interval of the Timer are completely the same as those of a vsync signal of an android system, the position coordinate of the upper left corner of an android application window is calculated and added into a moving window event queue, and when the Timer event is received, the latest position coordinate in the moving window event queue is sent to an android application compatible service, and the moving window event queue is emptied;
when the user stops pressing the left mouse button, the android application display unit receives the left mouse button lifting event, and at the moment, the android application display unit destroys the Timer.
In order to further improve the synchronism of the agent edit box and the android application window, the invention also adds a response to the scaling of the android application window in the android application display unit, and specifically comprises the following steps:
when a user zooms an android application window, the android application display unit receives an android application window zooming event, at the moment, the android application display unit informs the android application compatible service to disable a vsync signal of an android system, and the android application display unit sends the latest size of the android application window to the android application compatible service; the android application compatible service sets an android application window by using the latest size, forcibly refreshes the edit box to regenerate the drawing cache, and updates the shared memory by adopting the interface image of the obtained edit box; and the android application display unit refreshes the proxy edit box by adopting data in the shared memory and informs the android application compatible service to recover the vsync signal of the android system.
In summary, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A low-delay input method of android application on a Linux platform is characterized by comprising the following steps:
when an edit box is created in an android compatible environment, if the edit box inherits from a TextEdit class, the android application compatible service sends an edit box registration message to an android application display unit, and stores the current display content and the cursor position in the edit box, otherwise, the flow exits; when the edit box obtains a focus, the android application compatible service creates a shared memory as a drawing cache of the edit box for storing a display interface background of the edit box, draws the edit box to the drawing cache after emptying the edit box, restores the edit box by adopting the stored current display content and the cursor position, and then sends an agent edit box creation message to the android application display unit; when the edit box loses focus, the android application compatible service sends a proxy edit box destroy message to an android application display unit;
the edit box registration message is a message containing the name of the new edit box, the View _ ID, the Activity _ ID and the Activity process ID information; the agent edit box creation message is a message containing a View _ ID, an Activity process ID, a focus enable, a View upper left corner coordinate, a View size, a current display content, a cursor position, a text listener textChangedListener and a View attribute of an edit box for obtaining a focus; the agent edit box destroy message refers to a message containing View _ ID, Activity process ID and lose focus of an edit box losing focus;
when the android application display unit receives the edit box registration message, adding the class name, the View _ ID, the Activity _ ID and the Activity process ID of the edit box in the message into an edit box queue as records; when the android application display unit receives the agent edit box creation message, modifying a corresponding record in an edit box queue according to the message content, creating an agent edit box, wherein the agent edit box is a self-drawing edit box, and the agent edit box adopts a shared memory as a drawing cache and uses data in the shared memory to realize drawing; and when the android application display unit receives the agent edit box destroying message, modifying the corresponding record in the edit box queue according to the message content, and destroying the agent edit box.
2. The low-latency input method according to claim 1, wherein when the edit box obtains a focus, before the android application compatible service creates a shared memory as a drawing cache of the edit box for storing a display interface background of the edit box, if an allocated shared memory exists in a current android compatible environment and the size of the shared memory meets a space requirement, the android application compatible service uses the shared memory as the drawing cache of the edit box; if the shared memory does not exist or the space requirement is not met, establishing the shared memory by the android application compatible service; the space requirement is that the shared memory is not smaller than the sum of the size of the display interface of the edit box and the memory threshold.
3. The low-latency input method according to claim 1, wherein the process of creating the proxy edit box according to the corresponding record in the message content modification edit box queue when the android application display unit receives the proxy edit box creation message further comprises the steps of:
step 3.1, searching the upper left corner coordinate, the View size and the View attribute of the edit box in the edit box queue according to the message; if the font textStyle in the View attribute does not exist in the Linux system, copying the font in the android compatible environment into the Linux system;
3.2, determining the relative position of the agent edit box and the android application window according to the upper left corner coordinate and the View size of the View, setting the font and the font size of the agent edit box, displaying the current display content according to the input type inputType, and setting the current cursor according to the cursor position;
step 3.3, if the name of the type of the editing box is AutoCompleteTextView or textChangedLister of the text monitor is not null, when the input content of the proxy editing box changes, the proxy editing box sends the latest content and cursor position to the android application compatible service, and when the input is finished, the proxy editing box destroys the proxy editing box after sending an input completion event to the android application compatible service; otherwise, when the input is finished, the proxy edit box sends an input completion event to the android application compatible service, and the proxy edit box is destroyed after the input content and the cursor position are sent to the android application compatible service.
4. The low-latency input method according to claim 3, wherein in step 3.3, when the input content of the proxy edit box changes, the proxy edit box sends the latest content and cursor position to the android application compatible service by: and when the input content reaches the set number of characters, the agent edit box sends the latest content and cursor position to the android application compatible service.
5. A low latency input method according to claim 3, wherein the manner of destroying the proxy edit box in step 3.3 comprises the steps of:
when the android application compatible service receives an input completion event, disabling a vsync signal of an android system and informing an android application display unit to hide an agent edit box; the android application display unit informs the android application compatible service of recovering the vsync signal, and after the vsync signal is recovered, the android application compatible service informs the android application display unit of destroying the proxy editing frame; and the android application display unit destroys the proxy edit box and deletes the edit box from the edit box queue.
6. The low latency input method of claim 1, wherein the android application display unit further provides a response to android application window movement, comprising the steps of:
when the android application display unit receives a mouse left button pressing event, emptying a moving window event queue, wherein the moving window event queue is used for storing the position coordinate of the upper left corner of the android application window in the android application window moving process; when the android application display unit receives a mouse moving event, a timer is created, the position coordinate of the upper left corner of an android application window is calculated, the position coordinate is added into the moving window event queue, when the timer event is received, the latest position coordinate in the moving window event queue is sent to an android application compatible service, and the moving window event queue is emptied; the signal precision and the time interval of the timer are the same as those of a vsync signal of the android system; and when the android application display unit receives a mouse left button lifting event, destroying the timer.
7. The low-latency input method of claim 1, wherein the android application display unit further provides a response to android application window scaling, comprising the steps of:
when the android application display unit receives an android application window scaling event, the android application compatible service is informed of disabling a vsync signal of an android system, and the latest size of an android application window is sent to the android application compatible service; the android application compatible service sets an android application window by using the latest size, forcibly refreshes the edit box to generate a drawing cache, and updates the shared memory by adopting the display interface background of the new edit box; and after the android application display unit refreshes the proxy edit box by adopting data in the shared memory, informing the android application compatible service to recover the vsync signal of the android system.
CN202210370501.3A 2022-04-10 2022-04-10 Low-delay input method for android application on Linux platform Active CN114490140B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210370501.3A CN114490140B (en) 2022-04-10 2022-04-10 Low-delay input method for android application on Linux platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210370501.3A CN114490140B (en) 2022-04-10 2022-04-10 Low-delay input method for android application on Linux platform

Publications (2)

Publication Number Publication Date
CN114490140A CN114490140A (en) 2022-05-13
CN114490140B true CN114490140B (en) 2022-07-05

Family

ID=81488907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210370501.3A Active CN114490140B (en) 2022-04-10 2022-04-10 Low-delay input method for android application on Linux platform

Country Status (1)

Country Link
CN (1) CN114490140B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115640154B (en) * 2022-12-23 2023-03-17 北京麟卓信息科技有限公司 Cross-operation-environment interaction delay optimization method based on intelligent trajectory prediction

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882082A (en) * 2010-06-23 2010-11-10 中兴通讯股份有限公司 Method and device for localizing Java edit box
CN113220391A (en) * 2021-04-27 2021-08-06 北京麟卓信息科技有限公司 Analysis method and device for android application button function implementation mechanism
CN113238687A (en) * 2021-04-27 2021-08-10 北京麟卓信息科技有限公司 Method and device for realizing android application button function on desktop platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140280603A1 (en) * 2013-03-14 2014-09-18 Endemic Mobile Inc. User attention and activity in chat systems

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882082A (en) * 2010-06-23 2010-11-10 中兴通讯股份有限公司 Method and device for localizing Java edit box
CN113220391A (en) * 2021-04-27 2021-08-06 北京麟卓信息科技有限公司 Analysis method and device for android application button function implementation mechanism
CN113238687A (en) * 2021-04-27 2021-08-10 北京麟卓信息科技有限公司 Method and device for realizing android application button function on desktop platform

Also Published As

Publication number Publication date
CN114490140A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
WO2019174546A1 (en) User interface display method and device, apparatus, and storage medium
CN110221889B (en) Page display method and device, electronic equipment and storage medium
US11644939B1 (en) Managing application windows of applications from different servers within a same browser window on a user device
CN105511792A (en) In-position hand input method and system for form
CN111782332A (en) Application interface switching method and device, terminal and storage medium
WO2019047738A1 (en) Message display method, device, mobile terminal and storage medium
JPH07200724A (en) Stylus-input recognition and correction manager
CN114490140B (en) Low-delay input method for android application on Linux platform
KR102702653B1 (en) Live Ink Presence for real-time collaboration
CN114840290B (en) Method for adapting vertical screen android application to PC display
CN107977155B (en) Handwriting recognition method, device, equipment and storage medium
CN109558118B (en) Method, apparatus, device and storage medium for creating native components of a smart applet
CN111553172A (en) Translation document display method, device, system and storage medium
CN101587436B (en) Method and system for regional restoration in embedded device
CN114416044B (en) Input method and device for android application under Linux platform
CN114489920B (en) Input method of android application on Linux platform
CN109117072B (en) Writing area control method and system, writing method and system and interactive intelligent tablet
CN114745585A (en) Subtitle display method, device, terminal and storage medium
CN114092608B (en) Expression processing method and device, computer readable storage medium and electronic equipment
CN112394872B (en) Method and device for optimizing android system multi-touch supported by Linux platform
CN117666985A (en) Display interface control method and device, electronic equipment and storage medium
WO2018194853A1 (en) Enhanced inking capabilities for content creation applications
CN111552410A (en) Writing trace processing method, device, equipment and computer readable storage medium
CN118227025A (en) Text selection method
US20100123719A1 (en) Method and tool for creating irregular-shaped tables

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant