[android-developers] Re: Camera preview freezes when I press HOME button

2013-07-27 Thread Piren
haven't come across this issue myself but using Sleep is not the way to 
solve anything...
I'd suggest you go the other route - When taking a picture put up a timer 
of the length it takes the slowest device to process the picture (let say, 
3 seconds). If home is pressed in that time frame, do not pause/stop the 
camera, let the app pause  regularly  and the camera to finish its thing.
once the timer finishes, if the home button was pressed, then pause/stop 
the camera.

On Friday, July 26, 2013 12:50:50 AM UTC+3, Linda Li wrote:
>
> It would be easy to repeat the problem when I use an old device, which 
> takes 1-2 secs to finish taking a picture.
>
> So when I press HOME button, while the device is taking picture, often 
> times it freezes at the preview picture.
> I have added camera stopPreview and release in onPause(), which will be 
> called when HOME button is pressed.
>
> From the LogCat, I find that the camera hardware is still processing some 
> information, but Activity Manager kicks in, saying something about HOME 
> activity.
>
> So I think HOME forces some camera procedure finished in a bad way, which 
> makes the camera preview freezes, and the camera cannot be opened any more 
> (e.g. when I try to open the default camera, it says it cannot access to 
> camera)
>
> However, if I use the default camera of the old slow device :), I cannot 
> repeat the crash. So it seems the default camera application might handle 
> it well; it might access native libraries to handle the situation, or 
> something else.
>
> If I use Nexus 4 device, it is very hard to repeat this experiment.
> A less powerful device is needed to repeat the experiment.
>
> [UPDATE]
> I put the Logcat at the end of the post (it is long). Here is a brief 
> review.
>
> After click the capture button, 
>
> 07-25 14:20:08.517: I/Camera Preview(1517): For Debug: begin 
> mCamera.takePicture
>
>
> Then I press the HOME button, the log below shows that 
> android.intent.action.MAIN kicks in.
>
> 07-25 14:20:08.867: I/ActivityManager(188): Starting activity: Intent { 
> act=android.intent.action.MAIN cat=[android.intent.category.HOME] 
> flg=0x1020 cmp=com.htc.launcher/.Launcher } from pid 188
>
> 07-25 14:20:09.337: I/Camera Preview(1517): For Debug: after 
> mCamera.takePicture
>
> 07-25 14:20:09.337: I/CameraActivity(1517): For Debug: in onPause(); 
>
>
> Regarding how to process in onPause, which will be callsed by HOME button, 
> I tried two options.
> One option is that onPause releases the camera.
>
> Another option is, 
> I put Thread.sleep(1500) to let my activity has enough time to finish 
> something.
>
> But with either option, the camear crashes, and cannot be launched any 
> more.
>
> ***
> Long logcat:
>
>
> 07-25 14:20:07.736: I/Camera Preview(1517): For Debug: begin: 
> mCamera.autoFocus(mContinuousAutoFocusCallback);
> 07-25 14:20:07.736: I/Camera Preview(1517): For Debug: Unexpected 
> exception while doing continuous focusingjava.lang.NullPointerException
> 07-25 14:20:07.766: I/Camera Preview(1517): For Debug: onClick 
> mCamera.autoFocus and take a picture
> 07-25 14:20:07.766: D/CameraService(70): autoFocus (pid 1517)
> 07-25 14:20:07.766: D/QualcommCameraHardware(70): autoFocus E
> 07-25 14:20:07.766: D/QualcommCameraHardware(70): autoFocus X
> 07-25 14:20:07.766: D/QualcommCameraHardware(70): runAutoFocus E
> 07-25 14:20:07.766: D/QualcommCameraHardware(70): af start (fd 39)
> 07-25 14:20:07.766: I/mm-camera 8x vfe(70): ch=971 cw=1619 vof=485 
> hof=809 wh=485 ww=809
> 07-25 14:20:07.916: D/WifiStateTracker(188): Reset connections and 
> stopping DHCP
> 07-25 14:20:07.916: I/wpa_supplicant(487): Rx Data Filter Remove [5] 
> command
> 07-25 14:20:07.916: I/wpa_supplicant(487): auto ip disabled
> 07-25 14:20:07.916: I/wpa_supplicant(487): Rx Data Filter: do not 
> support, ignore
> 07-25 14:20:07.926: D/NetUtils(188): ifc_get_info addr=0 !
> 07-25 14:20:08.497: D/mm-camera af_core(70): af_beta is executing!!
> 07-25 14:20:08.517: D/QualcommCameraHardware(70): native_set_afmode: 
> ctrlCmd.status == 2
> 07-25 14:20:08.517: D/QualcommCameraHardware(70): af done: 0
> 07-25 14:20:08.517: D/CameraService(70): focus lenPos 0 status 0 
> macro_threshold 10
> 07-25 14:20:08.517: D/CameraService(70): 
> CameraService::Client::handleGenericNotify: msgType = CAMERA_MSG_FOCUS
> 07-25 14:20:08.517: D/CameraService(70): 
> CameraService::Client::handleGenericNotify: callback
> 07-25 14:20:08.517: I/Camera Preview(1517): For Debug: onClick 
> mCamera.autoFocus, onAutoFocus: want to know the time difference
> 07-25 14:20:08.517: I/Camera Preview(1517): For Debug: begin 
> mCamera.takePicture
> 07-25 14:20:08.517: D/QualcommCameraHardware(70): runAutoFocus X
> 07-25 14:20:08.517: D/CameraService(70): setPreviewCallbackFlag(0) 
> (pid 1517)
> 07-25 14:20:08.517: D/CameraService(70): takePicture (pid

[android-developers] Is anyone able to run the 4.3 emulator under Linux?

2013-07-27 Thread Kostya Vasilyev
Just tried to run the 4.3 Android emulator under Linux (mine is Ubuntu
13.04, x64), not working for me at all:

https://code.google.com/p/android/issues/detail?id=58120

Has anyone tried this yet? Is it working for you?

-- K

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] how to impliment single check on checkbox in custom listview

