[android-developers] RadioButton.setButtonDrawable(Drawable) disables ListView's OnLongClickListener

2010-10-13 Thread Gubatron
After 2 days of banging our heads on why our ListView's OnLongClickListener stopped working we finally learned that updating the Drawable on a RadioButton (that was not part of the ListView or it's internal views) was disabling somehow the OnLongClickListener for the ListView. The layout of our Ac

[android-developers] Re: Why ADB and DDMS cannot recognize my phone in Ubuntu?

2010-05-30 Thread Gubatron
I wrote a post about this a few days ago Here it is in case you haven't solved it yet http://www.gubatron.com/blog/2010/05/28/solved-eclipse-cant-see-my-android-device-on-ubuntu/ On May 27, 12:36 am, Ichi wrote: > Hi, > I am trying to connect my Acer Liquid with ADB and DDMS under Ubuntu > 10.

[android-developers] Re: convert a image into Base64 format

2010-04-27 Thread Gubatron
It looks like you're sending a POST request for every line you're encoding. If you're trying to do it in one shot, then why have a while statement? In any case, do not do it in one shot, use buffered streams instead, it could happen that your image is too big, so you're better off reading that Fi

[android-developers] Re: Unit Testing : Who uses it ?

2010-04-23 Thread Gubatron
I've come to use Unit Tests organically. Certainly I don't write unit tests first, I write tests to make sure what I've coded works the way it's supposed to. I also add more tests whenever I find bugs. Of course not everything can be unit tested, but most things can be. I find it faster now writi

[android-developers] Re: Best practise for storing app. Configuration

2010-04-10 Thread Gubatron
redPreferences object every time. > > On Apr 10, 5:56 am, Bob Kerns wrote: > > > Your abuse of global variables (i.e. with the static keyword) is > > giving you memory leaks. > > > On Apr 9, 9:58 am, Gubatron wrote: > > > > Here's a static wrap

[android-developers] Re: OutOfMemoryError: how best to transfer large video files into a byte array?

2010-04-09 Thread Gubatron
I suppose when you say FilePart, you mean this org.apache.commons.httpclient.methods.multipart.FilePart I'm thinking along these lines after looking at that API (I haven't tested this) final File theFile = new File("yourFileLargerThan2Mb.ext"); //Implement your own PartSource to feed your File

[android-developers] Re: Best practise for storing app. Configuration

2010-04-09 Thread Gubatron
r set preference values without dealing with Android's SharedPreferenes and the editor. * Licensed under LGPL. * * @author gubatron * * Examples: * * PrefUtils.setString(key, value) * * String value = PrefUtils.getString(key); * PrefUtils.getString(key, defaultValue); * * */ public f

[android-developers] Re: OutOfMemoryError: how best to transfer large video files into a byte array?

2010-04-09 Thread Gubatron
Why are you reading the entire file into a byte array? That sounds right there like the OutOfMem error. public static byte[] getBytesFromFile(ContentResolver cR, String fileUriString) throws IOException { Uri tempuri = Uri.parse(fileUriString); InputStream is = cR.openInputStream(tempuri);

[android-developers] Re: Service vs Singleton

2010-04-09 Thread Gubatron
Is there anything wrong about putting those background tasks on threads? That's how I've been doing it so far. I don't need these tasks to do any IPC and my Runnables already support Lifecycle logic (implemented by me initially for other java project) On Apr 9, 9:11 am, Mark Murphy wrote: > Don