Working on my Samsung S6 camera calibration as a first step for further app development.
One of the perquisites for correctly working app is that the autofocus is disabled.
I used something like this:
mCamera.cancelAutoFocus();
Camera.Parameters mParam = mCamera.getParameters();
mParam.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
mCamera.setParameters(mParam);
Previously, I checked that the "infinity" focus mode is available on my device.
Still, when running the app, I can clearly see that the focus is changing depending on the distance of the object in frame. "Fixed" mode is not available.
Am I doing something wrong?
I just want to have focus that will not change while running app.
I'm using OpenCV3.1 with Android Studio.
Olivier's answer helped me alot.
Did it as it is described.
Had to edit layout a bit.
Put the setInfinityFocusMode under the onCameraViewStarted.
Thanks Olivier ! ;)
Related
I've the problem that some users with an Oneplus3 and the most recent Oxygen 4 version (Android Nougat) don't see any camera preview image anymore (it stays blank/black). The UI elements are still visible.
They also said in previous versions of oxygen OS the app was working correctly. I found out, that other apps got the same behaviour and fixed it, recently (i.e. Google's Cardboard Camera). But I don't know how to fix it and don't have a test device like the OP3.
I'm using the min SDK version 14 and the Camera API v1 with a SurfaceView to show the camera preview. On my phone (LG G4 with Marshmallow) the app works as expected.
Is somebody of you familiar with that issue and know how to fix it? What else can I try to solve that problem? Can you reproduce that issue on others phones with Android N, too?
You can find the source here: https://github.com/kloener/visor-android
For testing you can directly download it from Google Play (https://play.google.com/store/apps/details?id=de.visorapp.visor) or on github-releases (https://github.com/kloener/visor-android/releases)
kind regards and thanks
They need to give camera permission from application settings. I know they accept it while setting up app. But for Nougat user need to give an extra permission.
I just started learning to program for android and sadly after making one program (Hello World) I have already ran into an issue. The gesture for "Swipe to Unlock" or for the camera are not functioning. I can bypass it on the stock emulator because it shows a notification i can click that will skip the screen, however i would much rather just figure out a solution, i have searched around on Google and StackOverflow to no avail... maybe someone can help out.
Thanks in advance,
Jon
ok solved! for those that might have the same problem, just press f2
adb shell input keyevent 82
I had the same issue and grew tired of it, this always worked.
AVD_WXGA_TABLET emulator.
Android v 7
F2 does nothing.
Dragging with left-down mouse tries to do a swipe up but bounces back down when I release the mouse.
I've tried fast and slow, release on the virtual device or off it. Short and long strokes. You name it...
The f'ing thing won't unlock. And for all the keystrokes available in the tool pallet including fingerprints, there is no simple swipe-left/up/down/right. You'd think they would have had cntrol-alt-arrow for that out of sheer common sense or as the result of the developer trying to use it.
In my case, I just restarted the simulator by holding down the "Power" button in the simulator menu for a couple of seconds and then choosing "Restart." I was able to unlock the simulator easily after that.
I'm not sure exactly which step solved it, maybe all, but these were my steps
Use the SDK manager to update to the latest version of the emulator
Turn off the emulator (hold the power button and select Power Off)
Close Android Studio
Reopen Android Studio
Launch the emulator from the AVD manager
On mac you can keep holding the command key and then do the swipe gesture with the mouse or trackpad of your computer.
Video
Try using one of two ways
Swipe up from top section of screen
Swipe up from bottom section of screen i.e. just above the navigation buttons.
I programmatically want to mute the entire watch. So I wanted to do these things:
1. Mute to on , so go into non vibration mode. Will manufacturers be able to add sound capabilities to watches? Otherwise I would also have to add muting of sound...
2. Screen always on , to off. It's a system setting. Can I change it programmatically?
I already tried for point one to use the MediaManager:
AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
I tried all other ringer modes also just to be sure and nothing seems to work and change anything in the emulator and on my real watch but nothing is doing the job...
A pebble watch has night or silent mode support... So I won't be that hard to do it on a wearable I thought.. Any ideas on this one?
Wear 5.0.1 has some ability! the SDK sample Watchface has a way to detect it. Look for WatchFaceService.INTERRUPTION_FILTER_NONE - RoundSparrow hilltx
from this question here: Android Wear detect "Mute"
Maybe with requestInterruptionFilter where fitler mode are:
INTERRUPTION_FILTER_ALL
NTERRUPTION_FILTER_NONE
INTERRUPTION_FILTER_PRIORITY
The iPhone has this swirling icon, which you can make appear when the Internet is working behind in the background. It's a VERY simple call to turn it on/off.
Does Android have anything like this? How do I call it and how does it work?
You should display this in the ActionBar.
The simplest way
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
Or using ActionBarSherlock for backwards compatibility
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setSupportProgressBarIndeterminateVisibility(true);
No, i haven't seen it on android yet. However with ICS and above, we see 2 arrows accompanying the WiFi or 3G to indicate if there is activity on the network. However it may not be possible to programmatically control it.
You could otherwise use a indeterminate progress bar within your activity to show background work.
You could try using Android Notifications and use an AnimationDrawable. Check this answer. (Note that I haven't tried it).
I am working on a game with a virtual joystick in the bottom right corner of the screen and a "move" button in the bottom left. So you use the joystick to point the character in the right direction and press the "move" button to go forward in that direction. This was all working great until today and now when I press on the screen to go forward my joystick is being affected. I know it is not a coding problem because I haven't opened the file that handles touches for 8 days and it has been working fine. Also after I close my app and then use another app that is completely separate from libGDX the multitouch is having the same issue. So do you guys think this is a problem with libGDX, my device, or am I just not coding the multitouch correctly for libGDX? I am using a Stage and the controls are Actors on the Stage I should note that after I restart my phone, the other app that is not using libGDX works correctly. It is only after I open my libGDX based game. So frustrated with this that I am about to give up on libGDX. I am happy to post any code that is requested.
EDIT: Please see comments below. This seems to be a specific issue with the Galaxy Nexus and probably some other Samsung devices as well. This libGDX based app has had no issues on other devices such as original droid, and ASUS Transformer tablet.
Turns out this is not a libGDX problem at all... Nor was it a problem with any of my code. There seems to be a bug in the way the Galaxy Nexus handles multitouch. You can view the bug report at this link. Seems that as of 4.0.4 there still is no fix for this bug. I am still currently running a VZW Galaxy Nexus with 4.0.2, I guess all we can do is wait and put a disclaimer in our games until (if ever) it is fixed.
By locking and unlocking the device, the problem does go away (sometimes), but will quickly come back if I go to my homescreen and re-open the app.