Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Problem with Air for android connect sqlite?

New Here ,
Oct 31, 2010 Oct 31, 2010

I found sample use air connect sqlite from this website http://www.flashmove.com/forum/showthread.php?t=34778

I copy that code in  a new Air for Android Templates.

then I tested in desktop was ok.I can do query,update,delete.....

but in Android emulator  was fail.it couldn't connect to my sqlite file.

the image below I check my device data  that can't find sqlite file  inside.but I'm sure I pack sqlite file when publish apk. 

a1.JPG

can someone tell me how to connect sqlite correctly?Appeciately.

TOPICS
Development
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Nov 03, 2010 Nov 03, 2010

First, never use the nativePath property of File.applicationDirectory (as the example does). This isn't supported on Android. You get an empty string. While you could usually bypass the write-restrictions on te application directory using this technique on the desktop, it definitely does not work on Android. Always use URLs rether than native paths to refer to application files.

What you should do is create the database in the applicationStorage directory. You could do this with SQL, or by coping

...
Translate
Mentor ,
Nov 03, 2010 Nov 03, 2010

First, never use the nativePath property of File.applicationDirectory (as the example does). This isn't supported on Android. You get an empty string. While you could usually bypass the write-restrictions on te application directory using this technique on the desktop, it definitely does not work on Android. Always use URLs rether than native paths to refer to application files.

What you should do is create the database in the applicationStorage directory. You could do this with SQL, or by coping a "template" database file that you packaged with the application from the application directory o the application storage directory (using the URL not the native path, of course.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 08, 2010 Nov 08, 2010

Thank you so much.My probelm has solved.

Now I expect you have some CS5 for Android Samples control phone gps or camera.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 10, 2010 Nov 10, 2010

Hi Joe,

can you put together some quick example of opening database file from sdcard? I'm struggling with it, also I hope it is not due to the un-rooted device.

best regards

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 22, 2011 Aug 22, 2011
LATEST

I am trying to create an app that upon first running it in Android, it creates a new database on the SD so it can read/write data.  The DB is simple, I want to store an image and a name of the image.  The user creates images and then saves them to the DB.  Are there any good exmaples of this?  I am using Flash CS5.5 but cannot seem to find many examples that work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines