Debugging a small summary of the GMS project

xiaoxiao2021-04-08  6

A small summary of debugging the GMS project:

1. Run the program on the phone, an item exception prompt: NULL POINTER does not have a pointer anomaly, often because in the program, we accessed a member variable or member method of an object, and the value of this object is NULL.

2, when the destroyApPException is abnormal, it may be because we have unlaminated operations in the main program's DestroyApp () method, such as FileSelector.Stop (), but we don't construct an object such as FileSelector, this exception occurs. .

3, the most critical is a warning window prompt when starting to run: MIDlet-name null, because we define such a warning window in the StartApp () method of the main program, the purpose is to display the manufacturer of this MIDlet And when writing the program, the statement has an error. This should be: GetAppProperty ("MIDlet-vendor"), but I wrote System.GetProperty ("MIDlet-vendor"), so the return value is NULL, so warning windows Tip above: MIDlet-name null.

4. There is also a prompt to run in the background, the key is that no main interface is displayed. This is also an error when writing a program. Remove the exclamation in the startapp () method in the StartApp () method in the main program, and add fileselector in the back setCurrent () to display the file browsing the main interface, and will not appear in the background running error prompt. .

5. When displaying a file, you may display the empty, just this statement in CASE INIT_OP in CASE INIT_OP (Connector.Open (Initdir, Connector.Read)), remember is Connector.Read if it is written as a Connector .Read_write may be displayed empty.

6. There is also the Out of Memory memory procedure. Over the picture is too large, the border is loaded, sometimes other abnormalities don't have, this exception is gone, it is a bit strange.

Small knot: When debugging the program, the best function slowly adds debugging, don't wait for all program code to be completely written on the phone, this, if there is a problem, it is not easy to analyze the reason for generating errors. .


New Post(0)