save list to csv

droidman

Member
Licensed User
Longtime User
I listed all the contacts i have on the phone on a list, now i wanted to save the list to CSV but i always get errors on the emulator.
Dim su As StringUtils
su.SaveCSV(File.DirRootExternal, "1.csv", ",", table)
i'm doin'g it like on the tutorial's you have, with savecsv and savecsv2 and none seems to work. is it a bug on the emulator?
 

droidman

Member
Licensed User
Longtime User
my idea is to make a simple program that lists the person first and last name, and their e-mail from the user contact list, this will allow the person to export the list to CSV.
I can for now list all the names and e-mails but when it comes to saving it i simply do not understand how to do it.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
You haven't explained why your error concerns a ListView which has no relevance to SaveCSV. Perhaps you are confusing a List and a ListView which are different objects.

You probably need to zip your project with File -> Export As Zip and post it so someone can take a look.
 
Upvote 0

droidman

Member
Licensed User
Longtime User
You haven't explained why your error concerns a ListView which has no relevance to SaveCSV. Perhaps you are confusing a List and a ListView which are different objects.

You probably need to zip your project with File -> Export As Zip and post it so someone can take a look.

You are right about that, i didn't fully understand listview and list. now that part works properly.
now i add them like this:
list1.AddAll(Array As String (myContact.DisplayName, myContact.GetEmails))

and then i want to save when clicking the save button
su.SaveCSV2(File.DirRootExternal, "db.csv", ",", list1, Array As String("Name", "Email"))

all problems solved. now i just need to separate the cells with commas. probablly all those problems are just because i'm too new to this :D
also sory for my bad english.
one thing, when exporting on my mobile phone, the list is really huge, if i place a progressbar on the program, will it slide properly or will it just stuck untill the program finishes?
 
Upvote 0
Top