Allowing an activity to be launched multiple times in parallel

Gary C Martin gary at garycmartin.com
Wed Oct 29 20:33:37 EDT 2008


Hi Asheesh,

On 29 Oct 2008, at 22:31, Asheesh Laroia wrote:

> I have a general sugar UI question: My activity, "License", a simple  
> comic
> book reader <http://wiki.laptop.org/go/License> that has a license  
> chooser
> aspect to it, can be launched multiple times if clicked multiple times
> from the activity launcher.
>
> To me, that seems silly.  Is it normal for Sugar activities to be  
> able to
> be launched multiple times like this?

Yes, it is part of the UI design that have multiple instances of an  
activity running, each one is really 'different' (has a unique ID so  
sugar and share and resume each correctly), but it can feel a little  
odd when you have an activity that doesn't have any obvious state to  
keep. Some UI's (iPhone) limit you to only one application at a time,  
others (Mac/Windows) use a single instance of an application but allow  
multiple documents per application, others (often Linux based) allow  
multiple running instances of the same application (and sometimes  
multiple documents as well).

I had the same mental hoop to jump through with my Moon activity, it's  
just a viewer of data, however after a version or so I soon has some  
useful state worth keeping (which viewing options a kid may have  
selected), and I do have more states to add in the future.

I did some testing with License activity a while back, and do like the  
idea. One of the things that initially frustrated me was that I was  
forced through all those pages of description to get to the license I  
wanted, I then named the instance 'my choice of CC license for content  
blah', and then when I resumed later to have another look, License put  
me back to the start of the whole process again – I had expected my  
choice of license to have been kept as state so I could resume later  
and check what I had chosen.

> I'm interested in a discussion and hearing what current best  
> practices are
> seen as.  I haven't had a lot of time to work on the activity, but I  
> want
> to set a few things straight.  (I'm also generally very interested  
> in help
> with this activity!)

Well if you're looking for feedback ;-) the main things I'd like to  
see are:

1) Add the required license information into the activity.info file! ;-)
2) Store activity state so a kid can resume back to where they were
3) Smaller images, there are almost 4Mb of png files eating into the  
precious XO storage space, I'm sure jpg would be more than good enough.
4) A leaner activity, there is a 3.5Mb 'built' directory in the bundle  
and digging down most of the is taken up by built/share/liblicense/ 
licenses, could the license data be kept compressed and just unzipped  
when finally displayed, text compresses really well, and python has  
modules for working with compressed files.

> -- Asheesh.

--Gary


More information about the Devel mailing list