Intent for getting a USB attached Camera take photo

Shaykid

New member
Hello
I have a USB camera attached to my android device
I would like (probably by intent) to take a photo from this camera
(I tried to use USB Camera app that supports these intents)
1683458538622.png

Can anyone help me in how the intent syntax should look in macrodroid ?
Or
any other way to take an image from USB attached camera, and have the final image in a folder
macrodroid can access ?

Thanx in advance
 

Shaykid

New member
Thanx for that, its very informative and helpful.
Currently in USB CAMERA app i can only open the app, I want to make the app take photo
I can ui interact the photo button, but i wanted to use a more elegant way (like intent)
Do you have any idea how to do that ?
Best,
 

MacroDroidDev

Administrator
Staff member
It depends what the USB camera app supports in terms of interfaces such as intents. This is not really a MacroDroid issue as you will need to investigate that app to see if it exposes any way to do it.
 

Shaykid

New member
I got a few solutions

like:
  1. Open the MacroDroid app on your Android device and create a new macro.
  2. Name the macro and choose a trigger that will activate the macro (e.g., "Shake device").
  3. Add an action by clicking the "+" button and choosing "Launch an activity".
  4. In the "Action" field, enter "android.media.action.IMAGE_CAPTURE".
  5. In the "Extra Name" field, enter "output".
  6. In the "Extra Value" field, enter the file path and name where you want to save the image (e.g., "/storage/emulated/0/DCIM/Camera/photo.jpg").
  7. In the "Package" field, enter "com.ulongsoft.usbcamera".
  8. Save the action and the macro.
My package is com.shneyaocn.android.usbcamera.
the only class i find is .mainActivity

for this I got error no activity found to handle (act = android.media.action.IMAGE_CAPTURE) pkg = com.shneyaocn.android.usbcamera)
so I reckon app does not support the image capture action

so i tried
  1. Find the "Launch Activity" action to open the USB CAMERA app.
  2. Add a new action by tapping the "+" button and selecting "Intent".
  3. In the "Action" field, enter the value com.shneyaocn.android.usbcamera.CAMERA_SERVICE.
  4. In the "Package" field, enter the value com.shneyaocn.android.usbcamera.
  5. In the "Class" field, enter the value com.shneyaocn.android.usbcamera.MainActivity.
  6. In the "Extra Data" section, add a new entry with the key command and the value takePicture.
looks like the app i use doesnt support takePicture.
I tested like a dozen USB Camera apps from play, non works with these systems.
OR do I write something wrong in MacroDroid ?

Thanx in advance.
 

Shaykid

New member
Check this:
there is a class in the app called intent receiver
the issue is how i know what syntax it expects ?

anyone know on some android app the shows the user which class/package/intent is being used currently ?

1683618983908.png
 

HCC

Member
To find the syntax you need to do the following:

1) download a systemviewer-app, ( e.g. com.liuzh.deviceinfo ) in playstore.
2) then go to the Tab : APPS
3) search for: com.shenyaocn.android.usbcamera (it's the "USB Camera" PackageName)
4) in the menu (the three vertical dots) choose : show AndroidManifest.xml
5) download it (the download folder is : storage/emulated/0/Download)
6) open it (e.g. with Notepad) and search for: intent
-Now you will find something like:
android.intent.action.MEDIA_BUTTON
-Now you have the syntax to take a photo by Send Intent.
 

HCC

Member
1 attachment :
manifest_com.shenyaocn.android.usbcamera_302.xml.txt (size . 7 kB)
(the attached manifest is from: "USB Camera" version 10.0.2,
the new "USB Camera" version 10.7.9 from May 4, 2023 is available in playstore or apkpure.com)
 

Attachments

  • manifest_com.shenyaocn.android.usbcamera_302.xml.txt
    6.1 KB · Views: 4
Last edited:

Dimlos

Well-known member
Although not an intent, this app can be operated with Notification Interaction as notifications are sent out behind the scenes.
 

Attachments

  • Notification.jpg
    Notification.jpg
    152.2 KB · Views: 4
  • Macro.jpg
    Macro.jpg
    327.1 KB · Views: 3

Shaykid

New member
1 attachment :
manifest_com.shenyaocn.android.usbcamera_302.xml.txt (size . 7 kB)
(the attached manifest is from: "USB Camera" version 10.0.2,
the new "USB Camera" version 10.7.9 from May 4, 2023 is available in playstore or apkpure.com)
Thanx a LOT.
This is very helpful
 
Top