[android-developers] Re: Problem with createBitmap method

2009-06-23 Thread Max Salley
a 1024x1024 bitmap will be (IIRC) 4MB. Creating a few will likely cause you to run out of memory. Use Bitmap.recycle to free up the resources that a bitmap you no longer need is using On Jun 23, 9:07 am, hamlatzis wrote: > My application crashes after I try to use the static Bitmap > createBit

[android-developers] Re: Why did Google Groups not post my comments?

2009-06-12 Thread Max Salley
On Jun 12, 12:14 am, Dennis wrote: > I posted a detailed comment about typos in Android documentation > several hours ago.  My post is nowhere to be seen.  Why did Google > Groups hose my post?   The same thing happens to me. Also, sometimes a post will show up, but will not be findable throu

[android-developers] Re: How to tell when application exits?

2009-06-12 Thread Max Salley
Either way, Boston's solution seems to be what I want On Jun 12, 2:24 pm, Mark Murphy wrote: > Max Salley wrote: > > Yes, those are all instances in which I would consider the app exited > > You would. Android would not. In particular, Application#onTerminate() > will n

[android-developers] Re: How to tell when application exits?

2009-06-12 Thread Max Salley
On Jun 9, 1:58 pm, "Mark Murphy" wrote: > > Yes, but when the app closes I want to close the connections (which > > requires sending data - not just releasing the objects) regardless of > > what's holding them.  How can I tell when the app exits? > > I think you are attributing too much power t

[android-developers] How can I instantiate android.R.layout.simple_list_item_1 in Custom ListAdapter?

2009-06-12 Thread Max Salley
I'm making a custom listview and I would like to use the standard textview shown in the tutorial to display the text items (defined in android.R.layout.simple_list_item_1). How do I instantiate it? The best I can figure is using View.inflate in the ListAdapter's getView method, but this throws a

[android-developers] Re: Image Capture

2009-06-11 Thread Max Salley
What exception does it throw? On Jun 11, 1:29 pm, Sharmila wrote: > Hi everyone, > this is the code that I have for camera preview and image capture.I am > trying to do camera preview and as I press the space button I am > trying to take picture and save it in the picture gallery of the > Androi

[android-developers] Re: How to tell when application exits?

2009-06-09 Thread Max Salley
etLastNonConfigurationInstance to get your connections. If the call > to getLastNonConfigurationInstance is null, then your activity was > started from 'scratch'. > > On Jun 9, 1:30 pm, Max Salley wrote: > > > On Jun 9, 1:02 pm, "Mark Murphy" wrote: &

[android-developers] Re: A Layout question

2009-06-09 Thread Max Salley
You could use layout_weight. Give the elements that don't change size a weight of 0 and the one that does a weight of 1. The two 0-weight views will be their correct height and the 1-weight view will expand to fill the rest of the space On Jun 9, 1:21 pm, kevin wrote: > I have a possible simpl

[android-developers] Re: How to tell when application exits?

2009-06-09 Thread Max Salley
On Jun 9, 1:02 pm, "Mark Murphy" wrote: > > I have an app that has some network connections that are causing > > issues when the app closes/reopens.  I would like to close the > > connections when the app exits, and reinstantiate them when it opens > > again.  onCreate/onDestroy don't work for th

[android-developers] How to tell when application exits?

2009-06-09 Thread Max Salley
I have an app that has some network connections that are causing issues when the app closes/reopens. I would like to close the connections when the app exits, and reinstantiate them when it opens again. onCreate/onDestroy don't work for this purpose because they get called for the foreground act

[android-developers] How to tell when application exits?

2009-06-05 Thread Max Salley
I'm making an app that uses some network connections that I would like to tear down when the app exists, and put back up when it starts up again. Activity.onCreate/onDestroy will not work since those get invoked by a few actions that don't entail quitting/starting the app, such as sliding out the

[android-developers] Re: Still searching for HOME screen, and more question about ActivityManager

2009-06-05 Thread Max Salley
What do you mean by 'detect home screen'? On Jun 5, 2:18 pm, sherry wrote: > I've asked "how to detect home screen" before. I'm still searching... > > I noticed when I press "home" button on Android emulator, I got this > statement in catlog: > > INFO/ActivityManager(584): >  Starting activity:

[android-developers] Object encapsulating multiple views

2009-06-03 Thread Max Salley
I have a layout that has three views (situated in one vertical linearlayout and one horizontal) in it which I would like to wrap into a single object. Is there any easy way to do this? Right now I have a flurry of foo.setBlahBlah(bar) calls to link them all which I have to call after setContentV

