The new Book

170 views
Skip to first unread message
Assigned to ghica.va...@gmail.com by taifu...@gmail.com

osama sayar

unread,
May 12, 2017, 3:14:04 AM5/12/17
to MIT App Inventor Forum
Hi Ghica,
I am very sorry to disturb you.
I really tried very hard to fix the example to be as simple as possible.
Now I can play the sound from asset.
I hope this will be fine.
I appreciate of your help to let me grow up step by step. I didn't forget what you have done with me to let my apps works a very excellent.
Good luck.
Book.aia

osama sayar

unread,
May 12, 2017, 3:55:43 AM5/12/17
to MIT App Inventor Forum
I have added FormatDuration with page no.
Book_with_timer.aia

Ghica

unread,
May 12, 2017, 12:31:01 PM5/12/17
to MIT App Inventor Forum
I will only look at Book_with_timer.aia
Now, first you are going to add a Screen1.Initialize, which loads the first page and also the first sound file.

Then I need to see the specification of how a page relates to a sound file. We have discussed this before.
Call the new version:  Book_with_timer_2.aia

Post this, and we will continue. Maybe.
Cheers, Ghica.

osama sayar

unread,
May 12, 2017, 2:22:02 PM5/12/17
to MIT App Inventor Forum
It's ok now but I forgot how a page relates to a sound file.
Book_with_timer_2.aia

Ghica

unread,
May 12, 2017, 4:26:29 PM5/12/17
to MIT App Inventor Forum
If I have understood this correctly, this is what you want to implement:

There is a book of 600 pages, but only 4 in your example.
For each page there is a picture that shows the text of the page and a sound file that reads the text of the page.

This would be a lot easier if there would be a sound file for each page, but apparently each sound file covers several pages.
So, in addition to the name of the sound file, you must also know the starting point (in seconds) and the duration of reading that page, also in seconds.
Therefore, you could have a csv file that looks like this:

1, page1.jpjg, read1.mp3, 0, 64 (the sound file read1.mp3 starts at 0 and it takes 64 seconds to read page1)
2, page2.jpg, read1.mp3, 65, 70 (the sound file read1.mp3 starts at 65 and it takes 70 seconds to read page2)
3, page3.jpg, read2.mp3, 0, 35 (the sound file starts at 0 and it takes 64 seconds to read page1)
...
This is just an example. If you do it right now for 4 pages, you will be able to do it right too for 600 pages.

So, make a .csv file, load it as an asset and read it during Screen.Initialize. In the File.GotText, you create a list out of it in a global variable, then find the first pag and the first sound file, load the first page and sound file.
If you have done that, we will continue.
Cheers, Ghica.

osama sayar

unread,
May 12, 2017, 6:53:22 PM5/12/17
to MIT App Inventor Forum
I hope everything is fine right now in order to continue until the end. 

Book_with_timer_3.aia

Ghica

unread,
May 13, 2017, 4:58:29 AM5/13/17
to MIT App Inventor Forum

There is still a lot to learn for you.
Look at the initialize block. I attached it here. What is wrong with it?
Everything, except the last File2.ReadFrom.

The idea is that you now read from the csv file the name of the picture and the name of the sound file.
So, in the File2.GotText, read the first element of the list in global Reader_Timer into a new list, call it current_page_list
The second element of this list will be the page picture and the third element will be the sound file.
Set these and we will make the next step.

By the way set Plyply.source first to read1.mp3 and in the next line to read2.mp3, what would be the result of that?
The source will now be read2.mp3, which is not what you want, and the first statement was totally useless.

Waiting for your next version.
Cheers, Ghica.



osama sayar

unread,
May 13, 2017, 7:40:55 AM5/13/17
to MIT App Inventor Forum
I hope it is fine now.
Than you so much and good luck!
Book_with_timer_4.aia

osama sayar

unread,
May 13, 2017, 9:24:42 AM5/13/17
to MIT App Inventor Forum
Sorry, I've sent the last one with some mistakes.
Book_with_timer_4.aia

Ghica

unread,
May 13, 2017, 12:02:50 PM5/13/17
to MIT App Inventor Forum
Your last last-one has even more mistakes.
This is going to be your last chance. I was trying to do this in small pieces, in a way that you would understand what was happening. It is NOT working.

