What is the best way to create long lists in Kodular?

What is the best way to create long lists in Kodular?

store the list in a file comma separated like this

item1,item2,item3,item4

read it using the file component on first run of the app and convert it into a list using the list from csv row block, thn store the list in TinyDB for further use

alternatively store the list in a file like this

item1
item2
item3
item4

read it using the file component on first run of the app and convert it into a list using the split block, just split at \n (new line), then store the list in TinyDB for further use

Taifun

5 Likes

If i store data from app to split there was creating this symbol automatically () why??

Is there an example of how to do this in an aia or video?

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

yes, we will have this example after you tried the steps mentioned above and providing the corresponding screenshot in this thread

Taifun

@thivannucci What type of items? Text, Components, … ?

I talked a little about my problem in the tropics:

Text only.

your question here is misleading, because you did not provide any context
see my answer in your other thread here


Taifun

In that case, either from a File, or “list from csv row”:text1,text2,text3,xxxxxx

If your list contains online image or contains many items like 200 it will lag the device for some sec. I’m wondering how facebook manage to load in sec without any lags… just wondering.

This is how App Inventor lists works, if you try to convert a list to string, it shows brackets at the start and end. So you can know the object is a list.

Also split block is returns a list of items.

1 Like

Also if it returns (), your list is empty.

2 Likes

I Don’t want this then what i should do

  1. Why? You can use list blocks to get items from list.

  2. You can use replace text block from Text category and replace brackets with none. However, as items can contains brackets as character, I never recommend replacing brackets with none when working with lists.

3 Likes

unfortuantely you do not show any blocks… how should someone be able to help?

what about learning how to work with lists?

also you have a tendency to hijack other threads with your own questions… what about starting your own threads?

and I see you asking loads of very basic questions… what about doing some tutorials to learn the basics?

A very good way to learn App Inventor or Kodular is to read the free Inventor’s Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Tutorials for MIT App Inventor to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun

1 Like

Please explain it in blocks screenshots

welcome to the community!

please follow the links of my previous answer to learn the basics and after doing this and trying something yourself and there are still questions, then start a new thread and add a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
thank you

Taifun