Home > Mobile >  A doubt android studio environment
A doubt android studio environment

Time:11-22

Open the others write project, found the following statement, some look not to understand:
Private var camera: a camera?=null
Private var holder: SurfaceHolder?=null
Whether private var previewRunning=false//logo is preview
Private var deviceInfo: deviceInfo?=null
Private var timeMinuteChangeReceiver: timeMinuteChangeReceiver?=null
Private var netBroadcastReceiver: netBroadcastReceiver?=null


1, one is the middle of the camera is zoned cross, as if version upgrades, camera control is not recommended, for Camera2, that involves the relevant camera Camera2 all want to do? There is no faster way to upgrade,
2, DeviceInfo?=null, like this, there is a question mark behind why?

CodePudding user response:

DeviceInfo?=null, like this, there is a question mark behind why? Have never seen such wording, looked like three unary, but have never seen such a

If (aMin=a;
The else
Min=b;
You can use the following operators to handle
the condition ofMin=(a CodePudding user response:

Is not the same as the camera and Camera2, should can't replace a key, directly need to modify the code,

CodePudding user response:

This is the use of kotlin development

CodePudding user response:

Don't need to upgrade Camera2

CodePudding user response:

Yes, was developed by using kotlin, that have? Writing, writing is kotlin? , on the other hand, don't need to upgrade camera2, said although the strong is not recommended, but it can be used?

CodePudding user response:

Outdated methods, but can be used

CodePudding user response:

1. Upgrade Camera2 can oneself do, in the Camera2 abandon some methods of the Camera, and add some new methods,
2. The DeviceInfo?=null? Said nullable references, if not do judgment, when call is Kotlin empty safe, reference if DeviceInfo is empty, returns null directly, otherwise, it returns DeviceInfo. The length,
  • Related