[Android Device] Use the camera connected via USB instead of the built-in camera - Android General

Hello experts.
I am a software engineer and currently working on an evaluation module from TI (Texas Instruments). I have a AM5728 Evaluation Module with me and I have successfully compiled Android SDK 5.03 (8.1 Oreo) on it. After compilation, I found that camera app is not working (black screen for a first run and getting crashed on subsequent runs). It seems to me that board is not able to detect the camera device/module even though it is attached to the board. I probably think it is related to camera HAL issue.
However, the USB camera works completely fine when attached to the EVM and is verified using simple usb cam application. The system camera is not being detected at all.
Therefore, I would like to customize Android at a source level and add code to automatically switch the default camera to the one connected by USB when it is available. Or if switching dynamically is not possible then disable the primary (built-in) camera and make USB (external) camera as the default one.
This way all applications should detect the external (USB) camera as the primary camera. For example, if I open camera application then the device take the picture from the one which is connected via USB.
I have the Android SDK source code available with me, but I am not sure how to proceed.
Really appreciate your help.
Thanks!

hey @devashishtiwari.
I am having a similar problem. Did you find a solution. if yes, please contact me at [email protected], its really urgent.

Related

[Completed] Big "lockdown" on an obscure TV box set

Around last June, my family has gotten a TV box set only providing Chinese content, but boy have I had a hard time with this device! Although there is an app store for that box, there aren't that many apps that I can download aside for a few games and other productivity apps. From whatever technical information I could get, here's what I got:
Android version: 4.4.2 KitKat
Model: S8G40
RAM: ? 1GB
Internal Storage: ? 8GB
Connectivity: HDMI (the main output), microSD card slot, USB 3.0, 3.5mm audio-video plug, Ethernet
Input: Remote control (the menu key is seldom used with the custom software), USB devices
CPU: possibly ARMv7
Power source: 12V DC, 1A
While trying to install the select apps, I did get the popup for local APK installation, which tells me that "allow unknown sources" is turned on. There is also neither the Play Store nor other Google programs installed onto that box by default. The built-in app store did tell me the following:
ADB: closed
Root: closed
Without the stock settings app, ADB can't be turned on from the device.
Some popup dialogs I got indicated the set box software is based on AOSP, but none of that was helpful to me.
Moreover, I tried some USB hardware with it, and they work. A USB mouse puts a cursor on a screen, but isn't useful with most of the custom software except the AOSP parts I occasionally saw. A USB keyboard with extra shortcuts worked, with the following buttons working:
Home -> home screen
Volume buttons, including mute
Suspend key -> puts the device to sleep; when powered on again, the full boot cycle is performed
Music -> opens the stock music app, displaying no files even with external storage connected, and the only non-custom app I successfully opened up.
Screenshot keys work; I get a screenshot taken, but it is then impossible to view or delete the screenshot afterwards as they could be stored on the non-accessible internal storage.
USB storage is mounted, and a custom file manager limited to photos, music, and video can be used to access one. This file manager proved useless to me in trying to get outside APKs installed.
USB hubs can attach more than one of these or the following at once to the set box.
I even took the set box apart once, and got to see its hardware (specific hardware can't be listed as there's no way to get an app on there to tell me that info. There seemed to be no hardware button for resetting the device nor a recovery mode. [if needed, I can send images of the hardware]
All in all, that set box IMO is really secure, with JTAG hardware possibly being the only way I can achieve customization and more outside of the intended activities (the set box could also be leased hardware, of which then my family won't own the set box, possibly turning modifications to the set box into forbidden activities). My situation is an obscure one; the company providing the set box is probably not well-known, and that hurts my chances of being able to obtain the ability to customize the device. If nobody can help, I'll simply stay away from such software-limited hardware next time.
Hi,
Thanks for using XDA Assist Kindly post here Android Q&A, Help & Troubleshooting
Good Luck!

Android on W1-810

This is a windows tablet, but I think it would be cool to have this run android as well, so I tried a few emulators running under windows 10, but they are very slow, unstable or didnt run at all. Doid4X, an Nox worked, Andy refused to start).
I kept the Nox App Player, cause that was the one I found most responsive of these.
Perhaps the fact that they barely meets the minimum RAM requirement is a major cause for it being slow.
Then I decided to try the android-x86, which is not an emulator, but an andoid port to x86, and will run natively.
The Lollipop EFI image does work as a live usb media , and I was able to install it to another usb stick, but that got stuck on the aandoid logo when booting. The 4.4r3 EFI image did work better, and was able to install to a second usb stick and boot up into android.
I must say that android-x86 did impress me. It feels quite quick and responsive, and any app I have tried so far does run. Even MineCraft PE works well. The display and touchscreen works well, and volume buttons works.
There are a few driver related issues though, here is a list of some things not working:
- onboard wifi
- onboard Bluetooth
- Sensors (auto rotate will not work)
- Audio out and mic
- Power button
- Battery status
- Camera
I did a few tests, and as a workaround I did use an external usb wifi adapter to get internet working. Also connecting a usb headset with mic did work fine, external keyboard. Also a non branded bluetooth adapter was accepted and the BT icon was enabled, but it didnt find any devices when searching. Even a logitech webcam did work with opencam.
Given the current state of andoid-x86 on this tab, it doesnt make sense to partition the disk to get a dual boot. But if there was working drivers for wifi and audio etc, this could be a decent android system.
Now the android version of the tab 8 looks quite similar to the w1-810, so that makes me wonder how much of the hardware components that are the same. And if it may be possible to get the drivers from the original android to work on android-x86.
I will try to list the hw configuration as I can read from devicemanager/drivers in win10:
wifi: broadcom 4330 / Sound: intel SST audio device / camera: Intel Imaging signal processor 2400 / Bluetooth: BCMBTBUS / Sensors: BMA2x2 ( BMA250E) / Battery control hardware ID is PNP0C0A
Any ideas on how to get these things working would be great.
forum administrators:
I did tag this thread with iconia-tab-8, but for some reason it will not show under "Acer Iconia Tab 8 Discussion" list.
Did I miss something, or doesnt the tag system work properly.
Is there anything I can do to fix this?
I also have this tablet and I am also eager for installing fully functional Android on it. Please guys help us on this. Thanks in advance.
News about Acer Iconia Tab W1-810 with Android
Hi guys, some new about it?

USB Camera as default

Hello,
I have been searching for a long time but still can't find any solution of my problem.
The situation is:
I have raspberry pi3 and i have installed android on it.
Everything works fine, but i need to use camera with raspberry. I know that there is a special camera module available and maybe it works fine but i need to use an external USB camera.
I plugged USB camera and started default camera application, but it says that it's impossible to connect to camera.
But when i've installed USB camera app it works fine with external camera.
I use skype and when i'm trying to make videocall - video is not available.
That is why question appeared.
How is it possible to enforce android to use external USB camera as default?
Sorry for bad english.
Thanks in advance,

A guide on converting smart Android devices into an Android desktop computer - With large screen and extra storage

I remember back in 2011 when I was working at Toshiba in Cyprus that they had a 10 inch Android laptop (no touchscreen), those type of devices seem to have been discontinued. On the same note, I wanted to convert my 2016 Sony Xperia Z5 compact smartphone into a desktop instead of throwing it away after it got dead zone on the touchscreen that keeps on getting worse and makes the device almost useless (The lighter piezo solution did not work for my device).
The 1st method is from videos that are available on Youtube that are not tested by me. The 2nd method is my own way that I tested on two devices. One is Running Android Lollipop 5 and one running Oreo 8. Each one has a different solution because the floating of any app option only works on Android Nougat 7 or above.
Method 1:
The below videos explain about benefit of using the dock. It requires purchasing a Dock and might only work with USB-C devices. There are many more videos available for this subject. The dock will also charge the device while in use. Tips from the 2nd method may improve some features for this method. I did not fully research this method as it can easily be researched by anyone because it is a readymade solution. You can research it further if it interests you to find out if your device will work well with this solution.
Videos on the dock solution
Method 2:
Not tested for gaming
The two devices that I tested this solution on are Sony Xperia Z1 Compact smartphone 2014 model running Android Lollipop and Sony Xperia Z5 Compact smartphone 2016 running Android Oreo Custom ROM. Both devices have been rooted for maximum features. Both devices use micro USB connection so it might work differently with charging for USB-C devices. Results may differ with different devices and different versions of Android but I believe that it will work very similarly to mine.
Flagship devices should work well and should be able to support all the below requirements for this method.
Holder
To have the camera for video chatting or close to the face then you will need a phone / tablet holder like in one of the below links.
https://www.amazon.co.uk/Gritin-Phone-Stand-Adjustable-Holder/dp/B07C3MQYQV
or
https://www.amazon.com/Phone-Holder-Gooseneck-Stand-Recording/dp/B07JM5435F
External Screen
To display the Android device onto an external screen then you will either need a screen that supports screen mirroring or a Miracast device. Miracast include Chrome cast and any other screen mirroring dongles. I tested the method with Anycast version 1 and a Chromecast knock off one, it worked well on both of them. If you get the Error HDCP then it can be solved with an internet search and a rooted device. These devices come with two modes and only one of them will work with your Android device. Mircast uses HDMI and will send the image and the sound to the connected external screen wirelessly. (Compatible with any screen that supports HDMI connection, make sure that your device has screen casting support before purchasing).
If your device does not support screen mirroring, then you will need to purchase an original Chromecast device and connect it to the screen and install Google Home on your device and configure Google Home to detect the Chromecast device to use it. Chromecast will need to be configured in network mode and both devices need to be connected to the same LAN network. (It is possible that not all Android O/S systems can support this function).
Example on connecting VIA Google Home to Chromecast video:
Google Home might also be able to cast to other supported devices. Check the internet for more information on that if needed.
Keyboard and Mouse
For this you will need an OTG cable (OTG cable converts USB to micro USB or to USB-C connection) with a standard USB hub as well as the keyboard and mouse. Or you can also get the OTG hub that is a combo between the OTG cable and the USB hub. USB Wired or wireless keyboard and mouse should work normally.
On some devices the USB mouse and key board need to be connected before the device is turned on. USB mouse and keyboard can also work in TWRP recovery.
It should also be possible to just get the OTG cable with only the wireless keyboard and mouse that need only one USB receiver connection.
If there are issues for the device to detect the Mouse & keyboard then connect them before turning on the device.
On most devices the on screen keyboard will automatically stop appearing while the USB keyboard is attached. This can be controlled from the phone settings options.
If there are issues using the external keyboard then of the apps from the below links should resolve your issue as they are made for the external keyboard.
Null Input Method - Apps on Google Play
Get rid of the soft keyboard when using your bluetooth or USB keyboard.
play.google.com
External Keyboard Helper Pro - Apps on Google Play
Take full control over your external Bluetooth or USB keyboard.
play.google.com
External Keyboard Helper Demo - Apps on Google Play
Take full control over your external Bluetooth or USB keyboard.
play.google.com
USB Storage
I tested this with USB flash drive and external USB drive and worked well with both. It is possible that not all the USB flash drives will work with the Android device. Sandisk did not work well on my devices but other models worked normally.
For USB flash drive. Connecting USB devices one by one might not work well enough. It sometimes will not work unless I connect all the devices to the USB hub and then connect it to the Android device while the device is on.
Connecting the USB external drive might need extra power. So plug the 2nd connection that comes with the external drive into either a USB device charger or a power bank. I recommend using this in all situations to avoid causing damage to the Android device. Connect the drive after the device has already loaded the O/S (The reason is explained under charging section below).
The apps in the below link are the best free app for browsing External USB devices. The app in the 1st link did not detect USB on Lollipop but it worked well on the newer Android O/S and the one in the 2nd link did not open on Oreo. So test both until satisfied. If you get the message that the drive is empty and needs formatting just ignore it and try the below apps.
https://play.google.com/store/apps/details?id=com.mobisystems.fileman&hl=en
http://www.estrongs.com/
Charging: It is not possible to charge and use the USB devices at the same time even if all are still connected (might not apply to USB-C Android devices, I don’t have one to test that on.) Connect the External USB drive that is using external power after the device is already on because it might start charging the device when the power is connected and if that happens then it will ignore the connected USB devices. It is an either or situation. Some devices have a 2nd way to charge the device, like a 2nd USB port or Qi charging (wireless charging). I was able to keep the Z1 compact charged with the 2nd option that it has.
Alternative all wireless connections
Android devices can handle 2-5 Bluetooth Devices simultaneously.
So it it possible to connect Bluetooth keyboard and mouse. Bluetooth or Wireless storage device. This will allow to keep the phone charged while it is using all the external devices.
Printing
To be able to print from your phone then you will need to use the below option
The below video will show how to print from specific printers:
Print photos from Google photos App:
Google Photos - Apps on Google Play
The home for your memories. Relive, share, and organize your photos.
play.google.com
Create and print Documents from WPS App:
WPS Office-PDF,Word,Excel,PPT - Apps on Google Play
PDF, Word, Excel, PowerPoint, Form & Notes, powerful as Microsoft Office.
play.google.com
Apps for desktop mode
There are many available in the play store but I found the below to be the best amongst them.
SecondScreen - better screen mirroring for Android
SecondScreen App from the below link needs either a rooted device or an ADB command. The ADB command will appear after installing the app and loading the profile. Multiple profiles can be created with this app. This app has several features. Some of the features include changing the resolution and density of the screen as well as reducing screen backlight. The lower the density the higher resolution will be which is to fit more things on the screen. The device might do a soft reboot when loading and unloading the profile.
https://play.google.com/store/apps/details?id=com.farmerbb.secondscreen.free&hl=en
Taskbar
The below app is only useful on Android Nougat 7 and above because it has a feature that is called freeform that allows to float any app when it is launched from this app for multitasking. It is made by the same developers that created Secondscreen and has a feature in the Secondscreen app to auto launch when the profile is loaded.
Set this app as default launcher. It does not have an option to minimize the apps to taskbar. To restore apps to freeform after being maximized then go to recent apps and click on the 1st icon on the left.
https://play.google.com/store/apps/details?id=com.farmerbb.taskbar&hl=en
For Lollipop 5 & Marshmallow 6 devices. Use the app in the below link It works on newer Android devices as well. It will creates a landscape desktop with a taskbar and launcher. It comes with its own set of apps and more apps can be added from the 2nd link which contain the additional apps. Only the apps that are provided with this program can float and to open multiple apps on the desktop at the same time.
This app will lock the screen in Landscape mode. To get out of this mode you will have to turn off the features that are turned on during the setup process. You might also need to force stop the app. That can be done from settings or by installing a specific app for that like the one in the below link.
KillApps : Close all apps running
KillApps - Close all apps - Apps on Google Play
Close all apps running in background
play.google.com
Sentio Desktop
https://play.google.com/store/apps/details?id=com.andromium.os
Sentio Apps (Lollipop, Marshmallow)
https://play.google.com/store/apps/details?id=com.sentio.apps
The below link is from the same developer and made for newer Android devices to float any app for Nougat 7 or above but it did not work for me so you can try it if you want to.
Sentio Desktop
https://play.google.com/store/apps/details?id=com.sentio.desktop
Hanna Baggili (John)
Hey. I've been working on the same goals for years now. I see you used Sentio desktop app for the desktop experience. However, Sentio seems to have gone under. Their app store entry is gone, and their website doesn't function.
What would be your best alternatives for a desktop environment setup, SW & HW? If I want a large display, I prefer to Miracast to a compatible device.
It's 2022. What would be your setup now. FWIW, I use and *older* LG V20 running Android 8, which is almost perfect for me (albeit not 'waterproof'). I have desire to upgrade to newer phones, with much more invasive versions of Android, tracking everyone and everything. Plus, screen casting (Miracast) isn't crippled as it now is in newer versions of Android.
Your choices?
I did not use all the apps for my setup that are in the guide. The provided solution is a general solution that I tested and works well.
Any app that is no longer in the Google play store can still be found online, in other non-official app store.
I did not test the solution for the later versions of Android.
From my own experience I found that the best Android version for the Android Desktop PC is Android 7.
What version of Android did you try your solutions on?
You can always check if there is a docking station for the phone that you want to use as a desktop. Take a look at YouTube videos in regards to that and consider it for your setup.
I did the conversion because I am an IT guy and lost the use of my phone. So I then converted it to a desktop and for the fun of it. I tested it on the older model that I have.

Android UVC/USB Camera Replacement

Hello everyone -- I'm wondering if anyone has any experience replacing a built-in front-facing camera on any android device with a UVC/USB webcam. What I want to do is build a custom app that works on a regular android phone where I can use the camera1 or camera2 apis to get access to camera data from a USB webcam I have. I of course know that on this site there are many guides for replacing cameras on various android devices using manufactured replacements (sometimes non-OEM), but I am trying to figure out if there is any android device and some sort of adapter where I could plug into the front-facing cameras MIPI/CSI port but have it be able to plug into some kind of webcam/uvc/usb signal. It would be pretty sweet if you could plug in "arbtrary" webcams that support UVC and have an Android phone read this as a normal camera signal that could be processed with the Android Camera APIs!

Categories

Resources