android - Are main app and home widget live in the same memory space -


currently, in main app, have several threads, may perform read/write operation on flat file. avoid data corruption due simultaneous write, have public static countdownlatch avoid multiple threads modifying same file.

so far, works pretty well.

until recently, i'm developing home widget feature main app. in home widget (or multiple home widgets), there can multiple threads accessing same file too.

i wondering, main app & widgets inside same memory space? main app & widgets see public static countdownlatch one instance, or two instance.

so far, initial testing is, main app & widgets inside same memory space. see public static countdownlatch one instance. but, want ensure, there edge cases main app & widgets can see two instance?

i wondering, main app & widgets inside same memory space?

by default, yes, there 1 process. however, bear in mind process may terminated between when activity around , time later when app widget needs updated.

but, want ensure, there edge cases main app & widgets can see 2 instance?

that possible if running in separate processes. and, in case, totally separate threads well. nonetheless, separate processes should not happen accidentally.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -