Unlock instant, AI-driven research and patent intelligence for your innovation.

An implementation method and device for running original platform code on a target platform

An implementation method and platform technology, applied in the computer field, can solve the problems of large workload of interface functions and unfavorable maintenance, and achieve the effect of being beneficial to later maintenance and improving efficiency.

Active Publication Date: 2018-05-01
QINGDAO HISENSE MOBILE COMM TECH CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The embodiment of the present invention provides an implementation method and device for running the original platform code on the target platform, so as to solve the problem that the modification of interface functions requires a large workload and is not conducive to later maintenance.

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • An implementation method and device for running original platform code on a target platform
  • An implementation method and device for running original platform code on a target platform

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0051] SmsMemoryStatus SimMemStatus = null;

[0052] SmsManager smsManager = SmsManager.getDefault();

[0053] SimMemStatus = smsManager.getSmsSimMemoryStatus();

[0054] if(SimMemStatus!=null){

[0055] int iccSmsCount = SimMemStatus.getTotal();

[0056] return iccSmsCount;

[0057]}else{

[0058] return 0;

[0059]}

[0060] The meaning of the above code is: get the object SimMemStatus of type SmsMemoryStatus through smsManager.getSmsSimMemoryStatus(), and then call the member function getTotal() of SimMemStatus.

[0061] For example: in above-mentioned example 1, involve two classes namely SmsManager and SmsMemoryStatus, these two classes have respective path positions respectively, so after the class constructed after the function construction according to the method provided by the present invention, utilize above-mentioned reflection method, then smsManager The feedback of .getSmsSimMemoryStatus() is the standard path class instead of the built class, and there is a...

example 2

[0066] Method getMethod;

[0067] Method getMethod2;

[0068] getMethod = Invoke.getMethod(getTelephonyClass(), getSmsSimMemoryStatus", int.class);

[0069] Object obj = Invoke.invoke(getDefaultMethod(), false, getMethod, subId);

[0070] if(obj!=null){

[0071] getMethod2 = nvoke.getMethod(Invoke.getClass("android.telephony.SmsMemoryStatus"),"getTotal");

[0072] iccSmsCount = (Integer) Invoke.invoke(obj, false, getMethod2);

[0073] return iccSmsCount;

[0074]}

[0075] else {

[0076] return 0;

[0077]}

[0078] In the above code, in the first reflection, the built class SmsManage is reflected to obtain the function getSmsSimMemoryStatus() to obtain an object obj, and the second reflection is directly invoked on the basis of the first obtained object obj to call getTotal(). The use of this double-layer reflection only needs to construct the interface function of the outermost class at most, and another inner subclass only needs to directly reflect and call in the s...

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

PUM

No PUM Login to View More

Abstract

The invention discloses an implementation method and device for running original platform codes on a target platform, so as to solve the problem that the modification of interface functions requires a large workload and is unfavorable for later maintenance. The method includes: importing the constructed class into the target platform, the constructed class including the interface functions different from the target platform in the original platform code, the constructed class having the same name as the class including the different interface functions in the original platform code; Reflect on the built class.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to an implementation method and device for running original platform codes on a target platform. Background technique [0002] When using JAVA to achieve cross-platform, it is realized through a virtual machine, and the operation of the virtual machine needs to perform reflection operations and call a large number of interface functions. When the software with the same function is on different platforms, the code framework may be the same or similar, but the interface parameters called are different, so the virtual machines that need to run are also different. When the software with the same function implements the operation of running the original platform code on the target platform, the interface function needs to be modified. However, some base class interface functions occur frequently, and if the calls need to be modified, the calls need to be modified one by one in the vir...

Claims

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

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/20G06F9/455
Inventor 张立震阙远
Owner QINGDAO HISENSE MOBILE COMM TECH CO LTD