App, with many blocks, helps

Hello Kodulers

I have a simple app in development, however, already published on the Play Store for general use. But I am having a big problem with block quantities. I haven’t even reached half of the App yet, and I already have 1990 blocks.

So, the reason for my post is that I would like to receive tips from you professionals, remembering that I am just a beginner, and reading a lot to learn more and more.
So, what should I do to make it more compact? Is there an extension to help with this?

offline app?

1 Like

Yes, I use TinyDB

1- Don’t add a lot of blocks to set every component property, make some methods, store data in database, use a loop instead.
2- Use dynamic components instead of the normal static components: [F/OS] - Dynamic Components Extension (for every component) 2.0

4 Likes

Thanks for the help friend.
Is this extension free?

1 Like

Yes it is, yo will find the download link at the end of the topic :wink:

1 Like

Thanks :wink:

1 Like

No panic! I think this is normal as beginner. At the moment I’m working on a project, what I started again for the third time.

First try: 20,000 blocks :scream:
Second try: 14,000 blocks :roll_eyes:
Now: 5,000 blocks at the moment (but I think I won’t need more than 10,000 blocks this time and I will have much more functionality than in the first and second try) :slight_smile:

What I want to say is:
1990 blocks are not necessarily a lot :slight_smile:

What I learned during these three tries is:

  • first make a plan of everthing you want in your app and then start programming :yum:
  • using many procedures
  • working with lists, working with lists and working with lists :wink:
  • the “split text … at …”-block is for the last point very helpfully
  • using “Any component”

best regards! :slight_smile:

2 Likes

Thanks for your comment. :heart_eyes: :wink:

It really requires a lot of study and work at the beginning.

1 Like

One thing I do to reduce blocks and simplify my code is this: Every time some code or group of blocks repeats, you make it a procedure and you replace that group of blocks with a call to that procedure. Even if it is for different components.
Example: If you need to delete many text boxes except one, you make a procedure that takes one text box as input (the one you want to keep) and set the others to " ". You need to use the Any Component blocks a lot. Also the generic events blocks helps a lot in reducing the blocks amount.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.