backup android database lazarus / 43-Android ---------------------------------------------------------------------- kristof.project · 2021-04-26 22:05 hello, i found this code for copy my database but it not copy. database is present. the return code is "0" is dirDownloads need "permission" Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   test:=sel f.copyfile(Self.GetEnvironmentDirectoryPath(dirDatabase)+'/myData.db',  Self.GetEnvironmentDirectoryPath(dirDownloads)+'/recover.db'); showme ssage('status copy:'+booltostr(test));  thank ---------------------------------------------------------------------- shyub · 2021-04-27 03:52 If you are using Android 6 or higher, you need to get permission to access the file system. Take a look at the "AppOpenFileDialogDemo1" example. Include in your program the procedures "procedure TAndroidModule1.AndroidModule1JNIPrompt (Sender: TObject); procedure TAndroidModule1.AndroidModule1RequestPermissionResult (...". ---------------------------------------------------------------------- kristof.project · 2021-04-27 11:35 i'm using android 6 higher (target sdk29) so i use this in my Jform similar acces camera but no ask for granted Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFsignaler.FsignalerJNIPrompt(Sender: TObject);begin  Self.RequestRunt imePermission('android.permission.WRITE_EXTERNAL_STORAGE', 5001);end;  procedure TFsignaler.FsignalerRequestPermissionResult(Sender: TObject;  requestCode: integer; manifestPermission: string;  grantResult: TManifestPermissionResult);begin    if requestcode=5001 then      if grantResult = PERMISSION_GRANTED  then ShowMessage('autorisation carte sd ')        else ShowMessage('carte sd non autoriser');end; but if i understand WRITE_EXTERNAL_STORAGE will be out I not found a issu, at same for assets directory ---------------------------------------------------------------------- Mongkey · 2021-04-28 00:20 maybe you can try like this: permission granted copy your db. 1. make sure permission is granted (to make sure just read apps info, does it granted or not) 2. re check your db file 3. copy your db on dextination folder ---------------------------------------------------------------------- rsu333 · 2021-04-28 06:53 I have experience that jtextfilemanager can copy DBF files  to SD . So you can try it. ---------------------------------------------------------------------- kristof.project · 2021-04-28 07:56 Quote from: Mongkey on April 28, 2021, 02:20:58 ammaybe you can try like this: permission granted copy your db. 1. make sure permission is granted (to make sure just read apps info, does it granted or not) 2. re check your db file 3. copy your db on dextination folder can you share an example? thank ---------------------------------------------------------------------- Mongkey · 2021-04-28 08:04 U should read more sample n doing more practices, good apps consuming good effort too, mr. JM, mr. Adiv n contributors do a lot work providing samples n very easy to follow ,  . Key -> permissions, n availibility your file to be backed up. ---------------------------------------------------------------------- kristof.project · 2021-04-28 11:18 Quote from: Mongkey on April 28, 2021, 10:04:08 amU should read more sample n doing more practices, good apps consuming good effort too, mr. JM, mr. Adiv n contributors do a lot work providing samples n very easy to follow ,  . Key -> permissions, n availibility your file to be backed up. if ask for an example working, i have already searching example with my friend google, and try many time different example. si if i can found issu, i looking with a distant sql server ---------------------------------------------------------------------- Mongkey · 2021-04-28 12:25 Google not talking a lot about LAMW, samples provided are the best friend. ---------------------------------------------------------------------- rsu333 · 2021-04-28 14:50 For examples LAZARUS-LAMW>menu>tools>example project is best. For easy to understand Laz4andoid 2.0.0 is better than advance