Android Question Class module - Create MediaRecorder lib with reflection?

Jim Brown

Active Member
Licensed User
Hi folks,
I want to write a library for MediaRecorder and my plan is to use a class module and Reflection.
While I know that RSVideoRecorder libray exists it is lacking a fundamental command.
Also, I want my app to trigger recording directly and not jump out of the application so the VideoRecordApp option from the audio library is also a non-starter.

Problem is, I don't know how to properly get started. If anyone can set the ball rolling in terms of initialising then I should be able to pick up the rest.

MediaRecorder library

My initial tests are failing, with a "java.lang.RuntimeException: setAudioSource failed."

Also, I don't know how call setCamera (Camera c)

The docs indicate that I should use Camera2 but looking around I assume this is not yet supported in B4a?

A basic snippet of my code so far. I am thinking of using the CameraEx library as a reference and bringing MediaRecorder into it.

Sub Class_Globals
   Private r As Reflector
   Private target As Object
   Private event As String
   Private mr As Object
End Sub

Public Sub Initialize (Panel1 As Panel, TargetModule As Object, EventName As String)
End Sub

Public Sub SetAudioSource(source As Int)
End Sub

Jim Brown

Active Member
Licensed User
Hi Mashiane, sorry I have not touched b4a for a while. When I get a chance I'll look at what I did before.
Upvote 0