Android Question Memory problem?

Tim Chapman

Active Member
Licensed User
Longtime User
My project is attached.
On line 203 is a sub that checks to see if a file exists. If not, it loads a 4400 line csv file and parses some lines out, then stores the result.
Then that resulting csv file is loaded back into memory.

If the file exists, it is loaded.

When the file is parsed and created, the subsequent displays in the tabview are messed up.
When the file is just loaded, there are not display problems.

When the problem occurs, the data in the lists of maps is corrupted even though it has been saved correctly to csv file. If it is then saved again to csv file, the file is corrupted.

I am guessing that this is some sort of memory issue. Any ideas?
 

Attachments

  • charsheet project.zip
    27 KB · Views: 238
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Unfortunately they are not in a position to help you when the app starts looking for a file in a folder (DND), you probably forgot to create the Startup folder. File.MakeDir(File.DirRootExternal,LoadDir)

Also if you can not find the file "MyClasses.csv" crashes. Or go ahead and post a first version or manage the lack of files.

B4X:
If FirstTime Then
        'Load MyClasses List from file.  Classes has to be loaded before stats because classes are added to the stats list when it is loaded.
        File.MakeDir(LoadDir)
        FileName = "MyClasses.csv"
        If File.Exists(LoadDir, FileName) Then
          
        Else
          
        End If
        REM ..........
End If

Fix these things so we can run it on the device and see how to help
 
Last edited:
Upvote 0

Tim Chapman

Active Member
Licensed User
Longtime User
Here is the entire project zipped up.
http://tinyurl.com/mzfp8f8 I have never posted a share on google drive before, so please let me know if you can't access it.
Put the dnd folder in dir root external.
To duplicate the problem, run it with those files. It will create MySpellBook.csv. The display will show things incorrectly like the first tab of stats will have null null as the 6th one down in the first column. The last two are supposed to be null so ignore those. Also, the headers on other tabs will be wrong and some tabs (spells tab) will have null lines in the list. Then if you close the code and reopen it, all is well because the spell book is already made. No resources are used when it is already made so everything works fine.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Ok, I managed to download it. But what should you do?

Upload the CSV file and put it in order and saves it sorted ..
The charge from the sorted file and is always a mess?

The order is based on what criteria?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Sorry but I do not speak English well, I use a translator. The trduzione is not always correct
 
Upvote 0

Tim Chapman

Active Member
Licensed User
Longtime User
I will verify that dim and initialize are done properly with all maps and lists, etc. and reply here with my findings. Thanks again for your help on this.
 
Upvote 0

Tim Chapman

Active Member
Licensed User
Longtime User
Thanks again Erel. I found one instance where I did not dim and initialize a map. Did that and poof! the problem was gone.
 
Upvote 0
Top