2.2 Camera Orientation Problem

by Vincent » Thu, 15 Jul 2010 20:01:11 GMT


Sponsored Links
 Hi,

In my camera application, I use the following code to change the
screen orientation.

Parameters params = mCamera.getParameters();
params.set("orientation", "portrait");

It worked for the most of devices.
However, after updating my NexusOne to 2.2, the above code does not
work!!
Is there any other way to change the orientation?

The only way to change the orientation is to change the orientation of
an Activity.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
But, I don't want to do this because I have other controls like Text
or Button on Screen.

If somebody knows the solution for this, please help me!!

--



2.2 Camera Orientation Problem

by TreKing » Thu, 15 Jul 2010 22:18:22 GMT


 



It worked for "most"? And that was good enough for you?



What does "does not work!!" mean?



I'm sure there is a "correct" way, like the request orientation you're
avoiding. Not really sure though.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

--


Sponsored Links


2.2 Camera Orientation Problem

by Dave Sparks » Fri, 16 Jul 2010 04:56:47 GMT


 See android.hardware.Camera.setDisplayOrientation (int degrees)

This is the approved way to set the camera orientation as of V2.2.
Please note that this only works for still images, videos will still
record in landscape orientation.




--



2.2 Camera Orientation Problem

by Vincent » Tue, 20 Jul 2010 09:30:45 GMT


 Dave Sparks

Thank you very much for your response.
I didn't aware of the new api.
It solved my problem.

Thanks!!

Vincent






--



Other Threads

1. Emulator and android Market

Can I access Android Market through emulator? Thanks


--
Best Regards,
Atif Gulzar

I  Unicode, zln 

--~--~---------~--~----~------------~-------~--~----~

2. MeidaPlayer IlleglStateException thrown

Hi,
I have the following issue i have an application that uses
android.media.MediaPlayer and got this exception:

09-12 16:21:05.921: ERROR/AndroidRuntime(9890): Uncaught handler:
thread main exiting due to uncaught exception
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):
java.lang.IllegalStateException
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.media.MediaPlayer._reset(Native Method)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.media.MediaPlayer.reset(MediaPlayer.java:856)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.predictsystems.media.SongPlayer.play(SongPlayer.java:185)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.predictsystems.media.SongPlayer.playSong(SongPlayer.java:287)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.predictsystems.media.SongPlayer.playCurrent(SongPlayer.java:276)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.predictsystems.player.activity.SongListActivity.onListItemClick
(SongListActivity.java:198)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.predictsystems.player.activity.AbstractInstinctivActivity
$1.onItemClick(AbstractInstinctivActivity.java:83)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.widget.AdapterView.performItemClick(AdapterView.java:283)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.widget.ListView.performItemClick(ListView.java:3132)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.widget.AbsListView$PerformClick.run(AbsListView.java:1620)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.os.Handler.handleCallback(Handler.java:587)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.os.Handler.dispatchMessage(Handler.java:92)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.os.Looper.loop(Looper.java:123)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
java.lang.reflect.Method.invokeNative(Native Method)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
java.lang.reflect.Method.invoke(Method.java:521)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
09-12 16:21:06.101: ERROR/AndroidRuntime(9890):     at
dalvik.system.NativeStart.main(Native Method)

in the documentation there are no invalid states for the reset method.
native call.
i read about some issues about the same problem but this time for
setDataSource method and the solution is the surround with try catch
http://code.google.com/p/android/issues/detail?id=957.
Any suggestions ? Thanks

--~--~---------~--~----~------------~-------~--~----~

3. search a function to parse an XML file and return a table

4. menggunakan git-svn untuk ng-mirror source cod

5. DDMS logging level doesn't work

6. Why do we need static compilation for android???

7. XML version 2.0