I told you that for the initialize you had, only the last block was right, and now that is the only one you are changing to somerthing wrong???
And, please explain to me what you were thinking when you coded the GotText block!!.
What to do now?

1. Look at these and make sure you understand it.
List Blocks, by Sajal Dutta:
http://www.imagnity.com/tutorials/app-inventor/list-blocks-on-app-inventor/

Chapter 19 of the App Inventor book:
http://www.appinventor.org/bookChapters/chapter19.pdf

Displaying a list:
http://ai2.appinventor.mit.edu/reference/other/displaylist.html

2. Look again at what I wrote in my previous post:
  • The idea is that you now read from the csv file the name of the picture and the name of the sound file. Therefore the only thing in Initialize should be the ReadFrom filename block (the last block you have now).
  • So, in the File2.GotText, read the first element of the list in global Reader_Timer (which you already had)  into a new list, call it current_page_list.
    Maybe I was not clear here. You should set global Reader_Timer to the text you received using list from csv table. Now you will have a list of lists, where each element describes a page in your book.
  • The first element of the list in Reader_Timer is a list and describes the first page. Therefore you should set global Current_Page_List selecting the first element of global Reader_Timer.
  • The second element of this list (global Current_PageList) will be the page picture. Set the Canvas1.BackgroundImage with this value.
  • And the third element will be the sound file. Set Plyply.Source with this value.
  • Do this. What you have achieved now is that you can set the first page, and only the first page.
