josejad Expert Licensed User Longtime User Mar 26, 2020 #1 Hi all: I've used CameraEx in another app and the samples work perfectly for me: [Class] CameraEx - Extends the camera library functionality Example based on B4XPages: https://www.b4x.com/android/forum/threads/b4x-b4xpages-barcode-reader.120417/#content CameraEx class wraps the Camera object and using reflection and other code it extends its functionality. CameraEx class requires Android 2.3+ and depends on Camera library v2.20+... www.b4x.com But now I'm trying to implement it in a new app and I get a blank screen. I was trying to initialize the camera into a panel in a tabstrip. I thougth this was the problem, so I tried to load into a "normal" layout. Same result. After that, I've tried: - Remove all my classes - Remove everything the in the manifest - Copy the layout of the original sample to my app, blank screen - Copy my layout to the original sample. It works - I've deleted everything in my app to the most simple app, bit It doesn't work. So, I've uploaded my app and I hope someone tells me: "Hey, you're silly, haven't seen this little detail?" Thanks¡ Attachments CVE Orange.zip CVE Orange.zip 122.5 KB · Views: 575
Hi all: I've used CameraEx in another app and the samples work perfectly for me: [Class] CameraEx - Extends the camera library functionality Example based on B4XPages: https://www.b4x.com/android/forum/threads/b4x-b4xpages-barcode-reader.120417/#content CameraEx class wraps the Camera object and using reflection and other code it extends its functionality. CameraEx class requires Android 2.3+ and depends on Camera library v2.20+... www.b4x.com But now I'm trying to implement it in a new app and I get a blank screen. I was trying to initialize the camera into a panel in a tabstrip. I thougth this was the problem, so I tried to load into a "normal" layout. Same result. After that, I've tried: - Remove all my classes - Remove everything the in the manifest - Copy the layout of the original sample to my app, blank screen - Copy my layout to the original sample. It works - I've deleted everything in my app to the most simple app, bit It doesn't work. So, I've uploaded my app and I hope someone tells me: "Hey, you're silly, haven't seen this little detail?" Thanks¡
KZero Active Member Licensed User Longtime User Mar 26, 2020 #2 you didn't add Camera_Ready Event B4X: Sub Camera1_Ready (Success As Boolean) If Success Then camEx.SetJpegQuality(90) camEx.SetContinuousAutoFocus camEx.CommitParameters camEx.StartPreview Log(camEx.GetPreviewSize) Else ToastMessageShow("Cannot open camera.", True) End If End Sub and don't forget to call B4X: Sub Activity_Pause (UserClosed As Boolean) If camEx.IsInitialized Then camEx.Release End If End Sub Upvote 0
you didn't add Camera_Ready Event B4X: Sub Camera1_Ready (Success As Boolean) If Success Then camEx.SetJpegQuality(90) camEx.SetContinuousAutoFocus camEx.CommitParameters camEx.StartPreview Log(camEx.GetPreviewSize) Else ToastMessageShow("Cannot open camera.", True) End If End Sub and don't forget to call B4X: Sub Activity_Pause (UserClosed As Boolean) If camEx.IsInitialized Then camEx.Release End If End Sub
josejad Expert Licensed User Longtime User Mar 26, 2020 #3 OMG¡¡ Thanks again KZero¡¡ I started moving the sample code to a class and I forgot moving that code¡¡ Thanks, four eyes see more than two¡¡ Upvote 0
OMG¡¡ Thanks again KZero¡¡ I started moving the sample code to a class and I forgot moving that code¡¡ Thanks, four eyes see more than two¡¡