3) Put the code in a static library which each app just links into its
.apk.  I don't think the code is that big, it should be fine to do this.
4) If you don't want to do that, use the PlatformLibrary sample code to make
your own shared library containing the code which each app dynamically links
against.

On Wed, Mar 18, 2009 at 11:51 AM, Learning_Android <
[email protected]> wrote:

>
> Thanks for the response Peli,
>
> Let me put my questions better.Lets say I have the same applications
> Gallery and Calendar and now I want to have only one
> SensorGestureDetector, then which of the 2 ways u suggest me to use:
>
> 1) we use it the way we use GestureDetector, extending its
> onSimpleGestureListener and implementig only the gestures specific to
> the application. This is simple and straight
> 2) we have a service to which application can bind and the service
> will call back when the getsure happens to the application which has
> been binded. So this service will listen to the sensor events in 1st
> place and implement the SensorGestureDetectors listeners which in turn
> would call the applications method and then the application can decide
> what to do on that specific gesture.
>
> Thanks and Regards,
> Learning_Android.
>
> On Mar 18, 4:22 pm, Peli <[email protected]> wrote:
> > For me, the service implementation sounds very attractive. In this
> > way, a central SensorGestureDetector could be shared by various
> > applications.
> >
> > If you only have one application, it is better to copy whatever you
> > need into your project, until we have something more stable.
> >
> > In any case, it makes sense to leave the structure of callbacks and
> > listeners, except if you have very special needs (e.g. very fast
> > processing for a game).
> >
> > If you extend SensorGestureDetector, you are of course welcome to
> > contribute back to the original code base.
> >
> > I hope my answers can be of help.
> >
> > Peliwww.openintents.org
> >
> > On Mar 18, 11:15 am, Learning_Android <[email protected]>
> > wrote:
> >
> > > Thanks Peli,
> >
> > > Regarding the usage point. Lets say I develop my own
> > > SensorGestureDetector and place it in hardware folder of frameworks/
> > > base and then my applications want to use it. Then how should my
> > > application use it, do u suggest the way GestureDetector is been used
> > > I mean u create a listener and implement the callbacks like onShake or
> > > whatever? or should we have 1 service/activity always listening to
> > > sensor data then calling sensorGestureDetector and getting the sensor
> > > getsure and then notifying the application accordingly. Which is a
> > > better way? which is a optimal and neater approach?
> >
> > > Thanks and Regards,
> > > Learning_Android.
> >
> > > On Mar 18, 3:08 pm, Peli <[email protected]> wrote:
> >
> > > > Hi,
> >
> > > > First of all, the SensorGestureDetector you refer to is in its alpha
> > > > state, and so far an experimental feature of OpenIntents. In the long
> > > > run of course it would be nice if it could make its way into the
> > > > Android Framework.
> >
> > > > Indeed I have designed it to be as close to GestureDetector as
> > > > possible. As you have noticed, the events are different, because the
> > > > underlying events delivered also differ.
> >
> > > > As for how to use it, I expect the classes to still change a lot, so
> > > > if you need something now, it is probably better to copy & paste what
> > > > you need into your project (!Note: Apache license requires you to
> > > > properly attribute though if you use some code!), until we can
> provide
> > > > something more stable.
> >
> > > > Peliwww.openintents.org
> >
> > > > On Mar 18, 10:43 am, Learning_Android <[email protected]>
> > > > wrote:
> >
> > > > > I had a doubt regarding the SensorGestureDetector that I saw
> onhttp://code.google.com/p/openintents/source/browse/#svn/trunk/SensorG...
> >
> > > > > Firstly, is the general design of SensorGestureDetector same as
> > > > > GestureDetector? I find them both very similar except that
> > > > > SensorGestureDetector would use SensorEvents and GestureDetector
> would
> > > > > use MotionEvent/TouchEvents
> >
> > > > > Secondly,  currently I see applications like Calculator,Calendar
> and
> > > > > Gallery are using GestureDetector if tomorrow I would like to
> handle
> > > > > sensor events also in these applications for same functionality
> that
> > > > > are currently been achieved using normal TouchEvents, should that
> > > > > happen appn specific or should we have a separate
> > > > > SensorGestureDetectorActivity or Service which would call current
> > > > > active application or an application which have registered with
> this
> > > > > Activity /Service on a sensor getsure that it has subscribed for?
> >
> > > > > Thanks in advance!
> > > > > Learning_Android
> >
> >
> >
>


-- 
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.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" 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-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to