You cannot switch to next pages yet. (well, your old stuff is still working, but that should be taken out and be replaced by a proper procedure, which takes it values from the data in global Reader_Timer (which has the csv file data).
And I am not going to tell you how to do it, until I see that you have done these steps right.

If you do this right I will explain also how to start the sound file at the right position, and the final step would be to go to the next page automatically, which was your original question.
But it cannot be done if you do not have the foundation right.

And as I said, this is your last chance, or I will really, surely give up. I am really not going to code this for you, because that would be unfair to people who could help you and ask money for it. And it goes way beyond the purpose of this forum.
And the main reason is that I do not want to hear from you again. Because you would be able to do it yourself.
Cheers, Ghica.

osama sayar

unread,
May 13, 2017, 5:12:29 PM5/13/17
to MIT App Inventor Forum
Thank you so much Ghica, 
I have read all now.
As I understood from you that I must take out all elements from initialize except file. In the GotText I've tried to fix it but I confused how can I make list for current_page_list and join it with page picture and mp3source.
I have done my best but I will try to overcome to solve the problem believe me.
Thank you
Book_with_timer_4.aia

osama sayar

unread,
May 13, 2017, 5:17:38 PM5/13/17
to MIT App Inventor Forum
I've tested the example and it works with both of the page and the sound.

Ghica

unread,
May 13, 2017, 5:31:32 PM5/13/17
to MIT App Inventor Forum
Fine. I cannot look at it now anymore and I have no time tomorrow.
I found a problem with the player extension, that I will try to get a solution for. But also for that it is too late now.
The problem is that you cannot use StartFrom without starting the player first, which makes it difficult to start on a new page in the middle of a sound file.

Cheers, Ghica.

Ghica

unread,
May 14, 2017, 7:33:45 AM5/14/17
to MIT App Inventor Forum
Here is the working app. Be happy with it.
What you have to do when you make this into a 600 page book, with the accompanying csv file, is to allow loading pictures and sound files from the web. I do not know whether the whole book will fit on your phone, in that case you could do preloading, as you already know how to do.
Cheers, Ghica.

Book_with_timer_4d.aia

osama sayar

unread,
May 14, 2017, 9:14:44 AM5/14/17
to MIT App Inventor Forum
Great job! Sure, I am very happy to see that app working in a reality. Thank you so much and I really appreciate of your help and support. I will do my best to be familiar with the new block and learn more in order to continue working until finish it.
Thank you Ghica. 

osama sayar

unread,
May 14, 2017, 3:51:38 PM5/14/17
to MIT App Inventor Forum
Hello Ghica,
I have added the slider successfully and everything is working fine as I want and it move very well with timer. The only thing I need now is, when I move the position in the slider from 0 to Min 29 and I just wait to change from page 1 to page 2 after reach the point of minute 30. Is it possible to let pages continue moving as set in csv.
Thank you Ghica 
Book_with_timer_7.aia

Ghica

unread,
May 15, 2017, 5:37:50 PM5/15/17
to mitappinv...@googlegroups.com
Osama,
You introduced a few errors in version 7: the page switching will not work correctly, because you switched in the csv file from duration on a page to maximun duration in the sound file.
In itself that is ok, but it requires changes.
Further, you re-introduced again all those global variables that should not be there, like pageList, timeList etc.

Finding the right page for a thumb position is rather hard. I think I have the right code now, but I need to do some testing (tomorrow, later on the day).
Cheers, Ghica.

osama sayar

unread,
May 16, 2017, 9:34:54 AM5/16/17
to MIT App Inventor Forum
Hello Ghica,
I have made some changes because I am trying to read files from csv after select reader and sura but it doesn't work at all.
I think there is some error in the way of making he csv. 
Thank you so much Ghica
Final_1.aia

Ghica

unread,
May 16, 2017, 11:09:30 AM5/16/17
to MIT App Inventor Forum
Osama,
You cannot do that in the current setup.
Right now there are pages and to a page a part of a sound file is associated.
I do not know how readers and sura's are associated to pages and sound files, but it would be possible to have different csv files, where you have a choice of reading a certain one using a list picker. And by the way, your .aia cannot work in the way you wanted, therefore I am not going to look at it. I said that you introduced bugs, for once believe me.

Here is an improved .aia
It does this:
At initialize it read a csv file (change that to your own again, I needed something different for testing). My test file looks like this:

1,page1.jpg,Read1.mp3,0,70
2,page2.jpg,Read1.mp3,70,300
3,page3.jpg,Read1.mp3,300,600
4,page4.jpg,Read2.mp3,0,150

As you can see: page numbers (which you actually do not need, but it s handy for easier reading), followed by an image file address, followed by the name of a sound file, then a starting point in the sound file and an end point in the sound file.

Then,
  • if you press play, the sound will start and the starting point
  • if you press stop, the sound stops and it you press play again, it will start at the starting point.
  • if playing, and the current position becomes largen than the end point for that pages, the next page will be shown and playing will continue. But if the next page has a different sound file, the new sound file will start playing.
  • If you move the thumb of the slider, the app will try to find the page that contains the right part of the sound. That may not exist and then a warning is show. If it exists the playing continues at that point.
  • If you swipe to another page, that page will be shown, but the sound stops if it was playing.
To get this right is horribly complicated, because of the interaction betwee swiping, sound files passing their endpoint and the thumb that can point anywhere. So, a bug may still be there. If that is the case, I will solve it, otherwise, you better be happy with what you have now.

Advice on multiple csv files: If you have multiple users for your app, it would be much better to have the csv files online and let your users download the right one when they need them.
Cheers, Ghica.
Book_with_timer_9.aia

osama sayar

unread,
May 16, 2017, 1:26:31 PM5/16/17
to MIT App Inventor Forum
Hello Ghica,

Thank you a lot for all the effort. To be honest with you, now I am facing a problem to add this .aia into my original app that I have built it. As you know that my original app have the csv files online and the users can download the right one he like and save it into their mobile and they can listen them again when they need them again without internet

I put the source files (4 pages and one sound)in the .aia asset for only one reader and two sura. Please save them in their location file://... in the mobile, because it must be loaded in the app. in order to test the csv.
What I need now is just how to make the .csv in a proper way.
I have made an example of .csv Reader_Source.
Your help is highly appreciated.
Good luck!
Final_1.aia

osama sayar

unread,
May 16, 2017, 2:31:57 PM5/16/17
to MIT App Inventor Forum
I have tested  Book_with_timer_9.aia . It works very well as I was thinking about and more professional. And also you have fixed the problem when change the page and slide move at any point with sound and page.
Thank you so much Ghica:)
Now I just need to add many readers in different .csv. please if you don't mind.

Ghica

unread,
May 16, 2017, 3:50:36 PM5/16/17
to MIT App Inventor Forum
Each reader has his own csv and each csv has 600 lines for 600 pages?
How many readers are there in one app?
Cheers, Ghica

