android - ContentProvider vs. using AIDL/Messenger -
i want develop application supports plugins , provides data these plugins. seems me correct way implement plugin-archtitecture on android 1 apk main app , 1 apk per plugin.
but main app , every plugin in different apks can't pass (data) objects 1 other, applications run in different processes , if run in 1 process (which can achieved) have different classloaders , doesn't work. see 2 promising approaches getting data main app plugins:
- declaring main app
contentprovider
. seems me intended approach because want achieve: providing content/data process. - making data objects
parcelable
, pushing them aroundaidl
or - if not need multithreading -messenger
-approach. in opinion, approach seems easier because can use orm-library cares database in background. never used contentproviders before @ first @ thought using contentprovider bit building sql-queries hand (please tell me if i'm wrong), , avoid work!
now know if missed pros or cons , if there notable performance differences between these 2 approaches. , solution prefer , why so?
thanks in advance! replies appreciated!
content provider way share data (that stored in different ways [database, files , on]) between applications. if want share data between application best way this.
however, if want services perform tasks data (for instance, sum several values provided you) it's better have remote service.
in general case, application - plugin interaction more similar remote service. in case main application exposes remote service (an api of application) can used plugins perform actions.
Comments
Post a Comment