Sharing Objects between activities using Singleton ?

by kungfuslippers » Tue, 28 Apr 2009 22:36:01 GMT


Sponsored Links
 Hi,

I have an application with N Activities that all need access to an
'engine' class.

I've seen discussion that says that I'd have to implement the Engine
using a Singleton pattern to allow the different activities to access
the engine.

Is this is the only/best/recommended way to do it in the Android
paradigm?

Are there alternatives - just out of interest.




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



Other Threads

1. ArrayList example

please can any one please send asimple arraylist example ??

not from apis please send it fast ,it is urgent

-- 

2. Edditing cache xml file

Hello,

I am trying to write sth that is similar to a 'contact book'
functionality. And I am wondering how to store the information data on
the phone's hdd. The first thing that came to my mind is creating an
xml file for this: I can add following elements like that:

<person number="01">
<name>John</name>
<lastname>Smith</lastname>
<address>Something</address>
</person>

I can use SAX parser to read the file and get every information and
that would correspond great with my listview. However I am having one
problem - how to edit and xml file in Android? Off course I would like
to have a functionality of adding, deleting and editing single
contacts. It seems very dumb to load the whole xml file to the memory,
clean it  make some changes in the code and then create the xml file
again. I think java usually uses javax.xml.transform for that but
Android seems to be missing this. Does any one have any other
solutions?

Please respond.

-- 

3. problem in displaying the google maps

4. Highlighting an icon in a Gallery widget

5. Mod: Mari bergabung di milis id-chromeOS

6. Diskusi Iseng: Kenapa Google Ngga Konsisten

7. [WTS] Desire Z Second Like New !