Re: [android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-27 Thread Kristopher Micinski
Yes, this trick is commonly used to share things (resources, code, shared memory) between apps by a common author. On Dec 26, 2012 6:53 PM, "Lew" wrote: > Lew wrote: > >> Erik wrote: >> >>> Lew wrote: I'm confused by your use of the terms "application" and "process" as different

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-27 Thread AndroidCompile
Thanks, tried it and it works... On Thursday, December 27, 2012 11:53:51 AM UTC+2, Massycat wrote: > > From the second app, you can create a Context that is the same as that of > the first app using createPackageContext(), > http://developer.android.com/reference/android/content/Context.html#cr

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-27 Thread Massycat
>From the second app, you can create a Context that is the same as that of the first app using createPackageContext(), http://developer.android.com/reference/android/content/Context.html#createPackageContext(java.lang.String, int) This Context will give access to the ClassLoader used by the fir

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-26 Thread Lew
Lew wrote: > Erik wrote: > >> Lew wrote: >>> >>> I'm confused by your use of the terms "application" and "process" as >>> different things. Each Android app runs in its own process. >> >> >> This is incorrect. Applications are allowed to share processes. See >> http://developer.android.com/gui

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-26 Thread Lew
Erik wrote: > Lew wrote: >> >> I'm confused by your use of the terms "application" and "process" as >> different things. Each Android app runs in its own process. > > > This is incorrect. Applications are allowed to share processes. See > http://developer.android.com/guide/components/fundament

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-26 Thread Erik
On Sunday, December 23, 2012 1:24:08 AM UTC-8, Lew wrote: > > I'm confused by your use of the terms "application" and "process" as > different things. Each Android app runs in its own process. This is incorrect. Applications are allowed to share processes. See http://developer.android.com/guide

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-23 Thread Chris Mawata
It has to do with class loaders is Java and not processes or applications. Java language: A class is identified by its fully qualified name Java Virtual Machine: A class object is identified by its fully qualified name and defining class loader Instances of classes loaded by the same classload

[android-developers] Re: Can two applications that run in the same process have different STATIC object values?

2012-12-23 Thread Lew
AndroidCompile wrote: > I created two Android applications that share the same user Id > (sharedUserId) as well as the same process. In the first app, on startup, I > set a static int variable to 1 (it's default is 0). In the second app, I > load (using reflection) the same class from the other