Is it possible to import or add a database file(.db) to the app in appinventor

837 views
Skip to first unread message

Sriram AK

unread,
Oct 24, 2014, 1:35:14 AM10/24/14
to mitappinv...@googlegroups.com
I have been trying to implement an app that uses offline database(.db file ).How can i add this database file to the app in appinventor and link it with the app or is it possible to create a offline database using the appinventor storage components like tinydb to store the data persistently and then search and retrieve .

Mustafa Jukic

unread,
Oct 24, 2014, 3:22:01 AM10/24/14
to mitappinv...@googlegroups.com
you can use the storage / file function for this.
your db file can be as

SteveJG

unread,
Oct 24, 2014, 9:21:24 AM10/24/14
to mitappinv...@googlegroups.com
Mustafa's suggestions work fine for an offline database.   Your two possibilities are to use a TinyDB to store data  within the app or use a csv file in conjunction with the File control to store the data in a file.  Either method has advantages depending on the type of data stored.   You have to learn about Lists, TinyDB and the File control.  You will have to manually write your search routines.


Read the Pizza Party tutorial and everything you can find about Fusion tables for one way to store in the Cloud databases.    Read about Google Spreadsheet and ways to access the google spreadsheets from AI2 ....search the forum for specific information.

Fusions tables can import many standard database formats and are very flexible regarding search and retrieve because it is an SQL database..   Google Google Fusion tables on the Internet.

Regards,
Steve

Abraham Getzler

unread,
Oct 24, 2014, 12:00:02 PM10/24/14
to mitappinv...@googlegroups.com
Here's a link to a doc with routines for filtering lists of lists (tables)...

https://docs.google.com/document/d/12t4HLNRepCnbmcfycdF8wSHWht_D1P8hKJpTknVDChY/edit?usp=sharing

You can save the entire table under a TinyDB tag for persistence.

ABG
 

Sriram AK

unread,
Oct 25, 2014, 7:23:35 AM10/25/14
to mitappinv...@googlegroups.com
Im trying to  build a huge offline database for a dictionary that contains lots of words and contributes to large data . How can I build a massive offline database for a dictionary,?

Taifun

unread,
Oct 25, 2014, 10:10:08 AM10/25/14
to mitappinv...@googlegroups.com
there is only TinyDB to store data offline
as Mustafa said, store your data in a file as asset in the app and load it on first run 
alternatively download your data from a server on first run of the app
see also How to work with Lists by Saj
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

SteveJG

unread,
Oct 25, 2014, 11:42:41 AM10/25/14
to
Huge database dictionary?   On the Android?   You already got some good advice.

Huge on the Android means SLOW.  Better to do this on the Cloud...see above posts; however, if you must:

The example shows two ways to do this.  There are many more ways, probably more efficient.  The example is not really a dictionary.    If you type a , it will tell you an apple; that can as easily be a word in your language instead of a and an equivalent in a foreign language.      One way (Button1) uses List pairs; the other (Button5) uses Lists of Lists to do the same thing.  As you add items to the list, this process will get slower and slower retrieving the correct 'definitions' if this is done using Lists and a TinyDb.   Two different ways of setting up Lists using Text files is shown.  experiment.       Is this suitable for HUGE databases?    Probably not but go ahead and try.  Be aware, Android is very sensitive to case...if your  word is Alphabet, if you search for alphabet, it will not be found.

TinyDB ... this is your homework:  

TinyDB



Alternatively, you could use Mustafa's recommendation using csv files.

Regards,
Steve



Reply all
Reply to author
Forward
0 new messages