Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
blue0sky
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Apr 2010
Default About invalid surfaceDestroyed(...) call ???

I'm trying to make the sample camera application on Nexus One.
Until now, the programming is not commercial and only test program.
I referenced the source code of android 1.5 platform.

The test code that I made is working well on the other android 1.5 phone.
But the code is not working on Nexus One.

I checked the log of Nexus One.

If I press shutter button, surfaceChanged(...) is called on the android 1.5 phone.
However, surfaceDestroyed(...) is called on Nexus One.
I don't why suraceDestroyed(...) is called.

If anybody has information about this problem, please let me know that.

Thanks in advance.
 
ruqqq
Old
#2  
Senior Member
Thanks Meter 622
Posts: 510
Join Date: Oct 2008
Hi,

I believe that there's a great change between 1.5 and 2.1 APIs. Rarely apps made for 1.5 are compatible with 2.1. Though, I'm definitely not at expert at this. Why not code a check to use which method depending on the version of the phone?
Follow me @ruqqq for updates!

Main Phone: Stock/Odexed/Rooted Xperia V - 4.1
 
blue0sky
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Apr 2010
Ok.....Maybe, there is a great difference between 1.5 and 2.0.
However, I think that there is only little difference for camera application.

Maybe, you agree that the example code of android sdk 2.0 would work well on Nexus One.

But the CameraPreview.java doesn't work on Nuxus.
 
blue0sky
Old
#4  
Junior Member - OP
Thanks Meter 0
Posts: 5
Join Date: Apr 2010
Default CameraPreview.java Example(Anroid SDK 2.0) not working......

I'm trying to program my camera application on Nexus One,
But the example code of android sdk 2.0 isn't working.

The example source is the CamraPreview.java.
Maybe, the preview size is the problem but I don't know how to fix the problem.
I include the log of CameraView.java on Nexus One.

If anybody has the information about this problem, please let me know that.

Thanks in advance.

========> The log of CameraPreview.java on Nexus One
E/QualcommCameraHardware( 52): Invalid preview size requested: 533x295
I/QualcommCameraHardware( 52): Set zoom=0
D/AndroidRuntime( 2551): Shutting down VM
W/dalvikvm( 2551): threadid=3: thread exiting with uncaught exception (group=0x4001b180)
E/AndroidRuntime( 2551): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 2551): java.lang.RuntimeException: setParameters failed
E/AndroidRuntime( 2551): at android.hardware.Camera.native_setParameters(Nativ e Method)
E/AndroidRuntime( 2551): at android.hardware.Camera.setParameters(Camera.java: 619)
E/AndroidRuntime( 2551): at com.example.android.apis.graphics.Preview.surfaceC hanged(CameraPreview.java:90)
E/AndroidRuntime( 2551): at android.view.SurfaceView.updateWindow(SurfaceView. java:460)
E/AndroidRuntime( 2551): at android.view.SurfaceView.dispatchDraw(SurfaceView. java:287)
E/AndroidRuntime( 2551): at android.view.ViewGroup.drawChild(ViewGroup.java:15 29)
E/AndroidRuntime( 2551): at android.view.ViewGroup.dispatchDraw(ViewGroup.java :1258)
E/AndroidRuntime( 2551): at android.view.View.draw(View.java:6538)
E/AndroidRuntime( 2551): at android.widget.FrameLayout.draw(FrameLayout.java:3 52)
E/AndroidRuntime( 2551): at android.view.ViewGroup.drawChild(ViewGroup.java:15 31)
E/AndroidRuntime( 2551): at android.view.ViewGroup.dispatchDraw(ViewGroup.java :1258)
E/AndroidRuntime( 2551): at android.view.View.draw(View.java:6538)
E/AndroidRuntime( 2551): at android.widget.FrameLayout.draw(FrameLayout.java:3 52)
E/AndroidRuntime( 2551): at com.android.internal.policy.impl.PhoneWindow$Decor View.draw(PhoneWindow.java:1830)
E/AndroidRuntime( 2551): at android.view.ViewRoot.draw(ViewRoot.java:1349)
E/AndroidRuntime( 2551): at android.view.ViewRoot.performTraversals(ViewRoot.j ava:1114)
E/AndroidRuntime( 2551): at android.view.ViewRoot.handleMessage(ViewRoot.java: 1633)
E/AndroidRuntime( 2551): at android.os.Handler.dispatchMessage(Handler.java:99 )
E/AndroidRuntime( 2551): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2551): at android.app.ActivityThread.main(ActivityThread.jav a:4363)
E/AndroidRuntime( 2551): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2551): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2551): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2551): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618)
E/AndroidRuntime( 2551): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 74): Sending signal. PID: 2551 SIG: 3
I/dalvikvm( 2551): threadid=7: reacting to signal 3
I/dalvikvm( 2551): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 2551): Sending signal. PID: 2551 SIG: 9
E/JavaBinder( 74): !!! FAILED BINDER TRANSACTION !!!
 
imfloflo
Old
#5  
imfloflo's Avatar
Senior Moderator
Thanks Meter 707
Posts: 2,823
Join Date: Apr 2007
Location: Clermont-Ferrand, France

 
DONATE TO ME
Can you please post all your logs here and don't create new thread for each problem you have.
Thanks.
Nexus 4 (CM10.1) - Nexus 7 (CM10.1) - Galaxy Nexus (CM10.1) - HP Touchpad (CM9) - Nexus One (CM7.2) - HTC HD2 (CM9)
XDA-developers Senior Moderator - Twitter.com ImFloFlo

 
robert-qfh
Old
#6  
Member
Thanks Meter 0
Posts: 39
Join Date: Jan 2010
Quote:
Originally Posted by blue0sky View Post
E/QualcommCameraHardware( 52): Invalid preview size requested: 533x295
...
E/AndroidRuntime( 2551): at com.example.android.apis.graphics.Preview.surfaceC hanged(CameraPreview.java:90)
You're right, it's the preview size. http://developer.android.com/referen...arameters.html states:

Quote:
Different devices may have different camera capabilities, such as picture size or flash modes. The application should query the camera capabilities before setting parameters.
You want to use
Code:
public List<Camera.Size> getSupportedPreviewSizes ()
to get a list of supported sizes and use one of those, instead of hardcoding the values.
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

XDA University: Porting ClockworkMod Recovery to New Devices

Having a good recovery makes the process of modifying, tweaking, maintaining, … more

One Stop Guide Shop for the Newbie and Dev

It’s been well established that XDA-Developers isthedestination for resources relating to … more

What Happened at Google I/O 2013 – XDA Developer TV

Unless you just emerged from a deep, dark, dank cavern under the Earth, you know … more

Forums Added for the LG Optimus G Pro and Sony Xperia Tablet Z

Not too long ago, we talked about how Sony was continuing its AOSP efforts on … more