Method and device for exception handling of Android platform

An exception handling and platform technology, applied in the field of exception handling, can solve the problems of not supporting direct printing of call stack information, unable to obtain C++ layer exception information, unable to collect C++ layer exception information, etc., so as to achieve unified processing and improve processing. performance effect

Active Publication Date: 2014-11-19
QINGDAO HISENSE MOBILE COMM TECH CO LTD
View PDF4 Cites 28 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the specific implementation, the Android platform generally includes the JAVA layer and the C++ layer. During the running of the program, if an exception occurs in the JAVA layer, the JAVA layer can directly print the call stack information according to the exception, thereby obtaining the JAVA layer based on the call stack information. Layer exception information, but if an exception occurs in the C++ layer, because the C++ layer does not support direct printing of the call stack information on the Android platform, the exception information of the C++ layer cannot be obtained
Therefore, since the exception information of the C++ layer cannot be collected, it is of no help for the repair of program failure bugs

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
  • Method and device for exception handling of Android platform
  • Method and device for exception handling of Android platform
  • Method and device for exception handling of Android platform

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0060] refer to figure 1 , showing a flow chart of the steps of Embodiment 1 of a method for handling exceptions on the Android platform of the present invention, the Android platform may include a JAVA layer and a C++ layer, and specifically may include the following steps:

[0061] Step 101, during the operation of a certain program in the JAVA layer, when abnormal data of the C++ layer is detected, the abnormal data of the C++ layer is converted into abnormal data of the JAVA layer;

[0062] In a specific implementation, the platform on which the Android system is installed may be a mobile phone, a computer and other devices.

[0063] In the Android platform, it can be divided into the JAVA layer of the application program written in JAVA code, such as the Framework layer, and the C++ layer of the virtual machine written in C++ code, such as the Native layer. The operation of applications written in JAVA depends on the JAVA virtual machine. The JAVA virtual machine can fac...

Embodiment 2

[0084] refer to figure 2 , shows a flow chart of the steps of Embodiment 2 of an Android platform exception handling method of the present invention, the Android platform may include a JAVA layer and a C++ layer, and specifically may include the following steps:

[0085] Step 201, during the operation of a certain program in the JAVA layer, when abnormal data of the C++ layer is detected, the abnormal data of the C++ layer is converted into abnormal data of the JAVA layer;

[0086] In a preferred embodiment of the present invention, an exception handling function corresponding to the exception data of the C++ layer can be registered in the Android platform of Android; the step 201 can include the following sub-steps:

[0087] Sub-step S31, calling the preset query or setting the signal processing function sigaction to obtain the abnormal data of the C++ layer;

[0088] Sub-step S32, using the exception handling function to call the JAVA local interface JNI;

[0089] Sub-ste...

Embodiment 3

[0142] refer to Figure 4 , showing a structural block diagram of a device embodiment of an Android platform exception handling of the present invention, the Android platform may include a JAVA layer and a C++ layer, and specifically may include the following modules:

[0143] The conversion module 401 is used to convert the abnormal data of the C++ layer into the abnormal data of the JAVA layer when abnormal data of the C++ layer is detected during the operation of a certain program in the JAVA layer;

[0144] In a preferred embodiment of the present invention, various exception handling functions corresponding to various types of abnormal data of the C++ layer can be registered in the Android platform of Android; the conversion module 401 can include the following submodules:

[0145] A function call unit, used to call a preset query or set a signal processing function sigaction to obtain the abnormal data of the C++ layer;

[0146] a function acquiring unit, configured to ...

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

PUM

No PUM Login to view more

Abstract

The embodiment of the invention provides a method and device for exception handling of an Android platform. The Android platform comprises a JAVA layer and a C++ layer. The method comprises the steps that in the operation process of a certain program on the JAVA layer, when abnormal data of the C++ layer are detected, the abnormal data of the C++ layer are converted into abnormal data of the JAVA layer; the converted abnormal data of the JAVA layer are collected; the abnormal data of the JAVA layer are stored in the Android platform; operation of the program is ended. According to the method and device for exception handling of the Android platform, when it is detected that the C++ layer is abnormal on the Android platform, the abnormal data of the C++ layer are converted into the abnormal data of the JAVA layer, and then the abnormal data of the JAVA layer are collected.

Description

technical field [0001] The present invention relates to the technical field of exception handling, in particular to an Android platform exception handling method and an Android Android platform exception handling device. Background technique [0002] Most terminals have the ability to detect error conditions when the program is running, so that the program can notify the program in a standard way when it detects the occurrence of a certain event so that it can make the necessary response. In short, when an exception occurs in the program, the program will handle the exception accordingly. This mechanism is collectively referred to as the exception mechanism. [0003] The processing flow of the exception mechanism can include: 1. When an exception occurs in the program, immediately end the method called by the program without returning a value; at the same time, throw an exception object; 2. Search for an exception handler that can handle the exception. The exception is cau...

Claims

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

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F11/07G06F9/44
Inventor 王磊
Owner QINGDAO HISENSE MOBILE COMM TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products