Android App Development: Difference between revisions

From David's Wiki
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Notes on Android App development
Notes on Android App development
See https://developer.android.com/get-started




Line 11: Line 13:
         println("Found camera id " + id)
         println("Found camera id " + id)
         val charac = manager.getCameraCharacteristics(id)
         val charac = manager.getCameraCharacteristics(id)
         val capabilities = charac.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES);
         val capabilities = charac.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)
         for (capability in capabilities) {
         for (capability in capabilities) {
             if (capability == CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT) {
             if (capability == CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT) {
Line 18: Line 20:
       }
       }
   }
   }
} catch ( e : Exception) {
} catch (e : Exception) {
     println("An exception occurred")
     println("An exception occurred")
}
}

Latest revision as of 13:53, 15 May 2024

Notes on Android App development

See https://developer.android.com/get-started


Camera 2 API

Getting Started

val cameraManager = getSystemService(Context.CAMERA_SERVICE) as CameraManager
try {
    val cameraIds = manager.cameraIdList
    for (id in cameraIds) {
        println("Found camera id " + id)
        val charac = manager.getCameraCharacteristics(id)
        val capabilities = charac.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES)
        for (capability in capabilities) {
            if (capability == CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT) {
                println("Depth is available");
            }
       }
   }
} catch (e : Exception) {
    println("An exception occurred")
}

Resources