Android Question HTTP and JobDone in a Code module?

Indy

Active Member
Licensed User
Longtime User
Hi All,

I was wondering whether it's at all possible to separate all my HTTP web services calls into a generic Code module? I find that having this code scattered in my Activities just makes the presentation look messy and unnecessarly lengthy.

Now, I have managed to move a test function over into a module. However, the first issue I got was the "Me" keyword is not available. Ok, I know why and the obvious thing to do here is call the function passing it the Activity reference. However, I can already see what the problem with this will be. Presumably the Job_Done event will have to be in the Activity which was referenced in the function call, correct? This would kind of defeat the object. So, are there any solutions or work-arounds to this?

Thanks
 

Indy

Active Member
Licensed User
Longtime User
Use a Service to handle all your httpjob things (incl. Jobdone sub)
Code modules cannot access activities.

Is there any CPU overhead to this approach? Can I just take my existing code and paste it into a Service module?

Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…