Path to .csv

43 views
Skip to first unread message

Loama Dyrein

unread,
Oct 24, 2019, 10:26:24 AM10/24/19
to MIT App Inventor Forum
Hello all,
How can I read .csv from App inventor asset in web view by using html
blocks.png
asset.png

TimAI2

unread,
Oct 24, 2019, 10:35:42 AM10/24/19
to MIT App Inventor Forum
No path or a full path

e.g.

splitnew.csv

or

file:///mnt/sdcard/AppInventor/assets/splitnew.csv  (for development in companion)

The first one is easier, and assumes that the html file is in the same folder

Loama Dyrein

unread,
Oct 24, 2019, 11:25:04 AM10/24/19
to MIT App Inventor Forum
Hi Tim,

I tried to put file:///mnt/sdcard/AppInventor/assets/ but it was not reading the text in csv.
Please check what is wrong.
Thank you Tim

TimAI2

unread,
Oct 24, 2019, 11:33:08 AM10/24/19
to MIT App Inventor Forum
Osama

There is nothing in the html file to call a csv ?

Loama Dyrein

unread,
Oct 24, 2019, 11:50:29 AM10/24/19
to MIT App Inventor Forum
I put them in in the asset.

I am sorry I am Dyrein.
block2.png

TimAI2

unread,
Oct 24, 2019, 12:00:16 PM10/24/19
to MIT App Inventor Forum
It would help to understand exactly what your are trying to achieve with your project, to make it easier to guide you, rather than jumping from point to point.

Please explain in detail your project workflow....

Loama Dyrein

unread,
Oct 24, 2019, 12:15:43 PM10/24/19
to MIT App Inventor Forum


Hi Tim,

I want to add a filterbar to Listview to type two or three letters of name and give me some hints then select one of them then GoTo exact text in the Webviewer.
For example I want to GoTo Text which  called 4. Pic alnsah I should just type Pic in filter bar then give me the full name and select it then open the text in Webviewer.

Thank you 

TimAI2

unread,
Oct 24, 2019, 12:38:32 PM10/24/19
to MIT App Inventor Forum
Why do you need to open the text in a webviewer ?

You can simply use a label to do that. If a long text then a scrolling arrangement can be added.

Why are your "texts" in csv files. There is no needs for that, just plain text files will do?

Are the "csv" files in your aia project examples of your final texts - they are a bit odd ?

This all feels very familiar......

Loama Dyrein

unread,
Oct 24, 2019, 12:49:14 PM10/24/19
to MIT App Inventor Forum
Hi Tim,

I open the text in a webviewer  because I have already a very huge project that has been already finished and I want to make only this way. And the csv in the asset is just an example and it is not a real csv that I have.

TimAI2

unread,
Oct 24, 2019, 1:17:51 PM10/24/19
to MIT App Inventor Forum
Are you saying you already have a project that opens csv files in a webviewer ?
Why do you need to know how to do it again?

TimAI2

unread,
Oct 24, 2019, 1:26:17 PM10/24/19
to MIT App Inventor Forum
Attached is a simple example of how to add text from a text file to html

I have used live html (data:text/html,) as opposed to an html file, but the principle is the same 
addtexttohtml.aia

Loama Dyrein

unread,
Oct 24, 2019, 1:53:12 PM10/24/19
to MIT App Inventor Forum
Hello Tim,

I said in the above that :

I want to add a filterbar to Listview to type two or three letters of name and give me some hints then select one of them then GoTo exact text in the Webviewer.

For example I want to GoTo Text which  called 4. Pic alnsah I should just type Pic in filter bar then give me the full name and select it then open the text in Webviewer 

Exactly like the one you have made it before but instead of return values I need to returns the contents of csv in webviewer just by using filterbar


Please help me because I tried hard to find the solution but it was a very difficult to apply it on my project.
Thank you.


TimAI2

unread,
Oct 24, 2019, 2:11:19 PM10/24/19
to MIT App Inventor Forum
You have all the parts, you just need to join them together.

The selection from the listview produces the filename

Include this filename with the correct path to the html constructor and you have it

That is the solution. Actually not all that different from the solution in your big project.

Loama Dyrein

unread,
Oct 24, 2019, 2:18:48 PM10/24/19
to MIT App Inventor Forum
I know that it is easy but for you not me. Believe me that I killed myself to know I can join them together but I failed. That is why I asked in the forum. 

Loama Dyrein

unread,
Oct 24, 2019, 3:01:12 PM10/24/19
to MIT App Inventor Forum
I promise you that I will try again.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages