[android-developers] modify active intentfilter

2009-10-20 Thread Bart van Wissen
Let's say that I have a BroadcastReceiver that has already been registered, and I want to change its IntentFilter at that moment (add a new data authority for example). Is this at all possible? Or do I have to unregister it first, and then re-register it with the updated IntentFilter?

[android-developers] detecting shake movement without draining the battery

2009-09-10 Thread Bart van Wissen
I would like to detect shake movement in a service that is running in the background, even when the phone is not currently being used. Is it true that the only way to do this is to hold a wake lock? I suppose this would consume a lot of energy and drain the battery very fast. Is there no way to

[android-developers] running emulator on a remote machine

2009-09-08 Thread Bart van Wissen
Is there any way to connect the debugger to an emulator running on a remote machine? It's using TCP so I suppose it shouldn't be too difficult, but I can't figure out how. I would like to run the emulator on my (fast) laptop and do my coding on my (slow, but with bigger screen) desktop machine.

[android-developers] Re: running emulator on a remote machine

2009-09-08 Thread Bart van Wissen
USA, Inc. On Sep 8, 2:38 pm, Bart van Wissen bartvanwis...@gmail.com wrote: Is there any way to connect the debugger to an emulator running on a remote machine? It's using TCP so I suppose it shouldn't be too difficult, but I can't figure out how. I would like to run the emulator on my

[android-developers] Re: how to make sound hz?

2009-09-01 Thread Bart van Wissen
On 1 sep, 10:01, guruk ilovesi...@gmail.com wrote: thanks for all comments. does anyone have a simple source demo. I could try that buffer[i] = (short) ( Math.sin((2. * Math.PI * i * f) / samplerate) * Short.MAX_VALUE ) ... and what afterwards, how to play it? I am just wondering (

[android-developers] Re: Constructor problem

2009-08-31 Thread Bart van Wissen
The problem is that renvoi_liste_recette_xml() throws an Exception (you shouldn't do this - either make it more specific or catch the exception within the method) and the initialization section of your Activity cannot handle this, because the constructor of Activity doesn't throw Exception. Move

[android-developers] Re: how to make sound hz?

2009-08-31 Thread Bart van Wissen
You will have to create the wave data yourself using a sine-function. Fill a buffer of shorts (for 16 bit audio) with something like this: buffer[i] = (short) (Math.sin(((double) i / samplerate) * f) * Short.MAX_VALUE); (please correct me if I'm wrong) If you need a 5 seconds tone, I suppose

[android-developers] Re: how to make sound hz?

2009-08-31 Thread Bart van Wissen
I'm sorry, the formula is wrong. I think it's buffer[i] = (short) ( Math.sin((2. * Math.PI * i * f) / samplerate) * Short.MAX_VALUE ) But I'm not sure. I guess 3 AM is not the time to think about this. Anyway it should give you an idea of how to do it. On 1 sep, 02:23, Bart van Wissen

[android-developers] Parcel/unparcel Bundle classloader bug?

2009-08-10 Thread Bart van Wissen
I have a parcelable class whose writeToParcel() method puts some data in a Bundle and writes it to the parcel. This parcel gets sent from a client process to a service process. At the side of the service, the readFromparcel() method tries to read this Bundle from the parcel. A strange thing

[android-developers] Re: Parcel/unparcel Bundle classloader bug?

2009-08-10 Thread Bart van Wissen
I noticed that the mParcelledData thing was the result of Bundle.toString() when the Bundle hasn't been unparcelled yet, so I decided to stick in a bundle.containsKey(something) before I printed the toString to force it to unparcel first, but then I got a NullPointerException. And I did check if

[android-developers] referencing projects in eclipse

2009-07-27 Thread Bart van Wissen
I'm working on two projects. One is essentially a library, and the other is an application using that library. Now from the application project, I want to use the library's classes, so I added that project to the required projects under java build path. It seems to compile fine, but at runtime, I

[android-developers] sending / receiving custom broadcast intent

2009-07-25 Thread Bart van Wissen
I'm building a service that sends a broadcast intent when some value changes. The service sends the broadcast like this: Intent broadcastIntent = new Intent(); broadcastIntent.setAction(nl.vu.contextframework.NEWREADING); broadcastIntent.setData(Uri.parse(context://+cer.getKey()));

[android-developers] Re: sending / receiving custom broadcast intent

2009-07-25 Thread Bart van Wissen
On 25 jul, 14:00, Mark Murphy mmur...@commonsware.com wrote: Could it be that I'm using a non-existent scheme? I invented context:// myself, maybe this is not a good idea? In theory that should work, though I haven't tried it myself. I take an Occam's Razor approach to intents and

[android-developers] Location updates not coming through

2009-07-22 Thread Bart van Wissen
I'm writing a program that uses a LocationListener to listen for location updates. I'm playing a GPX file that I recorded, which contains a route. I know for sure that this file is correct. My program seems to only receive 1 location update, and then nothing. I have both minimum time and distance

[android-developers] Re: Tree of parcelables: Class not found when unmarshalling

2009-07-21 Thread Bart van Wissen
So should I submit this as a bug? On 20 jul, 13:07, Bart van Wissen bartvanwis...@gmail.com wrote: I'm using a tree structure in my application, which has to be passed to a service. All nodes in the tree are of the type ExpressionTree, which is an interface. All nodes are also Parcelable

[android-developers] Re: Tree of parcelables: Class not found when unmarshalling

2009-07-21 Thread Bart van Wissen
On 21 jul, 11:13, Dianne Hackborn hack...@android.com wrote: There isn't enough information here to know if it is a bug in the platform...  off-hand, I would guess not, since most of the logic in marshalling/unmarshalling such things needs to be written by the developer and doesn't come from

[android-developers] Re: Tree of parcelables: Class not found when unmarshalling

2009-07-21 Thread Bart van Wissen
Alright, I fixed it by changing tree = parcel.readParcelable(null); into tree = parcel.readParcelable(getClass().getClassLoader()); Thanks again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers

[android-developers] Re: extending parcelables

2009-07-17 Thread Bart van Wissen
On Jul 16, 6:52 pm, Dianne Hackborn hack...@android.com wrote: Just use ArrayListParcelable as your data type. Putting ListParcelable in my aidl file resulted in the following errors: The method writeBinderList(ListIBinder) in the type Parcel is not applicable for the arguments

[android-developers] Re: extending parcelables

2009-07-16 Thread Bart van Wissen
2. Use a generic Parcelable class type, in which case the marshalling code will inspect the class type, included that in the marshalled data, and use that to re-construct it on the other side. I don't understand this. My program deals with Condition objects, which can be put in a list to

[android-developers] Re: extending parcelables

2009-07-15 Thread Bart van Wissen
On Jul 15, 5:21 pm, Streets Of Boston flyingdutc...@gmail.com wrote: It looks like your Animal class is abstract and should never be constructed. Declare Animal 'abstract' and see if you get an instantiation error. It should be abstract, but I cannot make it abstract because then I cannot add

[android-developers] Re: Documentation inconsistency in Service.onBind() intent extras availability

2009-07-02 Thread Bart van Wissen
); it is a convenient convention for this to be the fully qualified name of the interface that is being requested. On Wed, Jul 1, 2009 at 1:42 PM, Bart van Wissen bartvanwis...@gmail.com wrote: I think you can actually use the Intent's action to select the implementation stub

[android-developers] Re: Documentation inconsistency in Service.onBind() intent extras availability

2009-07-01 Thread Bart van Wissen
I think you can actually use the Intent's action to select the implementation stub that you need. In the examples, the class name is used, but I think you can use anything you want, as long as you create the appropriate intent filter for the service. On 1 jul, 20:33, Gert gsch...@gmail.com

[android-developers] Expression Evaluation library that works in Dalvik

2009-05-26 Thread Bart van Wissen
I'm looking for a library that will let me evaluate expressions at runtime. Required: - basic logical expressions (AND, OR, NOT operators) - custom functions - some mechanism to resolve variables (I want to link some variables to some entities in a ContentProvider) I have tried a number of