O Omar Member Licensed User Longtime User May 25, 2011 #1 I just purchased B4A even though I'm very new to programming but this seems to be a good platform to learn and I was interested in developing for Android devices. I am sorry for the very basic question but I am still trying to grasp the syntax and layout of B4A. In particular I am trying to understand the ListView command as I have been able to use this from the example but I wanted to know how I can store data within the application itself and load that into the ListView. Will appreciate any help on this.
I just purchased B4A even though I'm very new to programming but this seems to be a good platform to learn and I was interested in developing for Android devices. I am sorry for the very basic question but I am still trying to grasp the syntax and layout of B4A. In particular I am trying to understand the ListView command as I have been able to use this from the example but I wanted to know how I can store data within the application itself and load that into the ListView. Will appreciate any help on this.
Erel B4X founder Staff member Licensed User Longtime User May 25, 2011 #2 Did you see the ListView tutorial: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6537-listview-tutorial.html You can store the data in many ways. The simplest way to store data is with a List (not ListView). You can use File.ReadList to read the data from a text file. Upvote 0
Did you see the ListView tutorial: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6537-listview-tutorial.html You can store the data in many ways. The simplest way to store data is with a List (not ListView). You can use File.ReadList to read the data from a text file.
O Omar Member Licensed User Longtime User May 25, 2011 #3 Thanks Erel. Appreciate your help. Yes, I did review the ListView tutorial, I was actually looking to store the data in the program file itself rather than load up from an external file. If this is not possible I will use the List option, thanks again. Upvote 0
Thanks Erel. Appreciate your help. Yes, I did review the ListView tutorial, I was actually looking to store the data in the program file itself rather than load up from an external file. If this is not possible I will use the List option, thanks again.
Erel B4X founder Staff member Licensed User Longtime User May 25, 2011 #4 You can write the data directly inside the code. Using a file will usually be easier to maintain. Upvote 0
O Omar Member Licensed User Longtime User May 25, 2011 #5 Thank you Erel. I appreciate the clarification. Upvote 0
O Omar Member Licensed User Longtime User May 26, 2011 #6 Hello, I proceeded with the external file option and am using the File.ReadList to input the data with the following: NamesList = File.ReadList(File.DirDefaultExternal, "list.txt") I have also added in my "list.txt" file into the project through the Files tab but I keep getting an error message stating: Last Exception jave.io.FileNotFoundException... On the emulator is also states "Program paused on line: 24 NamesList = File.ReadList(File.DirDefaultExternal, "list.txt")" I really cannot understand why this is occurring and will appreciate any help with this. Upvote 0
Hello, I proceeded with the external file option and am using the File.ReadList to input the data with the following: NamesList = File.ReadList(File.DirDefaultExternal, "list.txt") I have also added in my "list.txt" file into the project through the Files tab but I keep getting an error message stating: Last Exception jave.io.FileNotFoundException... On the emulator is also states "Program paused on line: 24 NamesList = File.ReadList(File.DirDefaultExternal, "list.txt")" I really cannot understand why this is occurring and will appreciate any help with this.
O Omar Member Licensed User Longtime User May 26, 2011 #7 Sorry please ignore the above. I have just figured out I should have used File.DirAssets instead of File.DirDefaultExternal Man do I feel foolish now :sign0104: Upvote 0
Sorry please ignore the above. I have just figured out I should have used File.DirAssets instead of File.DirDefaultExternal Man do I feel foolish now :sign0104:
agraham Expert Licensed User Longtime User May 26, 2011 #8 Omar said: I feel foolish now Click to expand... Is Foolish enjoying it? . Seriously, don't worry about it. We all make errors and wrong assumptions while learning (and even long after ), it's part of the process. Don''t let it put you off asking for more advice next time you are stuck. Upvote 0
Omar said: I feel foolish now Click to expand... Is Foolish enjoying it? . Seriously, don't worry about it. We all make errors and wrong assumptions while learning (and even long after ), it's part of the process. Don''t let it put you off asking for more advice next time you are stuck.
O Omar Member Licensed User Longtime User May 26, 2011 #9 agraham said: Is Foolish enjoying it? . Seriously, don't worry about it. We all make errors and wrong assumptions while learning (and even long after ), it's part of the process. Don''t let it put you off asking for more advice next time you are stuck. Click to expand... Thank you! I appreciate your kind words Upvote 0
agraham said: Is Foolish enjoying it? . Seriously, don't worry about it. We all make errors and wrong assumptions while learning (and even long after ), it's part of the process. Don''t let it put you off asking for more advice next time you are stuck. Click to expand... Thank you! I appreciate your kind words