CN105760239A - Method and system for accessing third party library for first system in second system - Google Patents

Method and system for accessing third party library for first system in second system Download PDF

Info

Publication number
CN105760239A
CN105760239A CN201610077264.6A CN201610077264A CN105760239A CN 105760239 A CN105760239 A CN 105760239A CN 201610077264 A CN201610077264 A CN 201610077264A CN 105760239 A CN105760239 A CN 105760239A
Authority
CN
China
Prior art keywords
party
jni
library
android
virtual machine
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.)
Granted
Application number
CN201610077264.6A
Other languages
Chinese (zh)
Other versions
CN105760239B (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.)
Yuanxin Information Technology Group Co ltd
Original Assignee
Yuanxin Technology
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 Yuanxin Technology filed Critical Yuanxin Technology
Priority to CN201610077264.6A priority Critical patent/CN105760239B/en
Publication of CN105760239A publication Critical patent/CN105760239A/en
Application granted granted Critical
Publication of CN105760239B publication Critical patent/CN105760239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/541Interprogram communication via adapters, e.g. between incompatible applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method and a system for accessing a third-party library for a first system in a second system, wherein the method comprises the following steps: loading a third party JNI library through a Java virtual machine for the second system in a form compatible with a JNI loading interface for the first system; deriving a relevant API of the third party JNI library through the Java virtual machine; and calling the related API reversely through JNI to indirectly access the third party JNI library. The technical scheme of the invention can realize that the third party library used for the first system is accessed in the second system, thereby greatly expanding the application range of the external equipment.

Description

