LAMW: Where does save myData.db in SQLite ? lazarus / 43-Android ---------------------------------------------------------------------- majid.ebru · 2017-01-31 11:25 hi i use "AppSqliteDemo1". Where does save myData.db in SQLite ? ------------------------ jSqliteDataAccess1.OpenOrCreate(jSqliteDataAccess1.DataBaseName);  // myData.db ---------------------------------------------------------------------- jmpessoa · 2017-01-31 18:44 This code will create/open 'myData.db' in internal app storage ["...../file/database"] 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     jSqliteDataAccess1.OpenOrCreate(jSqliteDataAccess1.DataBaseName);  // myData.db  You can test/find the path with this code: 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 TAndroidModule1.jButton1Click(Sender: TObject);var  pathToDB: string;begin   pathToDB:=Self.GetEnvironmentDirectoryPath(dirDatabase);   ShowMessage(pathToDB);     //copy   'myData.db' to directory download    Self.CopyFile(pathToDB + '/' + 'myData.db' , Self.GetEnvironmentDirectoryPath(dirDownloads) + '/' + 'myData.db');     end; ---------------------------------------------------------------------- majid.ebru · 2017-02-02 05:20 this code worked. thank you Quote from: jmpessoa on January 31, 2017, 07:44:38 pmCode: 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 TAndroidModule1.jButton1Click(Sender: TObject);var  pathToDB: string;begin   pathToDB:=Self.GetEnvironmentDirectoryPath(dirDatabase);   ShowMessage(pathToDB);     //copy   'myData.db' to directory download    Self.CopyFile(pathToDB + '/' + 'myData.db' , Self.GetEnvironmentDirectoryPath(dirDownloads) + '/' + 'myData.db');     end; ---------------------------------------------------------------------- majid.ebru · 2017-02-02 05:21 how can i just open file ( myDate.db)? or how can i just Create file ( myDate.db)? or how can i control that file is exist? Quote from: jmpessoa on January 31, 2017, 07:44:38 pmThis code will create/open 'myData.db' in internal app storage ["...../file/database"] 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     jSqliteDataAccess1.OpenOrCreate(jSqliteDataAccess1.DataBaseName);  // myData.db ---------------------------------------------------------------------- Handoko · 2017-02-02 05:57 I'm not good about it. But I think you maybe will be interested to see the example codes of using Sqlite on LAMW: [your_lamw_directory]\trunk\demos\Eclipse\AppSqliteDemo1 [your_lamw_directory]\trunk\demos\Eclipse\AppSqliteDemo2 ---------------------------------------------------------------------- jmpessoa · 2017-02-03 00:50 Please, try: 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 TAndroidModule1.jButton1Click(Sender: TObject);var  dbExists: boolean;begin   dbExists:= jSqliteDataAccess1.CheckDataBaseExistsByName('myData.db');   if  dbExists = True then       ShowMessage('Data Base Exists!')    else    ShowMessage('Sorry... Data Base Not Found...'); end; ---------------------------------------------------------------------- FerCastro · 2017-04-23 19:54 Hello I am trying to open/create the database on the OnCreate method but when I try this my app hangs. I am trying to create my database, and the access to my data with my app. Is it possible open/create the database but not with a button? Thanks in advance FerCastro ---------------------------------------------------------------------- jmpessoa · 2017-04-23 20:03 Hello  FerCastro! The "OnCreate" handle only pascal code initialization.... Use "OnJINPrompt" to init all android stuff .... ---------------------------------------------------------------------- FerCastro · 2017-04-25 19:01 Hello jmpessoa, and thanks a lot for Your help. I am trying to create an app that uses a salite database, but without buttons to create/open database/tabes Actually I use your code of the SQLite Demo 1 in order to crate the objects. As you suggested in your last post, I use the OnJNIPrompt Method to invoke the creation of database and table, but when i run in my mobile I never get the last showmessage. I attach one image of the message window. Is there something I am missing? Regards!! 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 TAndroidModule1.OnJNIPrompt(Sender: TObject);begin  Access.OpenOrCreate('Data.db');  Access.CreateTable('CREATE TABLE IF  NOT EXISTS '+ FTableName +'(_ID INTEGER PRIMARY KEY AUTOINCREMENT, TITLE   TEXT,AUTHOR TEXT, COUNT INTEGER, FIGURE BLOB);');  ShowMessage('table created!');end; ---------------------------------------------------------------------- jmpessoa · 2017-04-25 19:43 Hello Fer! This "ShowMessage" is too fast!   [android "Toast"] try: gApp.ShowMessage()....     [more like Lazarus ....]