read/write text to sdcard lazarus / 43-Android ---------------------------------------------------------------------- Gerbert · 2012-04-30 06:58 Is it possible to read/write a string to a sdcard from a LCL android application? Do you have a example how to do this? Even better is it to work with xml. Is this possible to? ---------------------------------------------------------------------- felipemdc · 2012-04-30 07:26 The sdcard is a filesystem, not a database, so you cannot write a string there. You can write a file which constains a string. To do that you can use any of the Pascal file read/write operations. For example use TStringList and TStringList.SaveToFile()... I think that the path to the sdcard is /sdcard/ or something like that. ---------------------------------------------------------------------- Gerbert · 2012-05-03 05:34 Thanks felipemdc I have implemented the following (based on your great example): procedure TformLocatie.btnWriteDeviceInfoClick(Sender: TObject); var   slInfo:TStringList; begin   slInfo:=TStringList.Create;   slInfo.Add('Device.Manufacturer='+Device.Manufacturer);   slInfo.Add('Device.Model='+Device.Model);   slInfo.SaveToFile('/sdcard/test_gerbert.txt'); end; but when this code is executed the application crashes. I have set the following line in the androidmanifest.xml: (I use lazarus on openSuse 12.1) ---------------------------------------------------------------------- felipemdc · 2012-05-03 05:46 Quote from: Gerbert on May 03, 2012, 07:34:57 ambut when this code is executed the application crashes. Every time this happens you need to look at what "adb logcat" says. Read the log and see what it says and also post it here. Also use "adb shell" to navigate and see if /sdcard/ is the correct location. ---------------------------------------------------------------------- Gerbert · 2012-05-03 08:26 It seems my sdcard was not mounted after I disconnected the usb connection. After a reboot my device the code is executed successfully. Thanks.