Access USB camera Xamarin.Android - android

I'm developing a Xamarin.Android project and I need to get the video flow from the usb camera attached to the android device for the test. Now, I'm using Camera2 API from the Android Open Source project to access each camera frame, but the API with the call to:
CameraManager manager =
(CameraManager)Android.App.Application.Context.GetSystemService(Context.CameraService);
foreach (string cameraId in manager.GetCameraIdList()){
Console.WriteLine(cameraId);
}
doesn't return the USB camera attached to the device. I've tryed this[1] app to serach the USB camera and the device found it correctly.
Is that I fall to search for available device with the call to CameraManger.GetCameraIdList()?
Thanks.
[1]: https://play.google.com/store/apps/details?id=com.shenyaocn.android.usbcamera

Related

How can I disable ARCore logs for Android?

ArCore spams each frame the following error before it detects surfaces (trackables)
=== Source Location Trace: ===
third_party/arcore/ar/perception/feature_track_ml_depth_provider_utils.cc:402
third_party/arcore/ar/perception/feature_track_ml_depth_provider.cc:209
E0000 00:00:1675437554.648981 30783 motion_tracking_context.cc:1879] NOT_FOUND: Not able to find any depth measurements on feature measurements at timestamp 28971862451376
or
E0000 00:00:1675437708.212223 30553 hit_test.cc:428] INTERNAL: No
point hit.
How can I disable such logs?
You must follow these steps to disable ARCore API call logging:
Open the AR experience in your app so that there is an active ARCore session running. Your app must be in AR mode to receive the broadcast that disables logging. The AR camera preview images should be visible on the device screen.
Then use the following adb command to disable call logging for your app:
adb shell am broadcast -a com.google.ar.core.DISABLE_API_CALL_LOGGING

Zebra Datawedge 6.2.24 enable/disable not working on Zebra TC75

I am trying to get zebra data wedge to enable /disable sample ( https://github.com/darryncampbell/DataWedge-Quick-Suspend-Scanner ) working on zebra TC 75 scanner handset having android version 5.1.1
data wedge version on Zebra TC75 handset is 6.2.24 ( original data wedge version 5.0.17 upgraded to version 6.2.24 by using check system updates). create profile API does not work, so I manually created a profile named "DW Quick Suspend Profile" and enabled this profile. the app is added to associated apps, the barcode input option is checked intent output option is checked. Intent action is specified as com. Darren Campbell.datawedgequicksuspendscanner.action and intent category is specified as android.intent.category.DEFAULT. Broadcast intent is selected for the intended delivery spinner.
but zebra TC75 does send status updates or enable/disable data wedge does not work.
whether anyone got data wedge to enable/disable API or sample code at https://github.com/darryncampbell/DataWedge-Quick-Suspend-Scanner working on Zebra TC 75? if yes what configuration needs to be changed
App author here, the reason SUSPEND_PLUGIN and RESUME_PLUGIN are not working for you is that they are not supported in DataWedge 6.2. DW 6.2 documentation is here: https://techdocs.zebra.com/datawedge/6-2/guide/api/#scannerinputplugin and only shows ENABLE_PLUGIN and DISABLE_PLUGIN as supported.

RhoMobile on TC52, Android 8.1: "DS8178 Bluetooth Scanner is not connected ..."

I am trying to get an existing RhoMobile APK running on a TC52, Android 8.1.
The App is running fine on TC51, Android 6. On the TC52, when i start the app I get a toast message
DS8178 Bluetooth Scanner is not connected, therefor BTPairing Utility will be started.
The problem is that - ignoring the BTPairing Utility App (i also tried to disable it) - i cant use the build in scanner in my rho mobile app. When I try to use it I see the following message in the log
"The decodeSound barcode property can only be set once the scanner has finished initialising"
Looking at the underlying code, it looks like that the scanner has not initialised, probably due to not be able to pair the bluetooth scanner. But there is now such scanner and there never will be. Anybody know how to disable this behaviour?
Edit 1:
Here is my javascript code for enabling the scanner
Rho.Barcode.enable({ allDecoders: true }, this.onScan);
But, I think it happens before that javascript is accessed; the app is hosted on web server; even if i disable WIFI and starting the app, the toast is displayed. It seems like that RhoMobile is trying to setup all known scanners.
Edit 2:
When I enumerate all scanners, i get those in this order
Scanners found: '[
"Camera Scanner",
"2D Barcode Imager",
"Bluetooth Scanner",
"RS6000 Bluetooth Scanner",
"DS3678 Bluetooth Scanner",
"LI3678 Bluetooth Scanner",
"DS2278 Bluetooth Scanner",
"DS8178 Bluetooth Scanner"]'
Default scanner: '2D Barcode Imager'
Default scanner is determined by
Rho.Barcode.getProperty("friendlyName");
Edit 3:
Ok, as suggested in the comments, using the actual instance returned from the enumeration works; triggering scanner buttons works well.
What remains is the toast that asks to connect the DS8178 Bluetooth Scanner; is there a way to disable scanners from config.xml?
This error:
DS8178 Bluetooth Scanner is not connected, therefor BTPairing Utility will be started.
Is not coming from RhoMobile, it is being generated from the low level scanning framework. I checked on a more up to date device and I'm glad to say they fixed the spelling error. It is caused when something (either EMDK or DataWedge) tries to enable the DS8178 scanner. The DS scanner support was only added in a recent version of the mobile computing scanner framework so that probably explains the difference in behaviour you are seeing between TC51 and TC52.
RhoMobile (on Zebra Android devices) wraps the EMDK and exposes each supported scanner as a separate Barcode object and you can see all of these in the array returned from enumerate. What is strange is that, per your second edit, the default scanner is '2D Barcode Imager'.
There are a few options / possibilities:
There is a bug in the RhoMobile framework and for some reason the DS8178 scanner is being enabled. I checked https://github.com/rhomobile/rhodes/tree/master/lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode and cannot see any such bug. Rho is open source but supported by Tau-Technologies if you wanted to explore that route.
Something else on your device is enabling the DS8178 scanner, e.g. a DataWedge profile or other app using the EMDK. You could disable DataWedge (from the DataWedge app settings) and reboot your device to test this.
There is an issue with the TC52. I would say this is the least likely as I have never heard of a similar issue
There is no way to disable any of the scanners via XML

