Orientation for Photo Captured by Camera Intent - android-camera-intent

I've captured several images from the Camera by launching it with an intent.
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
When I display the image in a view after I capture it, it's orientation is always landscape, regardless of it being captured in portrait or otherwise. I expect this based on what I've read on this forum.
However, when I look at it in the Gallery App or from the File Manager, it's displayed in it's correct orientation.
How does the Gallery App know what the capture orientation was? I would like access to that same information, but it doesn't appear to be in the ExifInterace or the ContentResolver.

Related

Play youtube full screen on landscape, but inline on portrait - on iPhone

I have a view with a UIWebView on half the size of the iPhone screen.
In this webview I embed youtube videos.
The app is only in portrait mode. Though I would like to see videos play also in landscape.
Now I want the following behaviour:
When in portrait, play inline, don't go full screen.
a. For that I use "webView.allowsInlineMediaPlayback=YES;"
b. I open the webview with this link: "www.youtube.com/embed/videoid?playsinline=1"
If the user rotates the screen to landscape, I'd like the video to go full screen.
If the user then rotates back to portrait, I'd like the video to get inline again.
The rotations shouldn't stop the video in the middle, or restart the play.
What should I do?
As the embedded videos use an undocumented MPInlineVideo(Fullscreen)ViewController, you can't use its API and switch to fullscreen.
I'd thus recommend playing around with the "allowFullScreen"-parameter for the iframe-tag.
If everything fails, you should always be able to change the frame-size of the web-view so that it covers the full screen. You'd have to use width/height 100% in the iframe then.
Disclaimer: This is an educated guess. I've not actually tried to implement it that way.

Portrait vs Landscape Launch Images

An iPad app can support inclusion of launch images in both orientations; presumably, if your app supports auto-rotation, then this would suggest to me that if the user launches an app while the device is in Landscape mode, then the Landscape launch image is used.
But in all the apps I've built and released, this has never been the case. Never once has the Landscape launch image appeared, only the Portrait. After loading, the app will auto-rotate to whatever orientation the device is in, but at launch, it assumes you are in Portrait. Always.
Why?
I have seen many other apps in the store that behave this way, but then there are some seem to always automatically know immediately at first launch, from that first launch image, that you are in Landscape, if that's the case.
How is this done?
iPhone supports only portrait images (http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5)
Apps that don't support portrait orientations, provide the same portrait oriented image. For example, Angry birds on iPhone has the same portrait oriented image but the guys painted rotated graphics on it.
As it would turn out, the issue was due to leaving out the supported orientations in the plist file for the app. You can add these manually or just select them in the Target page. More details here:
How to get a landscape launch image to actually appear when launched?

UIImagePicker force photo in portrait mode (disable accelerometer)

I'm building an application which takes photos using the UIImagePickerController. Works great.
The problem however is that I don't want to use image rotation. I always want a photo in portrait mode just as the user sees it on the screen.
When you take your iPhone on the side and then slowly take it back to normal the orientationmode isn't updated. Now when you take the photo the orientation flags in the EXIF data are set.
Is there a way to get rid of orientation support in de imagepicker? Could I just disable the accelerometer?

does not show external video out in ios4

I need to send video output to an external video screen from my iphone app. I am using the Apple Composite AV Cable. I get video output when I am playing a video through the ipod app, but when I do
[[UIScreen screens] count];
I only get one screen, the main phone screen. For my app I need to have a completely separate window like the process here:
Support for External Displays and Projectors
An iPad can now be connected to an external display through a supported cable. Applications can use this connection to present content in addition to the content on the device’s main screen. Depending on the cable, you can output content at up to a 720p (1280 x 720) resolution. A resolution of 1024 by 768 resolution may also be available if you prefer to use that aspect ratio.
To display content on an external display, do the following:
Use the screens class method of the UIScreen class to determine if an external display is available.
If an external screen is available, get the screen object and look at the values in its availableModes property. This property contains the configurations supported by the screen.
Select the UIScreenMode object corresponding to the desired resolution and assign it to the currentMode property of the screen object.
reate a new window object (UIWindow) to display your content.
Create a new window object (UIWindow) to display your content.
Assign the screen object to the screen property of your new window.
Configure the window (by adding views or setting up your OpenGL ES rendering context).
Show the window.
All that is here in a more readable format. I am working on an iphone, not an ipad, but the documentation says that external screens are now supported for iphones in ios4.
How can I get the phone to realize there is another screen attached? thanks
For posterity,
my problem was that I was using an iPhone 3GS. The ios4 video out stuff needs an iPhone 4 (it also works in 3.2 for the ipad i hear). With an iphone 4 I was able to get composite video out.
[[UIApplication sharedApplication] performSelector: #selector(startTVOut) withObject:nil afterDelay:.1]

How to take control if we are playing a video /mp4 file in iphone /ipod?

What I have to do is play a video file in mp4 format. If the device is in portrait mode then it should display the video, but when the user changes the device to landscape mode it should just show an image.
But currently when I play a video, it takes control of the whole app; I can't send a notification to any event, and control only returns to my code after playing the full length video.
How can we can access another things while we are playing the video on the device?
Thanks for the help
Balraj Verma
Try spawning a new thread and then call the code to play the video from the new thread. This should leave the rest of your code free to do what it needs, unless I am misunderstanding your question.
You can use the shouldAutorotateToInterfaceOrientation: to check what orientation the device is in, and then do the logic in there.
Eg, if the orientation is portrait, start the MPMoviePlayerController playing the movie, then when the orientation changes to landscape, dismiss the moviePlayer.