Second system accesses the method and system of the third party library for the first system
Technical field
It relates to mobile platform software technology field, particularly relate to a kind of method and system accessing the third party library for the first system in second system.
Background technology
At present, the operating system restriction with the matching used external equipment scope of application of mobile platform is subject to mobile platform, so that the use of external equipment does not possess universality, constrain the development of external equipment.Such as in mobile platform field, the operating system of current main flow is the Google Android system (Android) creating and having developed.Owing to it uses extensively, when causing a lot of associated external equipment to be mated operation, provide only JNI (JavaNativeInterface, the Java local interface) interface library based on Android, cause the third party that the operating system of non-Android is difficult to the offer of compatible manufacturer to realize storehouse.And, some manufacturer is based on the consideration of safety and competition, it is impossible to provides the version of third party's JNI library, hence for the operating system of non-Android, cannot matched use especially.
Such as currently used NFC technique widely, owing to the application market direction of NFC is primarily related to be equipped with the mobile equipment of Android system, this results in the storehouse that manufacturer generally only can provide the JNI interface based on Android to realize, to complete the core operation function of NFC.For the operating system of non-Android, the above-mentioned storehouse that manufacturer provides cannot be compatible.Module similar with it also has camera etc., and the operating system of non-Android all cannot compatible interested third party manufacturer provides easily storehouse.
Although non-Android system is in the market share and prevents take up relative potence, but these systems are objective reality after all, in absolute quantity also very huge, in order to meet the demand of these non-Android system third party devices to continuing to bring out, it is necessary to provide a kind of approach to be fitted in non-Android system by the existing Runtime Library for the third party device of Android system exploitation.
Summary of the invention
For overcoming Problems existing in correlation technique, the invention provides and a kind of in second system, access the method for the third party library for the first system, system and terminal unit.
First aspect according to disclosure embodiment, it is provided that a kind of method accessing the third party library for the first system in second system, including:
By the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
The relevant API (ApplicationProgrammingInterface, application programming interface) of described third party's JNI library is derived by described Java Virtual Machine;
By API relevant described in JNI reverse calling with third party's JNI library described in dereference.
In an embodiment, described the first system is Android system, and described third party's JNI library is third party's JNI library of compatible Android system.
In an embodiment, by including with the operation of the form loading third-party JNI library compatible with the JNI loading interface for the first system for the Java Virtual Machine of second system: by the Java Virtual Machine for described second system with the form loading third-party JNI library of Java local interface JNI.
In an embodiment, included by the operation of the relevant API of the described Java Virtual Machine described third party's JNI library of derivation: in JVM (JavaVirtualMachine, the abbreviation of Java Virtual Machine), create access interface and pass through the access interface described third party's JNI library of access created.
In an embodiment, described method also includes the concrete function of the third party's JNI library according to described the first system and described relevant API is selected.
In an embodiment, described the first system is Android system, and described second system is non-Android system, and described method also includes the relevant API encapsulating described reverse calling for the localization of described non-Android system.
In an embodiment, described non-Android system is linux system, iOS system or WindowsPhone system.
In an embodiment, the operation encapsulating the relevant API of described reverse calling for the localization of described non-Android system includes being encapsulated by QBus, DBus or Socket localization the relevant API of described reverse calling for described non-Android system.
Second aspect according to disclosure embodiment, it is provided that a kind of system accessing the third party library for the first system in second system, including:
Load-on module, is used for by the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
Derive module, for being derived the relevant API of described third party's JNI library by described Java Virtual Machine;
Reverse calling module, is used for by API relevant described in JNI reverse calling with third party's JNI library described in dereference.
In an embodiment, described the first system is Android system, and described third party's JNI library is third party's JNI library of compatible Android system.
In an embodiment, described load-on module is used for: by the Java Virtual Machine for described second system with the form loading third-party JNI library of Java local interface JNI.
In an embodiment, described derivation module is used for: creates access interface in JVM and passes through the access interface described third party's JNI library of access created.
In an embodiment, the described system accessing the third party library for the first system in second system also includes selecting module, and described relevant API is selected by the concrete function for the third party's JNI library according to described the first system.
In an embodiment, described the first system is Android system, described second system is non-Android system, and the described system accessing the third party library for the first system in second system also includes package module, for encapsulating the relevant API of described reverse calling for the localization of described non-Android system.
In an embodiment, described non-Android system is linux system, iOS system or WindowsPhone system.
In an embodiment, described package module is used for, and is encapsulated the relevant API of described reverse calling by QBus, DBus or Socket localization for described non-Android system.
The third aspect according to disclosure embodiment, it is provided that a kind of terminal unit, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
By the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
The relevant API of described third party's JNI library is derived by described Java Virtual Machine;
By API relevant described in JNI reverse calling with third party's JNI library described in dereference.
Embodiment of the disclosure that the technical scheme of offer can include following beneficial effect:
Embodiment of the disclosure and provide calling and realizing method of a kind of quick compatible Android third-party Runtime Library, in order to non-Android system, it is possible to quickly use related peripherals and non-comercial operation storehouse, be greatly enriched the function of non-Android system.It should be appreciated that it is only exemplary and explanatory that above general description and details hereinafter describe, the disclosure can not be limited.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meets embodiments of the invention, and is used for explaining principles of the invention together with description.
Fig. 1 is the flow chart of a kind of method accessing the third party library for the first system in second system according to an exemplary embodiment;
Fig. 2 is the flow chart of a kind of method accessing the third party library for the first system in second system according to an exemplary embodiment;
Fig. 3 is the block diagram of a kind of system accessing the third party library for the first system in second system according to an exemplary embodiment;
Fig. 4 is the block diagram of a kind of terminal unit according to an exemplary embodiment.
Detailed description of the invention
Here in detail exemplary embodiment being illustrated, its example representation is in the accompanying drawings.When as explained below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element.Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the present invention.On the contrary, they only with in appended claims describe in detail, the present invention some in the example of consistent system and method.
Fig. 1 is the flow chart of a kind of method accessing the third party library for the first system in second system according to an exemplary embodiment, the present embodiment is applicable to the situation realizing accessing the third party library for the first system in second system, as it is shown in figure 1, the method accessing the third party library for the first system in second system described in the present embodiment includes:
In step s 110, by the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system.
The JNI standard that mostly can adopt Android due to presently relevant peripheral hardware provides third-party Runtime Library, quickly to coordinate operation with Android system, as example, owing to manufacturer is for the consideration of maintenance cost, Runtime Library available in the non-Android operation system of typically not offer.Although Android system by enhancing Java compatible degree under Android system and improve service efficiency to the customization of Java, but which also limits the use scope of the third-party application for its exploitation.In order to compatible Android third-party Runtime Library uses for non-Android system, it is necessary first to go Androidization, and standard Java language is exactly a kind of well selection.
The example of the present embodiment encapsulates the access interface to third party's Runtime Library with standard Java language, so, no matter runs under any Java Virtual Machine (JVM), and its result is all identical.
As the example implemented, standard Java language one access interface class of definition can be used, wherein comprising Java Localization methodologies (NativeMethod), it implements and is completed by third party's JNI library, is referred to Java local interface JNI mode and realizes.
JNI is the abbreviation of JavaNativeInterface, it provides some API and achieves communicate (mainly the C&C++) of Java and other language.From Java1.1, JNI standard becomes a part for Java platform, and it allows the code that Java code and other language are write to interact.
For local compiled language at the beginning of JNI design, especially C and C++ and design, but it and do not interfere with you and use other programming languages, as long as calling convention is supported just passable.Use Java mutual with the local code compiled, it will usually to lose platform portable.But, do so is acceptable in some cases, or even necessary.Such as, use the storehouse that some are old, interact with hardware, operating system, or in order to improve the performance of program.
In the step s 120, the relevant API of described third party's JNI library is derived by described Java Virtual Machine.
When in step S110 with pass through the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system after, it is possible to by this loading third-party JNI library instantiation for accessing described third party's JNI library.
For the example in step S110, after loading corresponding third party's JNI library, namely can call its Localization methodologies by access interface class described in instantiation, thus the specific function performed in third party's JNI library.
In step s 130, by API relevant described in JNI reverse calling with third party's JNI library described in dereference.
After creating the described access interface example to third party's JNI library, non-Android system can obtain this interface instance under home environment, and indirectly accesses third party's JNI library by this interface instance, thus calling the function realized by third party's JNI library.This calls the angle from JVM is reverse calling, namely calls the class/object/method within JVM from the non-Android system outside JVM, therefore, is called reverse calling in the present embodiment.By the access interface example in reverse calling JVM, non-Android system and the third party's Runtime Library communications conduit therebetween for Android exploitation are got through, so that described third party's Runtime Library can be compatible with non-Android system, the scope of this available devices greatly having widened non-Android system and third party's JNI library, enrich the function of non-Android system, simultaneously, third party manufacturer modifies without to the Runtime Library being originally Android system exploitation, get final product slitless connection to non-Android system, reduce research and development and the lower deployment cost of third party manufacturer.
It should be noted that this example is using third party's Runtime Library of compatible Android system as described third party's JNI library.But this is merely illustrative of, it practice, for particular system exploitation third party's JNI library be diverted to other system time, can realize with reference to aforesaid way, this is not construed as limiting by the present embodiment.
Further, in order to provide customizability more flexibly, Java Virtual Machine JVM involved in above-mentioned example can be JVM, for instance the JVM etc. provided by OpenJDK.But, the complete java runtime storehouse (RuntimeLibrary) no matter comprised in any JVM, it is all redundancy and huge for the concrete function of the described access interface accessing third party's JNI library, because the concrete function realizing described access interface mostly just relates to a part in java runtime storehouse (sometimes or even seldom part) class and function.If complete java runtime storehouse being loaded in JVM can increase much unnecessary room and time expense, for some embedded system (such as the intelligent terminal such as Set Top Box, wearable device) of software and hardware limited ability, bigger java runtime storehouse is unacceptable sometimes.In order to overcome drawbacks described above, concrete kind that the present embodiment may be able to be used according to the concrete function realizing described access interface and the scope of function, described java runtime storehouse is carried out suitable cutting, delete and quote storehouse corresponding to those classes that will not use and function, even can realize with minimum java runtime storehouse to run JVM, thus resource occupation amount when JVM run is greatly lowered, correspondingly improve the operational efficiency of JVM, the platform limited for operational capability is very applicable, and the technical scheme of the present embodiment can be applied to the system of lightweight.
Present disclose provides calling and realizing method of a kind of quick compatible Android third-party Runtime Library, in order to non-Android system, it is possible to quickly use related peripherals and non-comercial operation storehouse, be greatly enriched the function of non-Android system.
Fig. 2 is the flow chart of a kind of method accessing the third party library for the first system in second system according to an exemplary embodiment, as in figure 2 it is shown, the method accessing the third party's JNI library for the first system in second system described in the present embodiment includes:
In step S210, by the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system.
In step S220, derived the relevant API of described third party's JNI library by described Java Virtual Machine.
In step S230, by API relevant described in JNI reverse calling with third party's JNI library described in dereference.
Above-mentioned steps S110-S230 is identical with embodiment one, does not repeat them here, specifically can referring to the description in embodiment one.
In step S240, encapsulate the relevant API of described reverse calling for the localization of described non-Android system.
On the basis of embodiment one, the present embodiment can further include step S240, namely encapsulates the interface of reverse calling in described step S230 for the localization of above-mentioned non-Android system.Described non-Android system has a variety of in the prior art, for instance linux system, iOS system, WindowsPhone system, etc..Generally, operating system has communication mode available between its internal process, for instance QBus, DBus or Socket etc..Although in described step S230, namely non-Android system can complete the access to described third party's JNI library indirectly by the above-mentioned access interface in JVM described in reverse calling, but between its occupation mode and above-mentioned non-Android system, compatible degree is still inadequate, and it is still convenient not to use.In order to enable above-mentioned non-Android system to complete the above-mentioned access to third party's JNI library by local interface method of calling easily, the present embodiment is according further to the application demand of above-mentioned non-Android system, the interface of reverse calling in described step S230 is localized encapsulation, and the concrete mode of encapsulation can be passed through the localizations such as such as QBus, DBus or Socket and encapsulate the relevant API of described reverse calling.After localizing encapsulation, described third party's JNI library can be called and be accessed to the application under described non-Android system and this environment just according to the mode that oneself had or was familiar with, it is possible to simplified access interface, improves service efficiency.
The present embodiment, by being encapsulated into the access interface of third party's JNI library for the localization of non-Android system, further increases convenience compatible with non-Android system for third party's JNI library, improves the efficiency using third party's JNI library under non-Android system.
Fig. 3 is the block diagram of a kind of system accessing the third party's JNI library for the first system in second system according to an exemplary embodiment, as it is shown on figure 3, the system accessing the third party's JNI library for the first system in second system described in the present embodiment includes load-on module 310, derives module 320 and reverse calling module 330.
This load-on module 310 is configured to by the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system.
This derivation module 320 is configured to be derived the relevant API of described third party's JNI library by described Java Virtual Machine.
This reverse calling module 330 is configured to by API relevant described in JNI reverse calling with third party's JNI library described in dereference.
Third party's JNI library described in the present embodiment is the functional packet for operating local device, third party manufacturer provide.In order to realize the efficient access to local device, local compiled code is generally adopted to realize, for instance C, C++ etc..It addition, for third party's JNI library of Android system exploitation, the JNI mechanism being additionally based upon Android provides the JNI calling interface that can be used for Android platform, and Android system can directly invoke the function in third party's JNI library by this interface.But, this interface restriction third party's JNI library can be only applied to Android system.
In an embodiment, described the first system is Android system, and described third party's JNI library is third party's JNI library of compatible Android system.
In an embodiment, described load-on module 310 for by the Java Virtual Machine for described second system with the form loading third-party JNI library of Java local interface JNI.
In an embodiment, described derivation module 320 is used for: creates access interface in JVM and passes through the access interface described third party's JNI library of access created.
In an embodiment, the described system accessing the third party library for the first system in second system also includes selecting module (not shown in Fig. 3), and described relevant API is selected by the concrete function for the third party's JNI library according to described the first system.
In an embodiment, described the first system is Android system, described second system is non-Android system, the described system accessing the third party library for the first system in second system also includes package module (not shown in Fig. 3), for encapsulating the relevant API of described reverse calling for the localization of described non-Android system.
In an embodiment, described non-Android system is linux system, iOS system or WindowsPhone system.
In an embodiment, described package module is used for, and is encapsulated the relevant API of described reverse calling by QBus, DBus or Socket localization for described non-Android system.
The JNI standard that mostly can adopt Android due to presently relevant peripheral hardware provides third-party Runtime Library, quickly to coordinate operation with Android system, owing to manufacturer is for the consideration of maintenance cost, Runtime Library available in the non-Android operation system of typically not offer.Although Android system by enhancing Java compatible degree under Android system and improve service efficiency to the customization of Java, but which also limits the use scope of the third-party application for its exploitation.In order to compatible Android third-party Runtime Library uses for non-Android system, it is necessary first to go Androidization.And standard Java language is exactly a kind of well selection.
In an exemplary embodiment, encapsulating the access interface to third party's Runtime Library with standard Java language, so, no matter run under any Java Virtual Machine (JVM), its result is all identical.
As the example implemented, standard Java language one access interface class of definition can be used, wherein comprising Java Localization methodologies (NativeMethod), it implements and is completed by third party's JNI library, is referred to Java local interface JNI mode and realizes.
After encapsulating the access interface to third party's JNI library with standard Java language, it is possible to by this interface instantiation for accessing described third party's JNI library.For above-mentioned example, after loading corresponding third party's JNI library, namely can call its Localization methodologies by access interface class described in instantiation, thus the specific function performed in third party's JNI library.
After creating the described access interface example to third party's JNI library, non-Android system can obtain this interface instance under home environment, and indirectly accesses third party's JNI library by this interface instance, thus calling the function realized by third party's JNI library.This calls the angle from JVM is reverse calling, namely calls the class/object/method within JVM from the non-Android system outside JVM, therefore, is called reverse calling in the present embodiment.By the access interface example in reverse calling JVM, non-Android system and the third party's Runtime Library communications conduit therebetween for Android exploitation are got through, so that described third party's Runtime Library can be compatible with non-Android system, the scope of this available devices greatly having widened non-Android system and third party's JNI library, enrich the function of non-Android system, simultaneously, third party manufacturer modifies without to the Runtime Library being originally Android system exploitation, get final product slitless connection to non-Android system, reduce research and development and the lower deployment cost of third party manufacturer.
Further, in order to provide customizability more flexibly, Java Virtual Machine JVM involved in above-mentioned example can be JVM, for instance the JVM etc. provided by OpenJDK.But, the complete java runtime storehouse (RuntimeLibrary) no matter comprised in any JVM, it is all redundancy and huge for the concrete function of the described access interface accessing third party's JNI library, because the concrete function realizing described access interface mostly just relates to a part in java runtime storehouse (sometimes or even seldom part) class and function.
If complete java runtime storehouse being loaded in JVM can increase much unnecessary room and time expense, for some embedded system (such as the intelligent terminal such as Set Top Box, wearable device) of software and hardware limited ability, bigger java runtime storehouse is unacceptable sometimes.
In order to overcome drawbacks described above, concrete kind that the present embodiment may be able to be used according to the concrete function realizing described access interface and the scope of function, described java runtime storehouse is carried out suitable cutting, delete and quote storehouse corresponding to those classes that will not use and function, even can realize with minimum java runtime storehouse to run JVM, thus resource occupation amount when JVM run is greatly lowered, correspondingly improve the operational efficiency of JVM, the platform limited for operational capability is very applicable, and the technical scheme of the present embodiment can be applied to the system of lightweight.
In an exemplary embodiment, reverse calling module 330 can also be for the localization of above-mentioned non-Android system and encapsulates the interface of described reverse calling.Described non-Android system has a variety of in the prior art, for instance linux system, iOS system, WindowsPhone system, etc..Generally, operating system has communication mode available between its internal process, for instance, QBus, DBus or Socket etc..Although namely described non-Android system can complete the access to described third party's JNI library indirectly by the above-mentioned access interface in JVM described in reverse calling, but the compatible degree between its occupation mode and above-mentioned non-Android system is still inadequate, and it is still convenient not to use.
In order to enable above-mentioned non-Android system to complete the above-mentioned access to third party's JNI library by local interface method of calling easily, the present embodiment is according further to the application demand of above-mentioned non-Android system.The interface of described reverse calling is localized encapsulation, concrete mode such as QBus, DBus or Socket etc. of encapsulation.After localizing encapsulation, described third party's JNI library can be called and be accessed to the application under described non-Android system and this environment just according to the mode that oneself had or was familiar with, it is possible to simplified access interface, improves service efficiency.
By being encapsulated into the access interface of third party's JNI library for the localization of non-Android system, further increase convenience compatible with non-Android system for third party's JNI library, improve the efficiency using third party's JNI library under non-Android system.
About the system in above-described embodiment, the concrete mode that wherein unit performs to operate has been described in detail in about the embodiment of the method, and explanation will be not set forth in detail herein.
The method accessing the third party's JNI library for the first system in second system that the system of third party's JNI library for the first system that accesses in second system that the present embodiment provides can perform the embodiment of the present invention one and embodiment two provides, possesses the corresponding functional module of execution method and beneficial effect.
Fig. 4 is a kind of block diagram for terminal unit 400 according to an exemplary embodiment.Such as, terminal unit 400 can be mobile phone, computer, digital broadcast terminal, messaging devices, game console, tablet device, armarium, body-building equipment, personal digital assistant etc..
With reference to Fig. 4, terminal unit 400 can include following one or more assembly: processes assembly 402, memorizer 404, electric power assembly 406, multimedia groupware 408, audio-frequency assembly 410, the interface 412 of input/output (I/O), sensor cluster 414, and communications component 416.
Process assembly 402 and generally control the integrated operation of terminal unit 400, such as with display, call, data communication, the operation that camera operation and record operation are associated.Process assembly 402 and can include one or more processor 420 to perform instruction, to complete all or part of step of above-mentioned method.Additionally, process assembly 402 can include one or more module, it is simple to what process between assembly 402 and other assemblies is mutual.Such as, process assembly 402 and can include multi-media module, with facilitate multimedia groupware 408 and process between assembly 402 mutual.
Memorizer 404 is configured to store various types of data to support the operation at equipment 400.The example of these data includes any application program for operation on terminal unit 400 or the instruction of method, contact data, telephone book data, message, picture, video etc..Memorizer 404 can be realized by any kind of volatibility or non-volatile memory device or their combination, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, disk or CD.
The various assemblies that electric power assembly 406 is terminal unit 400 provide electric power.Electric power assembly 406 can include power-supply management system, one or more power supplys, and other generate, manage and distribute, with for terminal unit 400, the assembly that electric power is associated.
Multimedia groupware 408 includes the screen providing an output interface between described terminal unit 400 and user.In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen may be implemented as touch screen, to receive the input signal from user.Touch panel includes one or more touch sensor to sense the gesture on touch, slip and touch panel.Described touch sensor can not only sense the border of touch or sliding action, but also detects the persistent period relevant to described touch or slide and pressure.In certain embodiments, multimedia groupware 408 includes a front-facing camera and/or post-positioned pick-up head.When equipment 400 is in operator scheme, during such as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive the multi-medium data of outside.Each front-facing camera and post-positioned pick-up head can be a fixing optical lens system or have focal length and optical zoom ability.
Audio-frequency assembly 410 is configured to output and/or input audio signal.Such as, audio-frequency assembly 410 includes a mike (MIC), and when terminal unit 400 is in operator scheme, during such as call model, logging mode and speech recognition mode, mike is configured to receive external audio signal.The audio signal received can be further stored at memorizer 404 or send via communications component 416.In certain embodiments, audio-frequency assembly 410 also includes a speaker, is used for exporting audio signal.
I/O interface 412 provides interface for processing between assembly 402 and peripheral interface module, above-mentioned peripheral interface module can be keyboard, puts striking wheel, button etc..These buttons may include but be not limited to: home button, volume button, startup button and locking press button.
Sensor cluster 414 includes one or more sensor, for providing the state estimation of various aspects for terminal unit 400.Such as, what sensor cluster 414 can detect equipment 400 opens/closed mode, the relative localization of assembly, such as described assembly is display and the keypad of terminal unit 400, sensor cluster 414 can also detect terminal unit 400 or the position change of 400 1 assemblies of terminal unit, the presence or absence that user contacts with terminal unit 400, the variations in temperature of terminal unit 400 orientation or acceleration/deceleration and terminal unit 400.Sensor cluster 414 can include proximity transducer, is configured to when not having any physical contact object near detection.Sensor cluster 414 can also include optical sensor, such as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, this sensor cluster 414 can also include acceleration transducer, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 416 is configured to facilitate between terminal unit 400 and other equipment the communication of wired or wireless mode.Terminal unit 400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communications component 416 receives the broadcast singal or the broadcast related information that manage system from external broadcasting via broadcast channel.In one exemplary embodiment, described communications component 416 also includes near-field communication (NFC) module, to promote junction service.Such as, can based on RF identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, terminal unit 400 can be realized by one or more application specific integrated circuits (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components, is used for performing said method.
In the exemplary embodiment, additionally providing a kind of non-transitory computer-readable recording medium including instruction, for instance include the memorizer 404 of instruction, above-mentioned instruction can have been performed said method by the processor 420 of terminal unit 400.Such as, described non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
A kind of non-transitory computer-readable recording medium, when the instruction in described storage medium is performed by the processor of mobile terminal, making mobile terminal be able to carry out a kind of method accessing the third party's JNI library for the first system in second system, described method includes:
By the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
The relevant API of described third party's JNI library is derived by described Java Virtual Machine;
By API relevant described in JNI reverse calling with third party's JNI library described in dereference.
Those skilled in the art, after considering description and putting into practice invention disclosed herein, will readily occur to other embodiment of the present invention.The application is intended to any modification of the present invention, purposes or adaptations, and these modification, purposes or adaptations are followed the general principle of the present invention and include the undocumented known general knowledge in the art of the disclosure or conventional techniques means.Description and embodiments is considered only as exemplary, and the true scope of the present invention and spirit are pointed out by claim below.
It should be appreciated that the invention is not limited in precision architecture described above and illustrated in the accompanying drawings, and various amendment and change can carried out without departing from the scope.The scope of the present invention is only limited by appended claim.

Claims (10)

1. the method accessing the third party library for the first system in second system, it is characterised in that including:
By the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
The relevant API of described third party's JNI library is derived by described Java Virtual Machine;
By API relevant described in JNI reverse calling with third party's JNI library described in dereference.
2. method according to claim 1, it is characterised in that described the first system is Android system, described third party's JNI library is third party's JNI library of compatible Android system.
3. method according to claim 1, it is characterized in that, by including with the operation of the form loading third-party JNI library compatible with the JNI loading interface for the first system for the Java Virtual Machine of second system: by the Java Virtual Machine for described second system with the form loading third-party JNI library of Java local interface JNI.
4. method according to claim 1, it is characterised in that included by the operation of the relevant API of the described Java Virtual Machine described third party's JNI library of derivation: create access interface in JVM and pass through the access interface described third party's JNI library of access created.
5. method according to claim 1, it is characterised in that described method also includes the concrete function of the third party's JNI library according to described the first system and described relevant API is selected.
6. method according to claim 1, it is characterised in that described the first system is Android system, described second system is non-Android system, and described method also includes the relevant API encapsulating described reverse calling for the localization of described non-Android system.
7. method according to claim 6, it is characterized in that, the operation encapsulating the relevant API of described reverse calling for the localization of described non-Android system includes being encapsulated by QBus, DBus or Socket localization the relevant API of described reverse calling for described non-Android system.
8. the system accessing the third party library for the first system in second system, it is characterised in that including:
Load-on module, is used for by the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
Derive module, for being derived the relevant API of described third party's JNI library by described Java Virtual Machine;
Reverse calling module, is used for by API relevant described in JNI reverse calling with third party's JNI library described in dereference.
9. system according to claim 8, it is characterized in that, described the first system is Android system, and described second system is non-Android system, described system also includes package module, and described package module for encapsulating the relevant API of described reverse calling for the localization of described non-Android system.
10. a terminal unit, it is characterised in that including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
By the Java Virtual Machine for second system with the form loading third-party JNI library compatible with the JNI loading interface for the first system;
The relevant API of described third party's JNI library is derived by described Java Virtual Machine;
By API relevant described in JNI reverse calling with third party's JNI library described in dereference.
CN201610077264.6A 2016-02-03 2016-02-03 Method and system for accessing third party library for first system in second system Active CN105760239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610077264.6A CN105760239B (en) 2016-02-03 2016-02-03 Method and system for accessing third party library for first system in second system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610077264.6A CN105760239B (en) 2016-02-03 2016-02-03 Method and system for accessing third party library for first system in second system

Publications (2)

Publication Number Publication Date
CN105760239A true CN105760239A (en) 2016-07-13
CN105760239B CN105760239B (en) 2019-04-16

Family

ID=56330045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610077264.6A Active CN105760239B (en) 2016-02-03 2016-02-03 Method and system for accessing third party library for first system in second system

Country Status (1)

Country Link
CN (1) CN105760239B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669782A (en) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 Hardware abstraction layer multiplexing method, device, operating system and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110289519A1 (en) * 2010-05-21 2011-11-24 Frost Gary R Distributing workloads in a computing platform
CN103176838A (en) * 2011-12-22 2013-06-26 盛乐信息技术(上海)有限公司 Method and system compatible with Android native program
CN103677767A (en) * 2012-09-04 2014-03-26 联想(北京)有限公司 Method for processing application programs, operation system and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110289519A1 (en) * 2010-05-21 2011-11-24 Frost Gary R Distributing workloads in a computing platform
CN102985908A (en) * 2010-05-21 2013-03-20 超威半导体公司 Distributing and parallelizing workloads in a computing platform
CN103176838A (en) * 2011-12-22 2013-06-26 盛乐信息技术(上海)有限公司 Method and system compatible with Android native program
CN103677767A (en) * 2012-09-04 2014-03-26 联想(北京)有限公司 Method for processing application programs, operation system and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669782A (en) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 Hardware abstraction layer multiplexing method, device, operating system and equipment

Also Published As

Publication number Publication date
CN105760239B (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN106020943B (en) Application program double-opening method and device
CN104869569A (en) Network permission control method and apparatus of application program
CN104484200A (en) Method and device for updating firmware
CN105554687A (en) Networking working method of intelligent equipment, device and intelligent equipment
CN105824633A (en) Multi-language resource switching method and device of application program
CN105722064A (en) Method and device for acquiring terminal information
CN106201610A (en) Web application accesses the method and device of the primary function of terminal
CN106227419A (en) Screenshotss method and device
CN105376412A (en) Information processing method and device
CN105871913A (en) Identity authentication method and system
CN105094830A (en) Method and device for executing target functions
CN105354017A (en) Information processing method and apparatus
CN105183571A (en) Function calling method and device
CN104317647A (en) Application function realizing method, device and terminal
CN105630546A (en) System updating method and system updating device
CN105224644A (en) Information classification approach and device
CN104714826A (en) Application theme loading method and device
CN110968362A (en) Application running method and device and storage medium
CN105260201B (en) Using installation method, device and smart machine
CN104636064A (en) Gesture generating method and device
CN107402756B (en) Method, device and terminal for drawing page
CN106325508A (en) Method and device for processing application
CN111090463B (en) Resource identification method and device and computer storage medium
CN105760239A (en) Method and system for accessing third party library for first system in second system
CN106293717A (en) The processing method of the setting of terminal, device and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210204

Address after: 101300 room 153, 1 / F, building 17, 16 Caixiang East Road, Nancai Town, Shunyi District, Beijing

Patentee after: Yuanxin Information Technology Group Co.,Ltd.

Address before: 100176 room 2222, building D, building 33, 99 Kechuang 14th Street, Beijing Economic and Technological Development Zone, Beijing

Patentee before: BEIJING YUANXIN SCIENCE & TECHNOLOGY Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20160713

Assignee: Beijing Yuanxin Junsheng Technology Co.,Ltd.

Assignor: Yuanxin Information Technology Group Co.,Ltd.

Contract record no.: X2021110000018

Denomination of invention: Method and system for accessing a third party library for the first system in the second system

Granted publication date: 20190416

License type: Common License

Record date: 20210531