@@ -136,21 +136,27 @@ Here is the device support list of main branch (v1.x) and v2-main branch (v2.x):
136136![ ] ( doc/readme-images/Open-module-Android-wrapper.png )
137137
138138## run example
139-
140139### build example
141- ![ ] ( doc/readme-images/run-example.png )
140+ Click run button
141+ ![ ] ( doc/readme-images/Run-Example.png )
142142
143143### Main UI
144- ![ ] ( doc/readme-images/Example-HelloOrbbec.png )
144+ ![ ] ( doc/readme-images/Main-UI.png )
145+
146+ Click 'Basic-Quick Start' to display the color and depth sensor streams.
145147
146- Click 'DepthViewer' to show depth sensor stream.
148+ ### QuickStart
149+ ![ ] ( doc/readme-images/Example-QuickStart.png )
147150
148- ### DepthViewer
149- ![ ] ( doc/readme-images/Example-DepthViewer.png )
151+ ### Depth
152+ ![ ] ( doc/readme-images/Example-Depth.png )
153+
154+ ### MultiStreams
155+ ![ ] ( doc/readme-images/Example-MultiStreams.png )
150156
151157# Build Tools
152158## Android studio
153- Android studio ** Giraffe | 2022.3.1 Patch 1**
159+ Android studio ** Koala | 2024.1. 1**
154160download link [ Android studio] ( https://developer.android.com/studio )
155161
156162## NDK
@@ -219,23 +225,25 @@ mOBContext = new OBContext(getApplicationContext(), new DeviceChangedCallback()
219225 @Override
220226 public void onDeviceAttach (DeviceList deviceList ) {
221227 try {
222- mDevice = deviceList. getDevice(0 );
228+ mCurrentDevice = deviceList. getDevice(0 );
229+ mCurrentDeviceInfo = mCurrentDevice. getInfo();
223230 deviceList. close();
224231 // do something
225- mDevice. close();
226232 } catch (Exception e) {
227233 e. printStackTrace();
234+ } finally {
235+ deviceList. close();
228236 }
229237 }
230238
231239 @Override
232240 public void onDeviceDetach (DeviceList deviceList ) {
233241 try {
234242 if (null != mCurrentDevice){
235- int deviceCount= deviceList. getDeviceCount();
236- for (int i= 0 ;i < deviceCount; i++ ){
237- String uid= deviceList. getUid();
238- if (null != mCurrentDeviceInfo&& mCurrentDeviceInfo. getUid(). equals(uid)){
243+ int deviceCount = deviceList. getDeviceCount();
244+ for (int i = 0 ; i < deviceCount; i++ ){
245+ String uid = deviceList. getUid();
246+ if (null != mCurrentDeviceInfo && mCurrentDeviceInfo. getUid(). equals(uid)){
239247 // handle device disconnection
240248 // do something
241249
@@ -265,8 +273,7 @@ try {
265273 mPipeline = new Pipeline (mCurrentDevice);
266274
267275 StreamProfileList depthProfileList = mPipeline. getStreamProfileList(SensorType . DEPTH );
268- if (null != depthProfileList) {
269- depthProfileList. close();
276+ if (null == depthProfileList) {
270277 return ;
271278 }
272279 StreamProfile streamProfile = depthProfileList. getStreamProfile(0 );
@@ -297,8 +304,21 @@ Stop stream
297304``` java
298305try {
299306 mPipeline. stop();
300- mPipeline. close();
301- mPipeline = null ;
307+ } catch (OBException e) {
308+ e. printStackTrace();
309+ }
310+ ```
311+
312+ Close device
313+ ``` java
314+ try {
315+ if (null != mPipeline) {
316+ mPipeline. close();
317+ }
318+
319+ if (mDevice != null ) {
320+ mDevice. close();
321+ }
302322} catch (OBException e) {
303323 e. printStackTrace();
304324}
0 commit comments