osama sayar

unread,
May 16, 2017, 3:59:41 PM5/16/17
to MIT App Inventor Forum
In fact, It's around 12 or fifteen readers.

osama sayar

unread,
May 16, 2017, 4:01:57 PM5/16/17
to MIT App Inventor Forum

Ghica

unread,
May 16, 2017, 5:51:32 PM5/16/17
to MIT App Inventor Forum
If I understand this well, each reader is a user of your app. And each user has his own csv file.
What you need to find is a way for a user to download a csv file from some place online.
Once your user downloaded it, you can read it in the app and use it in the same way as the built-in csv file.
You really do not want listpickers with reader names, because each user needs only one csv.
Cheers, Ghica.

osama sayar

unread,
May 17, 2017, 1:10:00 AM5/17/17
to MIT App Inventor Forum
Good morning Ghica,

No, a user is not a reader.
What I mean:
The reader is (Player of the sound) and the Sura is a section or a chapter(It could be only 1 page or two pages....).
Therefore, the user can choose one Player and one chapter he likes to listen from the list (Player)and list of list(Sura)
I am really sorry to bother you and making you confuse.

Ghica

unread,
May 17, 2017, 3:21:06 AM5/17/17
to MIT App Inventor Forum
The only thing that bothers me is how to get rid of you, but I do not want to leave you in the cold.

Please provide an example of these lists, from which I can see what the user can choose and what the resulting csv file to play will be.
Cheers, Ghica.

osama sayar

unread,
May 17, 2017, 4:03:25 AM5/17/17
to MIT App Inventor Forum
Hello Ghica,
I really appreciate of saying your feeling. Believe me I will pray for you in my life to be succeed in your life and be very happy.

Best wishes
Pick_sura_from_csv.aia

Ghica

unread,
May 17, 2017, 11:48:17 AM5/17/17
to MIT App Inventor Forum

I am touched.
Before you start, give me a real example and a description what needs to be done when you have chosen Ali Amir as Reader and Sura2 as sura.
  1. I have told you this before, but when the initialize blocks are executed, you could not have made a selection yet, and you will try to read //0Reader_Source.csv, which does not exist and you may get an error.
  2. So, I have chosen Ali Amir. How is this going to work in your PlayStore version?? Are you going to have the names of 15 people fixed in your app? I think you cannot do that. I would have a privacy concern with that.
  3. The choice of Ali Amir  causes the reading of file: //1Reader_URL.csv. This file looks like:
    1,https://drive.google.com/file/d/0B6tIqrqfHzcnc0hzMFFDU3lfMFE/view?usp=sharing
    2,https://drive.google.com/file/d/0B6tIqrqfHzcndG94RVJBdzNrMzg/view?usp=sharing
    ...

    I think these are sound files, but I cannot download them, because Google thinks they are too large and does not want to scan them, which is a security concern. And there is no action using them. What is their purpose?
  4. When the file is read, another file is read: //1Reader_Source.csv. This looks like:
    1,file:///mnt/sdcard/download/110401.mp3
    2,file:///mnt/sdcard/download/110402.mp3
    These are also sound files, what relation do they have to the URL file?

  5. Now I am choosing a sura: Sura2. Apparently this determines the sound file to be played. I am choosing yes to download the file, but as said, that does not happen, so I am stuck here.
  6. Now the big question: how are these sound files going to be related to the page images? And to the time a page has to be displayed?
Please answer each question.
Cheers, Ghica.

osama sayar

unread,
May 17, 2017, 3:40:14 PM5/17/17
to MIT App Inventor Forum

2- Yes, there are 15 readers each reader has one .csv, I attached the screen for download the sound.

3-The URL csv. is just for download the sound at first time and put it in file location in Android. so, after download the file, the user can select the same reader and the same sura that he had download it and he just need to press play button and directly open page 2 and sura 2.

4-URL is a link that need to be downloaded at first time and :
1,file:///mnt/sdcard/download/110401.mp3
2,file:///mnt/sdcard/download/110402.mp3
are file location of suras.

5- After select sura1 it will open the google sound screen which is the same as attached file: just from the top menu select download the file. after download the file you can press the play button. There is no scan security.

