Android Question Question about design

Hirogens

Active Member
Licensed User
Longtime User
Hello, I use B4A and now (and thank your help) I start to know how works the language. But I have a small question about the design.

Where do you put your code for designing your app ? I would like to know the good practice. Actually I put all my design code in a module activity. So when my app had a lot of screen I will have a lot of Module Activity. Maybe some onecan share his experience about that point

Thanks =)
 

MarkusR

Well-Known Member
Licensed User
Longtime User
do you mean the functionality of your app?
i would put the most in classes.
avoid codeing in a event sub because u may need exact the same elsewhere.
helper functions that u just need to call in a code module.
 
Last edited:
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
That totally depends on what you mean by design code.
To tidy your code up a bit, I would use the Anchors and designer script as much as possible when feasible to do so, try not to repeat the same code multiple times, share your code through the code modules and classes, variables that are the same in multiple modules can be store on your Starter Module (this includes bitmaps(images), maps, strings etc), don't load the same image multiple times, keep subs and loops as short as possible, there's way to much to mention.

You say that you basically have one screen per activity which is correct, just try to keep everything nice, tidy and not repetitive.

Watch Erels videos called 'Code Modules and Classes' and also watch the 'Code Flow' video.

https://www.b4x.com/etp.html

Learn and enjoy...
 
Last edited:
Upvote 0
Top