android.hardware.display.DisplayManager.getDisplays() is not returning the external monitor connected to chromebook

I am working on Acer Chromebook R11. The Android version of Chromebook is 7.1.1. The external monitor is connected via HDMI port on Chromebook. OS is showing both the displays and am able to drag the apps from one window to another window.
I want my app to display on both the screens. While querying for the displays, android display manager is returning only the default display information. The external monitor information is not present with the displaymanager.
import android.hardware.display.DisplayManager;
..
..
DisplayManager displayManager = (DisplayManager) getApplicationContext().getSystemService(Context.DISPLAY_SERVICE);
Display[] var1 = displayManager.getDisplays();
Display[] var2 = displayManager.getDisplays( DisplayManager.DISPLAY_CATEGORY_PRESENTATION);
var1 is always having the default built-in screen information. I am expecting it to have information about the two displays.
var2 is always null.
Is there any issue with this API on Chromebook?
This api is working after I updated the OS on chromebook via beta channel.

How can I share screen to another device base on WiFi direct connection

I want to develop an AP to share (SOURCE) screen to another (SINK) device by using WiFi direct connection.
I successfully connect two devices via Wifi direct API but getPresentationDisplay() returns null. It seems SOURCE device does not find any additional display service exported by SINK device. Does API level 4.2.2 support it? Or is any API that I can register the display service to SOURCE?
//Get Media router service
mMediaRouter = (MediaRouter) getSystemService(Context.MEDIA_ROUTER_SERVICE);
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
if (route != null) {
Display presentationDisplay = route.getPresentationDisplay();
if (presentationDisplay != null) {
Presentation presentation = new DemoPresentation(this, presentationDisplay);
Log.i("tracer", "presentation.show();");
presentation.show();
}
}
I'm author if CatVision.io - an screen share software component for Android applications. The source code relevant to a media projection (basically a screen of the device) is here: https://github.com/TeskaLabs/CatVision-io-SDK-Android/blob/master/cvio/src/main/java/com/teskalabs/cvio/CatVision.java
It depends on the device that you are trying to connect to. Android by default does not act as a Miracast/ Wireless Display Sink.
To be able to achieve Android - Android wireless display sharing, refer to Miracast Sink support for android - HowTo

Categories

Resources