[android-developers] Re: Whats the best practices when using Camera
You may want to surround the block with an if statement. if(camera != null) { camera.stopPreview(); camera.release(); camera = null; } On Tuesday, January 26, 2010 5:22:38 AM UTC-6, steve wrote: Greetings, I have an application that uses the camera quite heavily. I often find when I move between activities that the camera is quite liable to crash throwing the camera service is unavailable. I was wondering if their is a 'best practices' approach to using the camera service. I'm sure I am doing something wrong. In my surface destroyed method I usually have the following public void surfaceDestroyed(SurfaceHolder holder) { // TODO Auto-generated method stub camera.stopPreview(); camera.release(); camera = null; } Thanks for any tips -- 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
[android-developers] Controlling Emulator with Hardware device?
Hi all, I had heard something in the Google I/O sessions about being able to now use hardware devices to control emulators (touching and possible picture taking, etc). Is this true? If so, has anyone found how to do it? Thanks! -- 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
[android-developers] Don't require rear facing camera?
First off, hi everyone. I didn't see this asked and I couldn't figure out how to word it to find it on the android dev site so I figured I'd ask you all. Basically, my company has an application right now that requires for a very specific function the rear-facing camera. This function isn't absolutely necessary. Now that more Android tablets are coming out without rear-facing cameras, our users aren't able to download the app onto their new devices. My question is, is there a way to somehow allow the user to download the app and maybe we could programmatically disable the function that needs the camera? We're using the basic camera permission in our Android manifest: android.permission.CAMERA. And we're running Android 2.2 (we won't be able to upgrade this any time soon). Any and all help is appreciated, thank you. -- 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
[android-developers] MediaPlayer's setDataSource (FileDescriptor fd) with LocalSocket?
On the MediaPlayers' method: setDataSource (FileDescriptor fd) Does the FileDescriptor need to be seekable? Im asking this because Im trying to use a LocalSocket (which is not seekable) and I am getting this error: setDataSourceFD failed.: status=0x8000 -- 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
[android-developers] disable log messages dataCallback(16, 0x11af10) when using mCamera.setPreviewCallback(this);
Im using Camera.setPreviewCallback method to retrieve all the camera frames on the onPreviewFrame on a 2.0.1 device. Im aware about the issue of GC interrupting on each frame on 2.2 platforms (http://code.google.com/p/android/issues/detail?id=2794) and I'm using the suggested work-around. However, there is also a log message dataCallback(16, 0x11af10) being print on logcat on each frame like this: ... D/Camera-JNI( 1795): dataCallback(16, 0x11af10) D/Camera-JNI( 1795): dataCallback(16, 0x11af10) D/Camera-JNI( 1795): dataCallback(16, 0x11af10) D/Camera-JNI( 1795): dataCallback(16, 0x11af10) ... These messages are very annoying because they make it harder to find my other log messages among them. My question is: Is it possible to disable the dataCallback(16, 0x11af10) log messages? -- 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
[android-developers] Re: Working with the new ContactContracts API
Hello, I have been working with contacts. I am able to show them, update but when I want to delete any, it is not deleted completely. In Contacts application is shown as (Unknown) without any data. What is more, I am not able to delete it (only after I give this contact name). I have tried to change deleted flag in RawContacts but it doesn't help - contact is still displayed. Here is my example: ArrayListContentProviderOperation ops = new ArrayListContentProviderOperation(); ops.add(ContentProviderOperation.newDelete(Data.CONTENT_URI) .withSelection(Data.CONTACT_ID + =?, new String[]{1}) .build()); getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops); Should I do anything else to delete contact entirely? Thanks, Anna On Dec 23 2009, 2:58 am, Dmitri Plotnikov dplotni...@google.com wrote: Hi Richa, You can find explanations and an example here:http://developer.android.com/reference/android/provider/ContactsContr... Cheers, - Dmitri On Tue, Dec 22, 2009 at 3:58 AM, Richa Saraswat richa@gmail.com wrote: as m new to android i just want to know how to get a photo from person's contact?? hope to get some help... -- 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.comandroid-developers%2bunsubscr...@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 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
[android-developers] UDP broadcast receiver
I am writting an application which is using UDP broadcast. I am able to send information but I can't receive any. Are there any permissions I should set or receiving just doesn't work yet (if not will it work soon?) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---