Android Question Trigger capture command or Volume Down Button for Camera

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?
 

Brandsum

Well-Known 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.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

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
 
Upvote 0

Brandsum

Well-Known 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
Ok I will try to post a slow motion video example tomorrow.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

ElliotHC

Active Member
Licensed User
Ok I will try to post a slow motion video example tomorrow.
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?
 
Upvote 0

Brandsum

Well-Known 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.
 
Upvote 0

moster67

Expert
Licensed User
Longtime 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
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.
 
Upvote 0
Top