Android Question Trigger capture command or Volume Down Button for Camera

Discussion in 'Android Questions' started by ElliotHC, Aug 7, 2019.

  1. ElliotHC

    ElliotHC Active Member Licensed User

    I need to trigger the built in camera on the Samsung Galaxy. I am currently using some hardware and the Mic/resistor switching method but I'd like to run an app in the background instead.

    Does anyone know if it's as simple as putting the volume down?
     
  2. Brandsum

    Brandsum Active Member Licensed User

    I dont think you can intercept an keypress event from background. All you can do is you can built an app with camera functionalities and on vol down event you can call capture method.
     
  3. ElliotHC

    ElliotHC Active Member Licensed User

    I need to use one of the video modes built in to the camera.
     
  4. MarkusR

    MarkusR Well-Known Member Licensed User

    at first i would look if you can start (trigger) your camera app by intent and then i would think about the volume key.
     
    ElliotHC likes this.
  5. ElliotHC

    ElliotHC Active Member Licensed User

    Can I tap the display somewhere from the background? Basically, I need to open the built in camera and take a slow motion video clip.. No B4A projects are going to cut it unless they can take a 960fps
     
  6. Brandsum

    Brandsum Active Member Licensed User

    Ok I will try to post a slow motion video example tomorrow.
     
    ElliotHC likes this.
  7. MarkusR

    MarkusR Well-Known Member Licensed User

    you can start something from a notification that is fixed at the top from a foreground service of your app.

    you need to know which data is expected in the intent that you can control your camera app.

    https://www.b4x.com/android/help/core.html#intent

    using your own app for capture video is also ok but the idea at android is that apps can working together.
     
  8. ElliotHC

    ElliotHC Active Member Licensed User

    I will be quite impressed if you can get the camera to take a 500-750ms video at 960fps. The Galaxy camera is constantly filming maybe 500ms before to capture the event. I need +/- 500ms from the trigger point. Still think you can make that work with B4A?
     
  9. Brandsum

    Brandsum Active Member Licensed User

    Sorry I didn't understand what you mean. Do you want to capture a 500ms video in 960fps? Or you want to record 500ms frames before you press capture button? And its not about the IDE but the platform. If its possible in Android then you can do it in B4A. Its an IDE.
     
  10. moster67

    moster67 Expert Licensed User

    You could try with Accessibility Services:
    https://www.b4x.com/android/forum/t...th-disabilities-automation-etc.95216/#content
    There are some Perform Actions included and shown in the sample which can simulate taps from a service.
    If you are unable to do it yourself, then I have built many custom solutions for B4X users who have had similar requirements, especially non-standard and edge-cases.
    Just send me a PM if you are interested.
     
    DonManfred and Brandsum like this.
  11. Brandsum

    Brandsum Active Member Licensed User

    The slow motion video example is done. I will upload that after checking on some devices.
     
    José J. Aguilar and MarkusR like this.
  12. Brandsum

    Brandsum Active Member Licensed User

    Last edited: Aug 8, 2019
    José J. Aguilar and Erel like this.
  13. ElliotHC

    ElliotHC Active Member Licensed User

    I'll give it a whirl on my galaxy!
     
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