B4A Library B4A ScreenRecorder/ScreenShots

Discussion in 'Additional libraries, classes and official updates' started by moster67, Sep 24, 2016.

  1. moster67

    moster67 Expert Licensed User

    B4A ScreenRecorder - version 0.7 (25/09/2016)

    Here is a wrapper/library which lets you record the screen and save it as a video file.

    It is using MediaProjection which is available from API 21 (Lollipop) and will not work on earlier versions of Android.

    It is based on this Github-project. Kudos to the original author.

    See next post for events and methods.

    I am attaching a sample project along with the library.

    Edit: The free version posted here is OK for screen-recording. There is also a more advanced version of this library which enables screen-recording with audio and capturing screenshots. The advanced version of this library is still a work in progress but users who have bought it are already using it in their apps. At this point of development, the price is EUR 15,00 for the advanced version but it will probably be more when it's ready.
    Send me a PM (start a conversation) if you are interested.

    Some basic stuff to remember:
    1) you need at least Lollipop to get this to work. The library uses MediaProjection which was introduced with SDK 21.
    2) You cannot use it for a spy-app. When users run your app and the code in your app which triggers the screen-capturing (recording or screenshots), users have to give permission. Of course, users can tell Android System not to ask for permission anymore and then no more permission will be asked.
    3) some apps, such as Telegram, can block MediaProjection and thus capturing/recording of the screen is not possible.


    Please remember that creating libraries and maintaining them takes time and so does supporting them. Please consider a donation if you use my free libraries as this will surely help keeping me motivated. Thank you!
     

    Attached Files:

    Last edited: Feb 22, 2017
  2. moster67

    moster67 Expert Licensed User

    B4A ScreenRecorder - version 0.7 (25/09/2016)

    ScreenRecorder
    Author:
    moster67/Mikael Osterhed
    Version: 0.7
    • ScreenRecorder
      Events:
      • Result (Grant As Boolean)
      Methods:
      • GetPermission
        Call GetPermission() to let user grant permission.
        Check the Result-event if the user granted the app permission to record
        or not. If the Grant-value is true, permission was granted.
      • Initialize (EventName As String)
        Initializes B4A ScreenRecorder. Make sure to add an EventName since
        it is needed for the GetPermission method.
        Usage of Wrapper:
        Call GetPermission() and then check the Result-event if the user
        granted the app permission to record or not. If the Grant-value is true,
        permission was granted and you can call StartRecording to begin recording.
        To stop recording call StopRecording. Recordings are encapsulated in
        the mp4 container format and can become very large. You should save
        the video on the SD-card.
      • IsInitialized As Boolean
      • StartRecording (width As Int, height As Int, dirPath As String, fileName As String)
        Call StartRecording() to begin recording. You can set video size using
        Width and Height and you can set your own values. However, the real screen sizes
        are suggested (use B4A method GetDeviceLayoutValues). Finally, you need to pass on
        the directory where you want to save the video (sd-card is highly recommended due to size)
        and the file-name. The wrapper does not verify if the file is already existing or not
        and you need to do that yourself.
        Note: Recordings are encapsulated in the mp4 container format and the Wrapper adds
        automatically the mp4-extension to the fileName-parameter.
        Example usage:
        rec.StartRecording(GetDeviceLayoutValues.Width, GetDeviceLayoutValues.Height, File.DirRootExternal, "rec1")
      • StopRecording
        Call StopRecording() to stop recording.

     
  3. tuhatinhvn

    tuhatinhvn Active Member Licensed User

    thank for your lib, but can it record audio when record screen??
     
  4. tuhatinhvn

    tuhatinhvn Active Member Licensed User

    and about donate , can you give your link paypal?
     
    DonManfred likes this.
  5. moster67

    moster67 Expert Licensed User

    Currently it does not support audio but I will be working on an enhanced wrapper which hopefully will permit recording of audio too and taking single screenshots...
     
  6. moster67

    moster67 Expert Licensed User

    If you click on the donation link in my signature you can donate using Paypal.
     
    DonManfred likes this.
  7. ArtemisPrime

    ArtemisPrime Member Licensed User

    Looking forward to your work my friend, thank you.
     
  8. Rantor777

    Rantor777 Member Licensed User

  9. cambopad

    cambopad Active Member Licensed User

    I do appreciate for your effort! Will you accept donation via BitCoin besides PayPal? I want to donate you!
     
  10. artemis

    artemis Member Licensed User

    Hi Moster! By any chance have you been able to make any progress on your library? I'm looking very much forward to it!

    Thanks for all of your hard work!
     
  11. cambopad

    cambopad Active Member Licensed User

    Dear Moster!
    I already tested this lib, and it works like a charm!

    Can you improve this lib to be able to record audio and take single screenshot? I think many people here are waiting for you including me :D
     
  12. moster67

    moster67 Expert Licensed User

    Well, audio and screenshots are now working. I only need time to wrap them up (pun intended)...
     
  13. cambopad

    cambopad Active Member Licensed User

    Nice to hear that! Can't wait to test it!
     
  14. artemis

    artemis Member Licensed User

    You're awesome man! Can't wait to use it!
     
  15. artemis

    artemis Member Licensed User

    Moster, have you been able to make any progress on the wrapper?
     
  16. moster67

    moster67 Expert Licensed User

    It will be released in the next days.
     
  17. artemis

    artemis Member Licensed User

    Hi Moster, I was wondering if there was any update on your library? I'm pretty close to finishing my app and all that it's missing is your ability to take screenshots, or rather what I really need is just the screen in a bmp object.

    Thanks!
     
  18. tuhatinhvn

    tuhatinhvn Active Member Licensed User

    any new update now???
     
  19. artemis

    artemis Member Licensed User

    Hi Moster, have there been any progress by any chance?
     
  20. moster67

    moster67 Expert Licensed User

    Yes, it is already finished (actually been so for quite some time). I am using it in an app I am developing and I will make it available once I have published the app. Just some more patience - it should be a matter of only a few days, maybe even earlier. Sorry for the delay.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice