I can understand the reasoning. My Galactic Guardian game breaks a lot of OO rules with many more static fields and no get/set methods than I would ever use normally. Another area I really want to revisit to see how these impact performance. But I followed the guidelines in the developers web site.
One the sensor data issue, would it be safe to assume that the "values" arrays always contain valid data for all 3 sensors? At least after each sensor has been received once? In order to use the rotation routines you need the magnetic and accelerometer data. This requires keeping one of them locally while waiting for the other to be updated. But if it is valid to use the reference to the underlying array making a copy would not be necessary. I suspect the real answer is not to depend on the behavior since it might change in the future. Rud http://mysticlakesoftware.com/ On Sep 18, 5:21 pm, Dianne Hackborn <[email protected]> wrote: > This is actually an anti-Java way of doing things, but useful for > performance. :} > > > > > > On Fri, Sep 18, 2009 at 2:21 PM, Rud <[email protected]> wrote: > > > Hi, > > > I found the same thing working with the sensors. My comments are at > >http://mysticlakesoftware.blogspot.com/. Its something I need to > > revisit because I am not sure I have retained a copy or references to > > the underlying value. Still adjusting to some of the Java way of doing > > things. > > > Rud > >http://mysticlakesoftware.com/ > > > On Sep 18, 1:06 pm, Daber <[email protected]> wrote: > > > Hi, > > > > I've been experimenting with gsensors on dev phone and I think i found > > > something that needs explanation. > > > > The appliaction was comparing g readings with previously read values > > > in following manner > > > float[] mPrevious; > > > > float[] v = event.values; > > > > // .. compare // > > > > mPrevious = v; > > > > but after while all comparisions were equal. > > > > It seems that event reuses float array object to provide new data in > > > the old array after some time (mPrevious and event.values is the same > > > object). > > > > Now here is The question: > > > Who has object "ownership" -the gsensor framework and i have to make > > > a copy > > > Me - and this is a bug > > > > BR, > > > > Michał Dąbrowski > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

