Camera preview is letterboxed when on portrait - android

I'm using the cameraPreview sample coming with the Android API demos. The problem is, the camera preview is showing properly on landscape, but when I rotate the phone to portrait, I get a letterboxed and rotated image.
I'm using Android 2.3.3 and a Samsung Galaxy Ace, but also tried 2.1 on a Xperia Mini 10 Pro.
A couple of pics (sorry for poor the quality):
portrait http://i42.tinypic.com/a9qzuu.jpg
Is this normal behavior of the demo program? What's a proper way to fix it?

This helped for me :
mCamera.setDisplayOrientation(90);

I was able to fix the problem I was having that was very similar to this. It had to do with with an old supports-screens ... / entry I had in my manifest file. I removed this from my manifest and everything worked like a charm. Hopefully this might help solve your problem. Cheers.

Solved it, turns out it was a problem with my manifest, I had to include a line defining a fixed screen orientation for the camera activity. :P

Related

Android, landscape only view orientation - Phone and Tablet

I'm trying to create an android app with a fixed landscape orientation so I updated the manifest to include the following
activity android:name=".MainActivity"
android:screenOrientation="sensorLandscape"
This worked perfectly on a Pixel 2 phone, but when I opened the app on a Nexus 9 Tablet the orientation matched the rotation of the device as if I had done nothing.
Why is this happening and what can I do to resolve the issue?
I'm fairly novice, so please keep things simple.
cheers
Try adding
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
to your OnCreate method and see what happens

Android CWAC-Camera rotation issues after upgrading to 0.6.3

I am using the CWAC-Camera library within my Android application. Recently it was upgraded to v0.6.3, but since then I have noticed that rotation of images doesn't seem to work as expected.
I am starting a CameraFragment within an Activity that is locked to landscape orientation, and have observed the rotation is not correct for an output image with or without setting CameraFragment.lockToLandscape(true). I have managed to reproduce this in the demo application when the "Lock to Landscape" is checked (steps and a screenshot provided below). I have been testing on a Nexus 4 and Nexus 5 both running Android 4.4.2.
Has anyone else experienced this issue since upgrading to v0.6? Previously we were using 0.5.4 which didn't seem to have this issue, but looking at the release log I see there has been a lot of changes to EXIF data/rotation etc.
Steps to reproduce in demo app:
Open application, hold phone portrait or landscape
Select "Lock to Landscape" and "Single shot mode" from menu
Turn phone landscape (if started off portrait in step 1)
Capture image, appears rotated as per screenshot.
Cheers
For the record, this bug was fixed in v0.6.4 of the library.

cocos2d-x screen flicker on Android

I got screen flicker when developing with cocos2d-x 3.0alpha1.
I designed the resources on 480x800 resolution.
Then I try on both my android phone ( HTC One V ) and tablet. It works fine on my phone which is 480x800 without scaling. But it flickers on my Android tablet which has 600x1024 reesolution ( HTC Flyer ).
This is the video of how the flicker going on
http://youtu.be/f_-TilhW3ns
I've tried
Director::getInstance()->setDepthTest(false);
Director::getInstance()->setProjection(Director::Projection::_2D);
with no success.
Has anybody encounter this before and maybe fixed it?
Thanks
You can try adding the following code in your AppDelegate.cpp in your AppDelegate::applicationDidFinishLaunching() methode :
glview->setDesignResolutionSize(720,1280,ResolutionPolicy::SHOW_ALL);
Worked for me. I hope it helps.
I had same issue I problem was that I was using too big sprite sheets, and also use CCParticleBatchNodes you you are using particles.

Application crashed when orientation change

Actually my problem is the same as the question posted in :
the same problem
But there is no answer yet..
Here is the problem I got :
I've just built an application using sencha touch & phone gap. It runs well on my galaxy tab but when I rotate it to portrait or landscape, it is going crash.
I have added :
android:configChanges="orientation|keyboardHidden"
on my manifest file but it is still going crash when I rotate it.
I don't know how could this happen.
Could someone help me?
Note :
I'm using
- Galaxy tab
- Sencha-touch 1.1
- Phone gap 1.2
You should have
android:configChanges="keyboardHidden|orientation|screenLayout"
instead of
android:configChanges="orientation|keyboardHidden"
to your activity in the manifest
Might be a bit late... but since I've recently been trying this, I found that specifying
android:configChanges="orientation|screenSize|keyboardHidden"
works where as
android:configChanges="keyboardHidden|orientation|screenLayout"
does NOT.
I'm using cordova 2.0.0.

Android : Camera issue with 2.3 onwards

I have developed camera application using SurfaceView. It captures image and saves to the sdcard. In 2.1 and 2.2 it works fine but in 2.3 onwards it gives problem.
The exact problem in 2.3 is when I open my camera I am able to see preview in portrait mode but when image is saved its in landscape mode.
I dont know why this is happening? The application works fine in 2.1 and 2.2. If I take picture in portrait mode it saves in portrait only.
waiting for replies.
Thanks in advance.
I've had a similar problem.
Looks like the SDK has some breaking changes.
Try using the setDisplayOrientation, it solved my problem, hopefully, it will help you.
Good luck.

Categories

Resources