Android Question Application Architecture

msali

Member
Licensed User
Longtime User
Hi,
I am creating an application having multiple Activity.
actPlayer (data stored in SQLite)
actCourse (Data stored SQLite and details in OS file based on Map through RandomAccessFile)
actRound (???)

App user adds players and course and based on this stored information gets to the actRound.

actRound is the core of my app and is very complex with tons of information and lots of code
I know how i will be saving it, i.e., base info in SQLite and complex info as Map in OS file.

My question is regarding the architecture of the application.

What is the best place to write the code of saving this complex information.
Since the functionality code in actRound is complex and huge, I tried to add a code module and also a class module. But in those module i do not have access to the variables and Views (few added through designer and many added programmatically) that i have added in my actRound.
(Do not want to move variables to Process_Globals)

Just want to know the best practice and approach.

Regards & thanks in adv.
 

LucaMs

Expert
Licensed User
Longtime User
It is not very clear for me; I think that you do not want to revolutionize the design already done.
So???

I think that the best practice is to "delegate" all the db operations to a dedicated module.

Access to other activities' "objects" (variables, views, ...) can be done through function routines (sometimes called by CallSubDelayed)
 
Upvote 0

msali

Member
Licensed User
Longtime User
Ok so what do i have to do to pass on all my variables & views to another routine written in another module.
or how do i utilize the CallSubDelay?
 
Upvote 0

msali

Member
Licensed User
Longtime User
mc73: because there are tones of them (no issue in that) but mainly i have created many views programmatically. so do not know how to access them and data stored in them.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
mc73: because there are tones of them (no issue in that) but mainly i have created many views programmatically. so do not know how to access them and data stored in them.
When you move on from one activity to the other, store your data 'somewhere' (globalVars can be that, a db, a raf or whatever) and get them back to your next actiivity. You can think of it as a 'form' submiting data. Agree with LucaMs, by the way :)
 
Upvote 0
Top