View unanswered posts | View active topics



Reply to topic  [ 2 posts ] 
Include *.sqlite database in package on build 
Author Message
Member

Joined: Wed May 27, 2015 11:35 am
Posts: 11
Reply with quote
I have always assumed that this is a given and it just worked (it did in Flash Builder), but I have been struggling with a very basic issue for about 3 days now and it comes down to the fact that when I package my android app, the db.sqlite file is not included in the package, so when it is installed on the phone the code fails because the db doesn't exist to be copied.

Here is the abridged code that makes things happen, or not as the case may be:

Code:
var targetFile:File = File.applicationStorageDirectory.resolvePath("db.sqlite");
         var sampleFile:File = File.applicationDirectory.resolvePath("assets/database/db.sqlite");
         
         if ( !sampleFile.exists )
         {
            trace("sample file not exist");
            isSuccess = false;
         }else{
            trace("sample file exists");
            sampleFile.copyTo(targetFile);         
         }

The code fails because sampleFile is not present on the device, which is no surprise as it doesn't appear in the package either.

So can you please tell me how I get this file into the package please, Flex SDK 15, Air 20, latest build of FD, 64bit Windows 10.

Thanks
Shaine


Sat Sep 03, 2016 7:07 pm
Profile
Member

Joined: Wed May 27, 2015 11:35 am
Posts: 11
Reply with quote
Solved by copying the folder to the bin directory, I might need to edit some of the bat files to make this a little easier.

Thanks all~
Shaine


Sat Sep 03, 2016 7:22 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.