Android design question

by frizzo » Wed, 11 Mar 2009 13:53:12 GMT


Sponsored Links
 The system in place to pass information between the screens... I am
confused why the team chose to reinvent the wheel via the putExtras
methods.  Instead of making the transport objects inherit from
Parcelable and the like, why not just use Java's OO strength and set
objects to Activities themselves.  For instance, like this:


class Caller extends Activity {
   public on buttonClick() {
          ThisScreen ts = new ThisScreen();
          ts.SetCustomValue(10);

          startActivity(ts)
   }
}

class ThisScreen extends Activity {
   public void onCreate() {
       txtBox.setText(Integer.toString(i));
   }

   public void SetCustomValue (int i) {
            ...
   }
}

Instead we are having to unnecessarily learn new concepts.  Was there
a compelling reason to implement it they it's implemented that I am
not seeing?

Thanks.

--~--~---------~--~----~------------~-------~--~----~



Android design question

by Jean-Baptiste Queru » Wed, 11 Mar 2009 21:18:32 GMT


 The reason is that the activities in question might live in different
processes, and therefore the parameters that are passed to
startActivity might have to be marshalled across virtual machines,
across processes (and across UIDs).

JBQ






-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Android design question

by frizzo » Thu, 12 Mar 2009 14:53:20 GMT


 Ahh, understood.  Having said that, perhaps in the next rev, it'd be
good include a shortcut for in-process activity changes.

Regards




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. paintImmediately under Android

Hi,

In standard Java, you use repaint() to force the paint() method.
paint() method starts after the end of the current method. I explain :

   public void joueIA()
   {
      PosC=1;
      repaint();
      PosL=1;
    }

The paint method will start after the end of joueIA method (after
PosC=1 and PosL=1).

If you want to force the paint method immediately, you can use the
paintImmediately method.

   public void joueIA()
   {
      PosC=1;
      paintImmediately(0,0,getWidth(),getHeight());
      PosL=1;
    }

Then, PosC=1, next the paint method starts and at the end of paint
method, posL=1.

===================================

OK, now, what's happen under Android Java :

You have this code :

   public void joueIA()
   {
      PosC=1;
      invalidate();
      PosL=1;
    }

This code is the same as the repaint method (PosC=1 and PosL=1, next
onDraw starts)

The question is : What is the same as paintImmediately method under
Android, in order to force onDraw method in the middle of a method ?

Thanks for all,

Chaton.



--~--~---------~--~----~------------~-------~--~----~

2. post moderated ?

Hi,

I posted a new discussion at about 00h10 : 15 Fev 2009. It talk about
paintImmediately under Android.
I don't see my post. Do you moderated it or am I a idiot (I don't understand
Google Group Ergonomy) ?

Thanks for all.

Chaton.

--~--~---------~--~----~------------~-------~--~----~

3. creating a canvas based on OpenGL

4. Error with Linear Layout

5. SSLv2 not supported?

6. Checkout source code

7. Sound Recorder App