Recommendations for the development of activities with a background service

My application has activity for the user interface and service for background polling. It looks like a standard rate.

  • Can AlarmManager trigger a service without activating the OnCreate function?

  • Is there any use for hosting Activity and Service in different applications? Will this create 2 apk and make it impossible to place on the Market as a single application? Can you put 2 applications in one manifest somehow?

  • Regarding the relationship between the two:

-If activity and maintenance are part of the same application - can I just store common objects (for example, a User object) in the application area for sending 2?

“It seems like I don’t even have to worry with AIDL - they can just have weak links to each other in the application area, and also - and they can call methods on each other this way?” Or should they be a pub / substitute for each other with some kind of observer or BroadcastListener broadcaster?

+3
source share
1 answer

Can AlarmManager trigger a service without activating the OnCreate function?

Yes.

Is there any use for hosting Activity and Service in different applications?

IMHO, no.

Can this create 2 apk and make it impossible to place in the Market as one application?

Yes.

Can you put 2 applications in one manifest somehow?

XML <application>. AFAIK .

Activity Service - (, User) 2?

, . , ( Android, ..), , Application poof. .

, AIDL

- .

,

. . , (, , Android- ).

/ - Observer Pattern BroadcastListener?

- . , .

+3

Source: https://habr.com/ru/post/1790127/


All Articles