How can I use webcam camera in android emulator? - android

I would like to use my webcam in the android camera.
I've checked out this stack overflow post: Android: How to use webcam in emulator? but when I complete the steps in the accepted answer...
I keep getting the error, "Camera keeps crashing."
In my Manifest file, I've declared the following permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera2.full" />
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera2.front"/>
Any idea why the camera keeps crashing?
Thanks!!

After doing lots of research,
I found out that android simply required a reboot. If this doesn't work for anyone else, try deleting your emulator and re-installing it.

Related

Play console does not consider uses-feature -> required="false" in manifest for android app bundle

I am trying to publish app bundle on play store. It shows wifi only tablet not supported because of android.hardware.telephony feature. I set this feature's required flag to false. But still play console shows the same error in device catalogue. Any idea why it is showing an error as not supported device samsung galaxy A7 lite (wifi only)?
I am checking this problem in a following way: I upload app bundle then I save it. Before publishing I go to device catalogue to check the supported devices for the same app bundle. And there I see an error.
My AndroidManifest permissions and features:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:name="android.hardware.camera"
android:required="false"
tools:node="replace"/>
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false"
tools:node="replace"/>
<uses-feature
android:name="android.hardware.telephony"
android:required="false"
tools:node="replace"/>
Merged manifest:
Play console error:
Doesn't support required feature: android.hardware.telephony
This issue is solved. For others I am putting an answer here. It's funny that I just ignored that device catalogue for the saved release and rolled it out directly. That manifest changes started working for the release and play console started showing supported for the device which was unsupported previously. :)

Mobile antivirus app classifies my app as a "potentially unwanted program"

AVG Antivirus says that my app is a potentially unwanted program. On reading more, it says that:
"No potential malware has been detected for this android app for the
last 7 days. However, active adware was detected".
What can be the probable reasons for this?
Snippets of the Manifest:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-feature android:name="android.hardware.location.gps" />


android custom camera crash with fail to connect to camera service

Sorry if my Question is kind of noob, just beginning to delve into Android prog. I tried to run the custom camera code taken from github
However, the app crash upon run. Logcat: java.lang.RuntimeException: Fail to connect to camera service indicates that it is due to the camera permission. I already added the camera permission in the android manifest file before, it is still showing same error.
I added permission in the android manifest as shown below;
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CALL_PHONE" />
Any clue?
Thanks in advance.

Fail to connect to camera service android.hardware.Camera.open

There are many questions similar to this, but still I am facing this issue.
Camera is working, when my app launch from application. But When I relaunching the app (through Intent Service) I am getting following errors.
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.native_setup(Native Method)
at android.hardware.Camera.<init>(Camera.java:410)
at android.hardware.Camera.open(Camera.java:365)
And I tried with these cases like camera.release(); in onResume. But Still I am getting errors.
In Manifest file I specified the permissions. The Permissions are as follows.
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.front"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-permission android:name="android.permission.CAMERA" />
I have the exact same error, with the same permissions as you in my Manifest file. So far, I have found that if I build my app with
android:targetSdkVersion="23"
I get the aforementioned error in Android Marshmallow devices, while if I build my app with targetSdkVersion less than 23 everything works as expected. I am still troubleshooting it, so in case I get anything more I will post an update.
Hope it helps.

application requires feature(s) not available on your device

I have an Android application on Android Market, but some users are complaining about an error shown when the installation starts, just after the download:
One of them sent me a video of this error showing up, and I could see that this error is not caused by the application, but probably in the verification of permission/features process.
As far as I know, this error is just happening on Motorola Droid/Milestone devices running Eclair, it doesn't happen with Froyo. Unfortunately, I don't have access to any device like this one in order to run logcat and check what's going on.
Here are my permission/features on AndroidManifest.xml:
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.location" />
<uses-feature android:name="android.hardware.telephony" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I finally found out what's happening by getting a Droid device and running logcat:
E/PackageManager( 1280): Package com.mycompany.myapp requires unavailable feature android.hardware.telephony; failing!
Motorola Droid devices running Eclair are not able to install applications that declare
<uses-feature android:name="android.hardware.telephony" />
in their manifest. It's very strange, though, because the Android Market should hide it from these devices. This is probably a bug caused by the changes made to the Eclair by Motorola, since it doesn't happen with other devices running Eclair, neither with the same Droid running Froyo.
According to the docs:
Android Market attempts to discover an application's implied feature
requirements by examining other elements declared in the manifest
file, specifically, <uses-permission> elements.
Given that, have you tried removing the uses-feature tags? Since those are implied by the uses-permissions tags, and you aren't using the "android:required" attribute.
The device say " this feature is not available in this device " when I'm installing an app downloaded from play store and i have to give it permission

Categories

Resources