Android Question Understanding different modules

JamesGreaves

Active Member
Licensed User
Could someone please summaries difference between each type of Module and their uses:
Activity Module
Class Module
Code Module
Service Module
 

Cableguy

Expert
Licensed User
Could someone please summaries difference between each type of Module and their uses:
Activity Module
Class Module
Code Module
Service Module
Activity Module is a UI module, in which you can manipulate the screen and different controls. Each activity controls 1 "screen" or form, and you can have as many as you need.
Class module is a reusable class. i.e. you can create a custom control using a class and use it (several references to it) in many forms. A class can also deal with events triggered from the controls used in the class.
Code module can be used as a "commonly used" code repository... Imagine you have a long calculation to do several times in your app... You create a code module with that calculation and you call it from whichever class or activity you which. Code modules cannot interact directly with the UI.
Service module is like a listener.. it gets executed at appstart and stays active untill either the OS or your app kills it. It is usually used to wait for external events, like incoming notifications and such.
 

JamesGreaves

Active Member
Licensed User
Activity Module is a UI module, in which you can manipulate the screen and different controls. Each activity controls 1 "screen" or form, and you can have as many as you need.
Class module is a reusable class. i.e. you can create a custom control using a class and use it (several references to it) in many forms. A class can also deal with events triggered from the controls used in the class.
Code module can be used as a "commonly used" code repository... Imagine you have a long calculation to do several times in your app... You create a code module with that calculation and you call it from whichever class or activity you which. Code modules cannot interact directly with the UI.
Service module is like a listener.. it gets executed at appstart and stays active untill either the OS or your app kills it. It is usually used to wait for external events, like incoming notifications and such.
Thanks @Cableguy That gives me a pretty good overview. Very helpful, just what I needed.
*****
 
Top