Using audio recorder at android simulator - android

I want to use an audio capture feature at my app. I followed this link at developer.android.com.
I'm using Android Studio 1.4 and a Nexus 5 with Api21 as virtual device. At developer.android it is descripted that it's not possible to use the audio capture feature with an simulator:
Note: The Android Emulator does not have the ability to capture audio, but actual devices are likely to provide these capabilities.
But is this an information that is up to date? I'm able to use the record button but the activity crashes after pressing stop. I can see the audiorecordtest.3gp file on the simulated device and if I save it to my computer I can play my recorded audio. The crash comes without any shown exception. If I ask for
context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_MICROPHONE);
I got back a true. It seems like the simulator is able to capture audio but can't handle correctly the stopping of it? Is there a way to get around?

One aspect of Tamper Checking involves testing for an Emulator running your app...
In THIS article (Paragraph 4.1), Emulator detection is described... The tests detect many emulators, but throw some "false positives", depending on the device.
False positives render some emulator test's, described in the article, not appropriate for production, but are fine in a test environment where you know your devices and their test responses.

Related

Webrtc with openvidu device already in use when it’s not

Having a strange issue on one android phone for a website using openvidu for streaming.
There is a switch camera function which alternates between front and back cameras. This is accomplished by getting all the available devices say on the back and selecting the last one in the array and then publishing the stream to that device.
I’ve tested this on windows, mac, multiple iPhones in safari and chrome and multiple android phones in chrome and works perfectly.
However one android phone is behaving strange that when switching to the environment camera it says that the device is already in use, but it can’t be in use, the phone literally rebooted and no other app loaded and activated the camera.
Not sure why this is happening? I was thinking maybe the code should stop each device before the switch happens? But why would it say it’s in use when it’s not?
Update
After some investigation this seems like an annoying issue with huawei phones where one of the back cameras has the same device Id as the hands free audio input device, so when my code is selecting a back camera that works everywhere else it thinks it’s in use due to the id being used by the audio input.
So it looks like the only way around this is to bypass the selection of this particular camera if it’s id is the same as an audio input device and select a different back camera instead. Annoying!
Update 2
Actually it seems a bit more than this, the phone has 3 back cameras but 4 devices show up as video input, it looks like there is a bug on the device where it thinks the audio input is the same as the video input so it’s adding an additional camera to the device list, unless this is because somehow on that phone the hands free device includes a camera. Really odd
Update 3
The phone is a p20 pro and I also noticed it actually has 2 audio input that share 2 video input device id instead of all being unique which then causes another problem when try to use a different video device id.

Is the Sony Android camera API supported for all Android versions?

I'm wondering if the Sony Camera API has parts that are only supported by certain versions of Android.
I have the latest firmware (1.04) on my a6500 and running Android 7 on LineageOS (successor of CyanogenMod) for the Samsung S5 (KLTE version). This is what I get in my Play Memories app:
The shutter button works and images download to the phone. But that's it.
Additionally, when I use another app called DSLRDashboard, the settings show up and can be changed on the app, but they don't get changed or applied on the camera, and this is in full manual mode on the camera. Other modes don't work either.
What could be causing this? What would need to be added into a 3rd party ROM like LineageOS to get this working?
Really hoping that the official Sony developers that roam this site will be able to chime in.
So, a bit of a snafu on my part.
It's not enough to update just the firmware on the Sony camera. The Remote Control app installed in the camera must also be updated as well, which means hooking the camera up to WiFi and downloading the updates for that app. With that done, all the settings appear in the phone app and can the changed.

Endoscope app USB DEVICE DETACHED when open LED light?

I've developed an Android App Supports Endoscope using library UVCCamera.
Everything working properly but when using the camera with LED Light, a moment later the camera will disconnect and show the message "USB DEVICE DETACHED". This error also cannot find and not show in log console.
When I tested the app with similar apps in the Google Play (CameraFi, UsbWebCamera), I also found the same problem.
Any suggestion about this?
This link is video I recorded. https://www.youtube.com/watch?v=BkXbZo6AO8c
I using Samsung Note 2 and Redmi2 in test.
Thank you.

Cordova Media Capture Android error no.3 issue

I am currently developing a mobile application that is all about very short sound recordings and for the time sake I decided to build it with Cordova (not Phonegap). Unfortunately today I have been fighting with the actual sound recording on my Nexus 5.
I am using the Cordova media-capture plugin, The code currently running is exactly the code from their documentation.
On older device, everything runs great. On my Nexus 5 though, when I click on button to record audio, it just returns error code number 3 (No media files recorded) even without opening the audio recorder. I thought it might be problem with new Android, but on simulator it runs fine. I also thought that somehow it could be connected to that I cannot find any audio recording app on my device, so I installed one and still nothing.
Then I thought maybe I am doing something wrong, so I installed this app: https://github.com/Icenium/sample-capture and the same problem.
There has been some advice around here to update the Capture Java file, which I did and still didn't help. What can I try next?
This is because there is no application installed, by default, to handle the intent (as explained above by others).
Try installing an application that handles that intent. For example I used this one:
https://play.google.com/store/apps/details?id=com.brightattic.soundrecorder&hl=en
(Please note I offer no endorsement of the app other than it worked to prove that the problem was a lack of sound recorder app).
Maybe try to set the targetsdk to 18 instead of 19 in androidmanifest.xml (and of course be sure to have installed api 18 in android sdk manager).
This should force the new kitkat chrome webview to operate in quirk mode and behave like the webview in jellybean.
I had the same issue, running adb logcat is useful:
W/System.err(22102): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND }
...
D/CordovaLog(22102): file:///android_asset/www/js/index.js: Line 77 : Capture ERROR: {"message":"Canceled.","code":3}
For me the problem is that Nexus 5 (android 4.4.2) doesn't handle the Intent, i.e. doesn't seem to have a default audio recorder.
On devices which do have a default audio recorder, you might see this error if that application doesn't include a receiver for RECORD_SOUND..

Android app demo recorder app?

This is not really a developer question but not sure where else to ask. I'm getting close to making a video tutorial for my android app. On windows I used something called "demobuilder" which is pretty cool, it records the screen as you demo your app (with voice over) and it produces a flash video.
I've been looking for something like that for android but haven't found anything that captures the screen to a video.
Can someone recommend an app that will help?
The alternative is pointing a webcam at my tablet which I think is a bit unprofessional.
I had the same problem sometime ago. Like Michael said, it is hard to capture at full frame rate from the Android (or the emulator).
I ended up using Screencast for android. However, what I would probably do now was getting something like Elgato. You connect the device trhough HDMI to that box and it allows you to record the HDMI output signal.
Another approach is to build your app for Android-x86, so that it'll run on your computer without emulation. At that point, your usual screen cast tools all work.

Categories

Resources