6- Each reader(has sura 1 and sura 2,... sura 114). I mean there are 15 readers and all of them can read the same sura in the list but not at the same time. It depend on the user choice. The book has 600 pages and 114 suras

I only put 4 pages in the example to be easy to read.

What I want is when select reader1  Ali Amir and select sura1 read .csv :

1, page1.jpjg, 110401.mp3, 0, 64 
2, page2.jpg, 110401.mp3, 65, 70 
3, page3.jpg, 110401.mp3, 0, 35 

when select reader 2 and sura1 read .csv:

1, page1.jpjg, 210402.mp3, 0, 90 
2, page2.jpg, 210402.mp3, 90, 170
3, page3.jpg, 210402.mp3, 170, 200 

and so on.....

So, each reader has different .csv



2.png
Book_with_timer_10.aia

osama sayar

unread,
May 17, 2017, 4:15:33 PM5/17/17
to MIT App Inventor Forum
I have tried to prepare .csv for 1reader: and put the path of pages and sounds file location:
1,
2,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page2.jpg,file:///mnt/sdcard/download/110402.mp3,0,8
3,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page3.jpg,file:///mnt/sdcard/download/110402.mp3,8,12
4,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page4.jpg,file:///mnt/sdcard/download/110402.mp3,15,18
5,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page5.jpg,file:///mnt/sdcard/download/110402.mp3,18,20
6,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page6.jpg,file:///mnt/sdcard/download/110402.mp3,20,22

but It didn't read .csv

osama sayar

unread,
May 17, 2017, 4:24:41 PM5/17/17
to MIT App Inventor Forum

Ghica

unread,
May 18, 2017, 5:30:33 AM5/18/17
to MIT App Inventor Forum
Osama, I am really crying right now.
Did you not see the error message:

Select list item: Attempt to get item number 3 of a list of length 2: (1 *empty-string*)
Note: You will not see another error reported for 5 seconds.

??
Did you not wonder what caused that?
For example the .csv file you are trying to load??


1,











2,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page2.jpg,file:///mnt/sdcard/download/110402.mp3,0,8
3,file:///mnt/sdcard/Android/obb/do-not-delete/webprefetch-drive/page3.jpg,file:///mnt/sdcard/download/110402.mp3,8,12
...

???

Then, I told you at least twice that ListPicker_Sura.SelectionIndex has the value 0 during Screen.Initialize and therefore that you cannot read //0Reader_Source.csv ????

