Hi,

> in order to communicate with the server I need a huge global object
> (class with some hashmaps).
> 
> all my activities (about 10) need that huge global object.
> 
> wich options do I have?
> 
> I am thinking about passing the object using intends and about the
> possibility to make the object a singleton.
> 
> using the db will be much too slow.
> 
> 
> any ideas?
> 

I just rewrote part of my application (NetCounter) last week to get ride 
of the aidl I used between activity and service. I wrote a model created 
in Application#onCreate [1]. You can register an Application object in 
your manifest so the platform will create it before anything else in 
your application. You can then use getApplication [2][3] to get this 
reference from your activities and services.

You can have a look at NetCounter code as it is now open-source ;)

http://www.jaqpot.net/viewvc/android/netcounter/trunk/

Regards,

Cyril Jaquier

[1] http://developer.android.com/reference/android/app/Application.html
[2] 
http://developer.android.com/reference/android/app/Activity.html#getApplication()
[3] 
http://developer.android.com/reference/android/app/Service.html#getApplication()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to