Using the documents folder in Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jason1234
Posts: 42
Joined: Sat Jun 18, 2011 9:20 am

Using the documents folder in Android

Post by Jason1234 » Sat Dec 31, 2011 12:29 am

I have been trying to get this to work and hopefully someone can advise where I am going wrong...

At the install settings on Android device I am trying to locate the SQLite database in the documents folder in Android so that I can open it.. apparently you can't open databases in the engine folder.

Following advice from various postings I found this is what I have done so far.

At the setting page see I have added the database file and set the Copy Referenced File to: specialFolderpath("documents") this is exactly what I entered so if this is incorrect syntax please let me now...

Also the code that then opens the database file that should have been installed in the correct location is:

Code: Select all

  if the environment is "mobile" then
         put specialFolderPath("documents") & "/fujserv.db" into pathNdb
          else
      set the itemDelimiter to "/"
      put item 1 to -2 of the effective filename of this stack into pathNdb
      put pathNdb & "/fujserv.db" into pathNdb
   end if
     
     ## Open a connection to the database
         put revOpenDatabase("sqlite", pathNdb, , , ,  ) into conID

       answer "Connected to: " & pathNdb & return & " conID is: " & conID
The database file is connecting but not the file I loaded but to a file created at runtime as not found.

Any help would be really appreciated as this has got me stumped. It is probably something basic again... :oops:

Regards

Jason
Windows / MAC / IOS / Android - Deployment
Build 5.5.4 / & Community Version 6.1

Jason1234
Posts: 42
Joined: Sat Jun 18, 2011 9:20 am

Re: Using the documents folder in Android

Post by Jason1234 » Sat Dec 31, 2011 12:54 am

Amazing.... finally found the post with the answer....

For anyone else..

http://forums.runrev.com/viewtopic.php? ... 809#p48809

Thanks & Kudos to the original poster!

I would still like to know the correct syntax for directly copying to the documents folder in Android when building the application...

Jason
Windows / MAC / IOS / Android - Deployment
Build 5.5.4 / & Community Version 6.1

Post Reply

Return to “Android Deployment”