[android-developers] Re: Cannot allocate any memory when using camera pic

2009-05-27 Thread Max Salley
#x27;s onDraw method gets called it sets the image, rather than setting it in the xml layout. After this it trips the flag and subsequent onDraw calls get passed to the super. It's not ideal, but it works On May 27, 2:30 pm, Max Salley wrote: > I have an app that displays a camera pictu

[android-developers] Cannot allocate any memory when using camera pic

2009-05-27 Thread Max Salley
I have an app that displays a camera picture as part of it, but if the picture is in memory I get an out of memory exception when an allocation of any size happens no matter what. If the app uses a seekbar in addition to my PictureView the ~900 bytes it allocates are too much. I even tried to lo

[android-developers] Re: stupid camera.startPreview question

2009-05-26 Thread Max Salley
Whatever SurfaceHolder you gave the camera needs to have its type set to SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS. This may not be your problem, but it will cause a blank screen On May 26, 4:18 pm, enervat...@gmail.com wrote: > Hi all, > > I'm using the camera for which I've used the CameraPrevie

[android-developers] ImageMatrix has no effect when ImageView is in matrix scaling mode

2009-05-26 Thread Max Salley
I have an extension to ImageView that I would like to draw by manually altering the ImageMatrix. When I set the View's scaling type to matrix however, changing the matrix has no effect on the image. If I put it into a different mode, say center, changing the matrix does change the display, but i

[android-developers] Re: How to force to update a view?

2009-05-22 Thread Max Salley
I'm having a similar issue with an ImageView based class that uses Matrix transformations. I update the Matrix with setImageMatrix, but the view does not update. how can I get the view to update? On May 22, 5:31 am, Gavin wrote: > Hello, >    I have a List activity which use cursor adapter. Wh

[android-developers] Re: Speed: Divide by two or multiply by .5? - I wrote a little FPS performance tester to find out.

2009-05-20 Thread Max Salley
Also there's overhead associated with putting the code into the middle of the draw loop. The speed at which this loop runs will depend on more than just the code you want to target. Maybe alter it so that it spawns a separate thread which performs whatever code you're testing and just have it re

[android-developers] Re: Bitmap from Camera Preview using BitmapFactory.decodeByteArray

2009-05-20 Thread Max Salley
I'm trying to show a cropped version of the preview, but show it at native resolution rather than showing the entire thing scaled down. I discuss what I'm doing more here (http://groups.google.com/group/ android-developers/t/f95804f843d3711b). On May 20, 3:50 pm, Jason Proctor wrote: > what do

[android-developers] Re: Bitmap from Camera Preview using BitmapFactory.decodeByteArray

2009-05-20 Thread Max Salley
I think I might go the offscreen buffer route and render when I can, as FPS doesn't matter to me in the slightest. I'm looking at creating a virtual canvas to draw to, but I'm not sure what to do with the YCbCr array that can get it into a usable form. What would you suggest I do with the array?

[android-developers] Display Cropped Camera Preview

2009-05-20 Thread Max Salley
I'm working on an app that requires the user to be able to read some text that's in the camera's preview images. The camera has plenty of resolution for the range I'm looking at, but when it's shrunk down to fit on the phone's display it's completely unusable. What I want to do is just display a

[android-developers] Re: Bitmap from Camera Preview using BitmapFactory.decodeByteArray

2009-05-20 Thread Max Salley
Thanks for the advice, I had feared something like that. From what I've read it seems that operating on the previews using the callback is much too expensive to be feasible anyway On May 20, 3:12 pm, Jason Proctor wrote: > check out the Camera SDK docs. camera previews are in raw YUV/YCbCr > fo

[android-developers] Bitmap from Camera Preview using BitmapFactory.decodeByteArray

2009-05-20 Thread Max Salley
I'm using the Camera.PreviewCallback.onPreviewFrame to try to generate a bitmap from the byte array passed to that method. If I use BitmapFactory.decodByteArray it returns null. I'm assuming that the array is correctly formatted since the data just comes right from the camera, so what could the

[android-developers] How to crop camera preview?

2009-05-20 Thread Max Salley
I'm writing an app where the user needs to be able to read text in the camera preview. I've got the preview displaying alright, and the camera has plenty of resolution to make out text at the range I want, but the preview shows a scaled down version of the entire image. I would like to get the p