Android Question Conditional Compilation based on module level constant

ddk1

Member
Licensed User
I have a subroutine that needs to be in both an activity and a service. They are 99% the same just need tweaking based on which module they are in.
Is it possible to have module (meaning a Module,Service,Activity etc) level constant that could direct compilation.

example:
#Region  Service Attributes
    #const THISISMYSERVICE
#End Region

Sub MySub
    #if THISISMYSERVICE
        do this
    #end if
    #if THISISMYACTIVITY
        do that
    #end if
 
Top