My friends and I participate in a competition-the Internet of things application skills competition, the skills required by this competition, hardware technology, Android platform Development Technology,. NET platform development technology, so this is a team game, basically no one can master these three kinds of technology (students).
One of today's tasks is: Serial communication experiments. For Android platform development, requires the Android project deployed to the test machine, and then open the serial port for the COM1,COM2,COM3 and corresponding baud rate of the serial port.
The problem we encountered was that after the Android project was deployed, a "forced shutdown" message box pops up.
Here's my understanding of "forced shutdown":
Android Program, popup "Force close" message box location:
1. After the start of the program, complete the window before initialization;
2. After clicking the button
Android program, pop-up "force off" message box to solve the idea:
1. First, consider whether your own code is problematic.
Ways to find the wrong code location:
1). Commissioning method.
By setting breakpoints
2). Code exclusion method.
The first type: By setting multiple message boxes. After which message box appears the "Force Close" message box, then the code after this is the wrong location of the code.
The second type: by commenting the code. First, all the input code is commented out, and then followed by the code execution sequence to unpack the comments, run until the error code location is found.
2. Then consider whether the SDK version is different from the simulator, test machine or the real-computer SDK version
The simulator version is low, the use of the SDK version is high, which will lead to some of the simulation machine control and control properties are incompatible;
The simulator version is high, the use of the SDK version is low, the same problem will occur;
Perhaps I am not very comprehensive, but if we can solve the problem, it is better;
Welcome everyone to comment, point out my shortcomings, if there is a better way, also write out, we learn together.
The "forced closure" approach to the development of the four--android platform of the first programmer's thinking "cultivation"