2013-07-27 Thread TreKing
On Sat, Jul 27, 2013 at 3:08 AM, Sadhna Upadhyay
wrote:

> how to impliment single check on checkbox in custom listview


What is "single check on checkbox" and what have you done so far?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] GLSurfaceView lag/delay on Galaxy S3.

2013-07-27 Thread Edvinas Kilbauskas
Hello,
so I have this problem with galaxy S3 and OpenGL ES 1.0.

Here's little backstory:
I had LG P350 (600MHZ CPU, Adreno 200 GPU, 2.8 inch screen) for 2 years or 
so. And I was developing this little game framework which used OpenGL. My 
old LG handled it pretty well, good framerates, no lags, everything worked 
as expected. But few days ago I decided that I should get new phone, so I 
ordered Galaxy S3.

So after I got the phone I installed my 2 games which used my framework and 
noticed that there is a delay between touching / moving finger on the 
screen and things appearing on screen. First I thought that this could be 
problem of my input handling system, so I did something like this to check 
if that was true:

inputSystem.update();
>
> float x = inputSystem.getTouchX();
> float y = inputSystem.geTouchY();
>
> Log.d("Touch: ", "X: " + x + " Y: " + y);
>

 
Essentially I just touched my screen, and looked at the logcat to see if 
there is any delay in receiving data. And there was absolutely no delay! As 
soon as I touched the screen, coordinates on logcat changed.

Then I thought to myself... OK, maybe my rendering system is messed up. To 
test if that was true I did exactly this:

public void onDrawFrame(GL10 gl){
> FloatBuffer floatBuffer = buffer.asFloatBuffer();
>
> public void tempDraw(GL10 gl){
> gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
>
> gl.glViewport(0,0,1280,720);
> gl.glMatrixMode(GL10.GL_PROJECTION);
> gl.glLoadIdentity();
> gl.glOrthof(0, 20, 14, 0, -1, 1);
>
> gl.glMatrixMode(GL10.GL_MODELVIEW);
> gl.glLoadIdentity();
>
> gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
> gl.glVertexPointer(2,GL10.GL_FLOAT,0,floatBuffer);
>
> inputSystem.update();
>
> float x = inputSystem.getLastTouchEvent().position.x;
> float y = inputSystem.getLastTouchEvent().position.y;
>
> Log.d("Touch: ", "X: " + x + " Y: " + y);
>
> gl.glTranslatef(x,y,0);
> gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 6);
> }
>


This is as simple as it could be, I didn't use my render system for 
rendering, I just used this little piece of code which couldn't get any 
simpler. It just draws little rectangle on screen in the position of last 
touch event.

And guess what! This didn't do the trick either! It still has delay! *Also 
in developer options I enabled "Show touches" function, so I could see in 
real time how much delay there is.* After I scroll my finger through 
screen, I immediately can see output on logcat, but square on the screen 
still has huge delay. 

Here's the video showing the delay: GLSurfaceView lag/delay on Galaxy 
S3

You can see that "Show touches" android function showing the white dot on 
screen, this is where I WANT my square to be, but my square just follows it 
with delay.
Just for comparison I will launch painting application which paint on 
EXACTLY the white dot. This is the performance I want in my game.

It can't be the problem of my phone, because other games and apps that I 
downloaded from google play doesn't have this lag/delay problem.

So can someone help me out please? What am I missing? Have any of you 
encountered this problem before?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] how to impliment single check on checkbox in custom listview

2013-07-27 Thread Sadhna Upadhyay
hey guys pls tell me ...

how to impliment single check on checkbox in custom listview

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.