And, I deleted at least twice all global variables you do not need, like global pageList (the page names are in the csv file, but if you must, you can easily create the image name by joining "page", index number and ".jpg". Now you must have spent considerable time creating this list of 600 elements that is not used. Why? Why?? Why???

Finally, Do you know the KISS principle: Keep It Simple, Stupid? This is a well known principle in software that if something becomes very complicated, something must be wrong.
This is really true for your design. And besides that, your app is not extensible, you will have a hell of a time to get all these csv files right, you can never add new readers or change anything to the csv files once your app is released.

Instead, you could have a setup, where your readers can choose a sura from an online list. You could keep their choice in a TinyDB on their phone, you could even remember which position they are, so when they start the app, you can continue where they left off. And you can fix problems online, without needing to release a new app.

Crying, Ghica.

osama sayar

unread,
May 18, 2017, 9:02:38 AM5/18/17
to MIT App Inventor Forum
I have seen the message:
Select list item: Attempt to get item number 3 of a list of length 2: (1 *empty-string*)
Note: You will not see another error reported for 5 seconds.

Now I returned to the version you have done in order to solve the problem to prevent bugs and put blocks that were in last version. I am thinking how can I make .csv in the proper way. I have put example of sound in the media asset 110401 
Book_with_timer_9.aia

Ghica

unread,
May 18, 2017, 10:19:43 AM5/18/17
to MIT App Inventor Forum
For now, I have given you enough answers. Cheers, Ghica.

osama sayar

unread,
May 18, 2017, 11:25:19 AM5/18/17
to MIT App Inventor Forum
Hi Ghica,
I am really don't know what to do and I feel that I am stuck and can't do anything without you. But I have got an idea in order to not lose it. What about if I want only for one reader. Is it possible to make .csv for. If it is yes, how it could be done. I am really seek your help. 

Ghica

unread,
May 18, 2017, 12:56:26 PM5/18/17
to MIT App Inventor Forum
Your path will be enlightened by what you already know and what you already have.
Think. Ghica

osama sayar

unread,
May 18, 2017, 2:07:42 PM5/18/17
to mitappinv...@googlegroups.com
Yes, you are right Ghica,
... text removed ...I have done it very well. ...text removed...
But ... text removed .. how it can be with many readers. Can you please give hint please. ... text removed ..?

osama sayar

unread,
May 18, 2017, 3:57:26 PM5/18/17
to MIT App Inventor Forum
I have tried so many times. but unfortunately, I could not make .csv for two readers. I have given up.
Please Ghica help me if you don't mind. 
pass_1_test1.aia

Ghica

unread,
May 19, 2017, 4:02:21 AM5/19/17
to MIT App Inventor Forum
I have removed parts of a previous post of your, because I think it was inappropriate.

Do very well again and realize that you need 2 csv files for 2 readers.
Cheers, Ghica.

osama sayar

unread,
May 19, 2017, 9:17:39 AM5/19/17
to MIT App Inventor Forum
Hello Ghica, I have add some blocks in btnplay and I have replaced some blocks for Got file. Still, it doesn't work.
I have prepared .csv for reader 2 just changed from file 110401 to 110402
I don't know what to do to make works in a proper way.
pass_2.aia

Ghica

unread,
May 19, 2017, 9:42:53 AM5/19/17
to MIT App Inventor Forum
Let the user make a choice at startup which csv to use. You already know how to do that.
The csv can be a Google-doc that you download when needed, or a csv file as asset. For both options you already know how to do it.
Cheers, Ghica.

osama sayar

unread,
May 19, 2017, 11:21:51 AM5/19/17
to MIT App Inventor Forum
Ghica,
I really have got tired because I didn't think it would be so difficult like this. I thought it would be so easy like the version of only one reader. Please help me if you don't mind.
I really sorry to bother you so much.

Ghica

unread,
May 19, 2017, 12:08:56 PM5/19/17
to MIT App Inventor Forum
I do mind and there is really nothing difficult about this.
You have a working app with one reader which is represented by one csv file. This one csv file is loaded during Screen1.Initialize.
However, if you have 2 (or more) csv files, instead of directly loading that file, you must make a choice first.
  • For 2 readers you have 2 csv files.
  • Load them both in your app with different names, like you did before, as 1ReaderTimer.csv and 2ReaderTimer.csv
  • Now, make a ListPicker with as elements Reader 1 and Reder 2, or whatever name you like.
  • Open this listpicker at Screen1.Initialize.
  • In the afterPicking you join the index number with ReaderTimer.csv and read that file as File2
  • Everything should work the same as before now.
You have all done this before. If you have a problem, read this again. Debug using DoIt if needed, and then try again.
Be proud of yourself that you can do this.
Cheers, Ghica.

osama sayar

unread,
May 19, 2017, 1:11:44 PM5/19/17
to MIT App Inventor Forum


Thank you so much Ghica for giving me a good chance to complete the code. I am so happy of that.
I've done what you told me but I thing I missed something.
Reader_csv.png

osama sayar

unread,
May 19, 2017, 3:12:34 PM5/19/17
to MIT App Inventor Forum
Ghica,
I am still struggling to solve my problem but unfortunately I could not solve it.
pass_S1.aia

Ghica

unread,
May 19, 2017, 3:32:19 PM5/19/17
to MIT App Inventor Forum
Since when do you give up?
Read my previous post again. And why are you reading a file in Screen1.Initialize, while you do not know which file to read?
Cheers, Ghica

osama sayar

unread,
May 19, 2017, 4:38:44 PM5/19/17
to MIT App Inventor Forum
Yeeeeeeeeeees. Finally, I have done it but after I let sick from me:)
Thank you thank  you thank you very much Ghica. I don't know how can I give a gift for that. You really deserve a very big gift.
Good luck my firend:)
I really appreciate of all of your effort and I am so happy and I will not give up to improve myself.

