Dajiang -Android Tutorial - several pits camera application

EDITORIAL

Some time ago because the examination was delayed, reproduce today Dajiang camera application step on a few pits.

First

Problem Description

The demo code into the knock, finally up and running after not being given the first activity_connection.xml interface display properly, start to connect UAV ( Mavic Air ). The first problem: the interface has not refresh. TextView can not change, Button nor can. Then quickly check the code, the code no problem. I am anxious to be broken. After careful analysis of the processes found under connetion.java in onCreate method, although dynamic registration of the broadcast is the phrase
Here Insert Picture Descriptionbut there is no way to route broadcast method always leads to refreshSDKRelativeUI can not be invoked to perform

Solution

Add the following two methods in the code startSDKRegistration () and the onProductDisconnect onProductConnect
Here Insert Picture Description Such a method can be invoked refreshSDKRelativeUI

the second

Problem Description

When the button button can be used, then click the button to exit the program directly collapse, view the error was found, the settext method assigned to the null object (error picture not preserved) is the placeHere Insert Picture Description online Baidu is not a lot like me

Solution

The recordingTime new objects like in the onCreate method.
Here Insert Picture Description

At last

With this, my camera application can run up.

Released two original articles · won praise 0 · Views 60

Guess you like

Origin blog.csdn.net/weixin_41748164/article/details/104085958