Sharing between apps (resending to the right list...)

6 views
Skip to first unread message

Pat Tressel

unread,
Apr 24, 2012, 7:06:12 AM4/24/12
to Seattle Java Android Study Sessions
You may have been wondering where the code and notes I sent out
were... I just got a bounce message -- it appears I sent them as a
reply to a Meetup reminder. Anyhow, here are the two messages I
sent...

---------- Forwarded message ----------
From: Pat Tressel <ptre...@myuw.net>
Date: Mon, Apr 23, 2012 at 6:18 PM
Subject: Re: New Meetup: Sharing between apps: Content Providers and
Action Providers
To: Seattle Android Developers <in...@meetup.com>

Hi, all!

There's a not-yet-complete demo and notes at:

https://github.com/ptressel/SharingDemo

(I can only offer as an excuse Form 8582, Passive Activity Loss
Limitations. It's a loooong story...)

I ran into an issue while writing the demo that you-all can surely
help with. Let's go over the material quickly and then hack on it!

-- Pat

---------- Forwarded message ----------
From: Pat Tressel <ptre...@myuw.net>
Date: Tue, Apr 24, 2012 at 2:30 AM
Subject: Re: New Meetup: Sharing between apps: Content Providers and
Action Providers
To: Seattle Android Developers <in...@meetup.com>

Hi, all!

There's a not-yet-complete demo and notes at:

https://github.com/ptressel/SharingDemo

Here is the notes doc, in case anyone would like to add / correct any
info. (I was treating this as brief explanatory notes, with more
detail around gotchas and tips, plus pointers "for more info", but it
doesn't have to stay that way.)

https://docs.google.com/document/d/1n8dfOOKhvDGGIEyR6WBfrcY34j1hZGyrGSwum-4wO_A/edit

Here's something related on which opinion / advice is welcome:

I have a service that runs on an Android phone mounted on a powered
toy truck that's being operated via the phone, connected to an Arduino
that's controlling the truck. The service polls a web site and picks
up commands queued up there that need to be sent to the Arduino.
There's an Android app, DemoKit, provided for the Arduino, that
normally gets commands via the GUI and sends them to the board.
Rather than crib from DemoKit, I'd prefer to package it with my app
and use its methods to communicate with the Arduino. Here are several
options for how to do this (and I'm sure there are more than I'm
listing here...). One goal is to keep DemoKit functionally intact,
even if it needs some refactoring.

1) Import and instantiate the relevant DemoKit Activity that provides
the communication methods directly, and call methods on the instance.

2) Refactor DemoKit into a thin shell Activity for the current DemoKit
UI, and an IntentService for the back end comms with the Arduino.
Define the comms methods via AIDL. Launch that service from the
DemoKit UI or my service, and call its comms methods as usual with
Intents.

3) A problem with 2) is that DemoKit has some controls that send
commands very rapidly to the board. 2) substitutes sending Intents to
a service for an efficient direct method call. Is there another way
for the UI to talk to a service? Is there a way to open a pipe or
similar between them?

4) Something else I forgot.

If 1) is doable, it would be simplest. I can just try it, but I'm
wondering if there are known problems.

Ideas? Any thoughts on which is preferable? or on other options?

-- Pat

Reply all
Reply to author
Forward
0 new messages