Ghica

unread,
May 19, 2017, 4:52:19 PM5/19/17
to MIT App Inventor Forum
Congratulations!
Cheers, Ghica

osama sayar

unread,
May 20, 2017, 9:49:49 AM5/20/17
to MIT App Inventor Forum
Hello Ghica,
I am stuck again in building .csv for URL file in case the file mp3 is not available there is 
choice to download it by the user.
Please I need help when you are free tomorrow or after tomorrow. I am not in harry.
FILE_FIND.aia

Ghica

unread,
May 20, 2017, 3:45:05 PM5/20/17
to MIT App Inventor Forum
Osama,
You are grown up now and it is time to go on your own.

Just a last hint:
You already know how to download mp3 files, the only problem is that you need to know which one you need.
One possible solution is to add the name of the online mp3 file as last element on each line of the csv.
If the local mp3 file is not found, you can now easily find the name of the online file and download it.
When done, you continue with using the file, which is now local.

Good luck,
Ghica.

Ghica

unread,
May 20, 2017, 3:56:17 PM5/20/17
to MIT App Inventor Forum
A last last hint:
Of course a better solution is to have a special csv file that looks like this:

localfilename1, onlinefilename1
localfilename2, onlinefilename2
...

You read this file at app start up in some list of lists and when you need an onlinefilename, you use lookup in pairs from the list blocks.
Cheers, Ghica.

osama sayar

unread,
May 20, 2017, 7:12:42 PM5/20/17
to MIT App Inventor Forum
I am afraid that you will close the door on me and don't help me again. But believe me I tried so many times. I really  don't know how to make the block on pair. You believe or not, every time I think to give up and stop asking you but I don't want to lose it because I liked this version too much and I can't stop develop it. So, I do my best as I can.

Ghica

unread,
May 21, 2017, 4:03:55 AM5/21/17
to MIT App Inventor Forum
Osama,
Yes, I am going to stop helping you. I went way over the limit as a volunteer in this forum to help people to begin with App Inventor, or to help solve occasional programming problems. And I made sure that you have a version of your app that you can work with.

I really believe that you are doing you best, but maybe you should try other ways to get further.

What can you do?
1. Use my other solution. It is more work to add all the filenames to yous csv files, but you know how to do it.
2. Or, be more inventive. Type this into your browser: app inventor lookup in pairs, or  use this link directly: https://www.google.nl/search?q=app+inventor+lookup+in+pairs&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=vD8hWajIBKnVXsOOgbAF
3. Or, Create a small example, just with a part of your csv file with local and online mp3 files, try to sovle it, and if you have a problem, post your lookup in pairs example in a new thread, explaining what does not work. Just saying help! will not encourage people to help you.
4. Or, not everybodys talents are best used by learning to be an app developer. That is fine as long as you recognize it. You are very tenacious and that is a great virtue. You could try to get paid help to develop your app. It does not need to be expensive: prices vary from $10-$25 per hour. You could post a request for help in a new thread on this forum, saying that you are willing to pay for the help. To save you money, I will be willing to explain to that person how your current version of the app works and what needs to be done.

Ghica.

osama sayar

unread,
May 21, 2017, 8:57:16 AM5/21/17
to MIT App Inventor Forum
Ghica,

Believe me I am stuck to a little. But in the other hand I am very happy with it because it is a new invention, that is why I am facing a little difficulty to deal with it and I am telling you my feeling in honest way. Now, I have new issue with the list.
I have decided to solve this issue first instead of onlinefile download because I think it is more important.
I put a small example :suppose I need to go to page 10 in the listpicker instead of swipe page by page. Kindly, see why it doesn't work as I planed.
Thank you.
go_to_page.png
list.csv

Ghica

unread,
May 21, 2017, 9:27:06 AM5/21/17
to MIT App Inventor Forum
You might want to read my last post again.
Cheers, Ghica

osama sayar

unread,
May 21, 2017, 11:00:43 AM5/21/17
to MIT App Inventor Forum
Yes, I read it again.
I will try to think about it and solve it.
I don't have any other choice to do except that I accept the situation. what can I do!
Thank you Ghica and good luck my friend!
Reply all
Reply to author
Forward
0 new messages