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.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

