Loading...

android-platform@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Android object that is shared by all applications Android007 Sun Apr 01 01:00:13 2012

I prefer not to use Linux daemons because I am not sure how easy it would 
be to call these daemons from within the platform's Java code.
Do you have an example  of how these daemons can be written?

On Friday, March 30, 2012 10:38:25 AM UTC+3, Tez wrote:
>
> If you want a global thing, something like zygotes socket, create a 
> linux daemon that opens a socket and listens for connections. 
>
> -Earlence 
>
> On Mar 30, 12:35 am, Dianne Hackborn <[EMAIL PROTECTED]> wrote: 
> > Do you want the same instance only across uses in the same process, or a 
> > global across all processes? 
> > 
> > On Thu, Mar 29, 2012 at 7:24 AM, Android007 <[EMAIL PROTECTED]>wrote: 
>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > Hi, 
> > > I am a newbie in this so please bear with me.... 
> > 
> > > I need to add a Socket instance to the platform. One that can be 
> shared by 
> > > everyone: Applications, Canvases, Activities, Views etc... 
> > > I tried adding it to the ActivityManager's constructor, but it seems 
> that 
> > > whenever I write this line: 
> > 
> > > *ActivityManager am = (ActivityManager) 
> > > context.getSystemService(Context.ACTIVITY_SERVICE);* 
> > 
> > > a new ActivityManager instance is created and so I get the error that 
> the 
> > > socket is already open (really?? no kidding...) 
> > > I am trying to refrain from using a Service (not familiar enough with 
> > > Services, and I really want it to have a simple usage). 
> > > I tried looking at the different Managers (WindowManager, 
> > > ConnectivityManager, etc.) , but they are all called in the same 
> manner. 
> > 
> > > I can only assume that whenever *getSystemService* is called a new 
> object 
> > > is instantiated...(why?) 
> > 
> > > Is there any object (<X>Manager of some sort) that can be called by a 
> > > function (probably get<X>) and provide the same instance from ALL 
> > > Appliactions/Activities? 
> > > (BTW if there is no such object, I'd be happy to know as well.....) 
> > 
> > > Thanks a lot 
> > 
> > >  -- 
> > > You received this message because you are subscribed to the Google 
> Groups 
> > > "android-platform" group. 
> > > To view this discussion on the web visit 
> > >https://groups.google.com/d/msg/android-platform/-/jGqz3U2HBKsJ. 
> > > To post to this group, send email to [EMAIL PROTECTED] 
>
> > > To unsubscribe from this group, send email to 
> > > [EMAIL PROTECTED] 
> > > For more options, visit this group at 
> > >http://groups.google.com/group/android-platform?hl=en. 
> > 
> > -- 
> > Dianne Hackborn 
> > Android framework engineer 
> > [EMAIL PROTECTED] 
> > 
> > Note: please don't send private questions to me, as I don't have time to 
> > provide private support, and so won't reply to such e-mails.  All such 
> > questions should be posted on public forums, where I and others can see 
> and 
> > answer them.


On Friday, March 30, 2012 10:38:25 AM UTC+3, Tez wrote:
>
> If you want a global thing, something like zygotes socket, create a 
> linux daemon that opens a socket and listens for connections. 
>
> -Earlence 
>
> On Mar 30, 12:35 am, Dianne Hackborn <[EMAIL PROTECTED]> wrote: 
> > Do you want the same instance only across uses in the same process, or a 
> > global across all processes? 
> > 
> > On Thu, Mar 29, 2012 at 7:24 AM, Android007 <[EMAIL PROTECTED]>wrote: 
>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > Hi, 
> > > I am a newbie in this so please bear with me.... 
> > 
> > > I need to add a Socket instance to the platform. One that can be 
> shared by 
> > > everyone: Applications, Canvases, Activities, Views etc... 
> > > I tried adding it to the ActivityManager's constructor, but it seems 
> that 
> > > whenever I write this line: 
> > 
> > > *ActivityManager am = (ActivityManager) 
> > > context.getSystemService(Context.ACTIVITY_SERVICE);* 
> > 
> > > a new ActivityManager instance is created and so I get the error that 
> the 
> > > socket is already open (really?? no kidding...) 
> > > I am trying to refrain from using a Service (not familiar enough with 
> > > Services, and I really want it to have a simple usage). 
> > > I tried looking at the different Managers (WindowManager, 
> > > ConnectivityManager, etc.) , but they are all called in the same 
> manner. 
> > 
> > > I can only assume that whenever *getSystemService* is called a new 
> object 
> > > is instantiated...(why?) 
> > 
> > > Is there any object (<X>Manager of some sort) that can be called by a 
> > > function (probably get<X>) and provide the same instance from ALL 
> > > Appliactions/Activities? 
> > > (BTW if there is no such object, I'd be happy to know as well.....) 
> > 
> > > Thanks a lot 
> > 
> > >  -- 
> > > You received this message because you are subscribed to the Google 
> Groups 
> > > "android-platform" group. 
> > > To view this discussion on the web visit 
> > >https://groups.google.com/d/msg/android-platform/-/jGqz3U2HBKsJ. 
> > > To post to this group, send email to [EMAIL PROTECTED] 
>
> > > To unsubscribe from this group, send email to 
> > > [EMAIL PROTECTED] 
> > > For more options, visit this group at 
> > >http://groups.google.com/group/android-platform?hl=en. 
> > 
> > -- 
> > Dianne Hackborn 
> > Android framework engineer 
> > [EMAIL PROTECTED] 
> > 
> > Note: please don't send private questions to me, as I don't have time to 
> > provide private support, and so won't reply to such e-mails.  All such 
> > questions should be posted on public forums, where I and others can see 
> and 
> > answer them.

-- 
You received this message because you are subscribed to the Google Groups 
"android-platform" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/android-platform/-/C38jDQfuGTUJ.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/android-platform?hl=en.