Xamarin.Android CameraX Sample

483 views
Skip to first unread message

Nathan Sokalski

unread,
Sep 14, 2022, 8:42:33 PM9/14/22
to Android CameraX Discussion Group
Does anybody know of any good examples and/or tutorials for CameraX that use Xamarin.Android? I am learning CameraX for the first time, and am attempting to figure out how to start/stop the Preview programmatically. The only Xamarin.Android CameraX example I have been able to find is:


But this example runs the Preview continuously. This is my first time working with the camera, and I am somewhat confused about how binding it to the lifecycle works & means. Any suggestions?

Leo Huang

unread,
Sep 20, 2022, 4:25:00 AM9/20/22
to Android CameraX Discussion Group, njsok...@hotmail.com
I am not familiar with Xamarin.Android. But if you want to start/stop Preview after Preview is bound, then you can call Preview.setSurfaceProvider(...) with null/non-null value. Like the sample code you pasted.

njsok...@hotmail.com 在 2022年9月15日 星期四上午8:42:33 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages