How to open a .dict file for use in android app - android

I have been working on an android app that relies on reading in a large number of word list from a storage file of some sort. I have been using word list stored on sqlite database. Recently found a .dict file in an app that I thought has better list of words. But I couldn't really find a tool to either explore it or a piece of code to help me show how the words are organized inside the .dict file. Has anyone come across such a scenario before?. If so, It would be great if you help out. Thanks.

Related

What is the preferred way of importing/exporting data into Android app

I am making a vocabulary app to learn hungarian. The app has a database with words in two languages. The words should be entered as I meet them in the daily life and then I use the app to exercise the words.
Now I want to be able to enter the words on the computer, and import it to my app. Or share my words with a friend and thus export it from the app somehow.
As a windows programmer I am used to think in terms of files. I would make a simple file format or just use csv or xml files. But I see now when making Android apps that the file approach is not the thing. I don't get any file dialogs included with the api and when I search for how to import files it is hard to find an answer.
So my question is: What is the android/touch way of importing/exporting this kind of data?
EDIT: To clarify my question: Many windows programs have a way of importing data when you press File->Import and you get a file dialog where you can choose the file with the data you want to import. Since I don't find any file dialog or many examples on how to import files I recon there must be another more convenient way in android/touch devices. Maybe something with Content Providers. My vocabulary app is just an example.
I did not understand your question clearly but my suggestion to you is, if you have large amount of data:for example saving data of an employ,so you can use the Sqlite Database in android and connect it to your Desktop Database (for example you can create in xampp).Then You can send and recieve data.
Since you want to allow the users to enter the words in a Spreadsheet, you should give them an option to import data from Excel sheets, provided they create the sheets in a format specified by you. You can learn how to read XLS files programmatically online, here are some references:
http://www.cuelogic.com/blog/creatingreading-an-excel-file-in-android/
How to read data from XLS (Excel) file [Java, Android]
Read Excel file in android
After parsing the XLS sheet, you can insert them in an SQLite database. You can have all you want to know about SQLite in Android here:
http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html
http://www.vogella.com/tutorials/AndroidSQLite/article.html

Converting SQLite to PDF

I am developing an Android application and got a SQLite database in it, which has quite a lot of rows and columns. Showing those inside the application is no problem, but I want to export the information of the database as a PDF file to upload it to Dropbox or the SD card.
I found a way to create a PDF file within the application from a bitmap file, but that doesn't help me much. The information of the database can only be seen in the application by scrolling around, as it is to big for the screen. Is there a solution for this problem?
Exporting a screenshot as PDF won't help me much as not the whole database can be seen within one screen.
I'd look for some reporting solution for example http://jasperforge.org/projects/jasperreports possibly on the server side.
You can also try iText which is very low level.
Generate the bitmap in your software from or in parallel with the generation of what the users sees, write it out as a file, and give it to the pdf generator.

Create an output document from Android App

I have an android app where I will be capturing various information in different forms and storing into the SQL lite database for tracking/viewing purposes. I want to give the option of exporting the information into a RTF/PDF/Doc and give the option of sending it thru email.
I looked at various similar questions posted here earlier but didnt get a definitive answer. I saw the Android PDF Writer library http://sourceforge.net/projects/apwlibrary/ but this seems very basic. I considered iText but I think there would be issues with licensing if in future I want to sell this app..
Basically I want to define a template document with a structure that will be copied and content added to it based on what the user wants to export...
Any help is greatly appreciated...
I wanted some elegant solution where I can store a template in the assets folder and replace whatever I want to create the output document. Finally I went with html. I created a html template and put it into the assets folder. After that it was as simple as read assets, read db, do string.replaceall and write the output html and email it out.....
OpenOffice.org's Universal Network Objects (UNO) interface to programmatically generate MS-Word compatible documents (*.doc), as well as corresponding PDF documents.
its basically java so it should work on android too.

Is XML a good way to organize App data and keep it up to date on the Market?

this should be an easy one for whoever published Android Apps before...
Here is my situation:
I'm trying to develop a "city guide" app and I was wondering if my idea of working with .XML files to structure my data (the client provided a .PDF file with pictures, address, tel. no, websites, opening hours of the different destinations) is the best way to go.
I was hoping to be able to write this app as an "interpreter" for this type of .XML and then easily include other cities or destinations in a city by updating that input XML file.
So this is not a technical question, I know how to pull this off, the question is if this is a good way to go? How do you keep an app easily up to date? Would a altered XML trigger a Market wide update notification ?
My research lead me to believe that this is a comfortable way to update a published Android Market app (prior to this inquiry I consulted:
http://developer.android.com/guide/publishing/publishing.html
All helpful hints and suggestions will be greatly appreciated.
Regards,
Veo.
Once I developed such kind of an app that had to contain the whole information in itself. I structured it in SQLite database that I was shipping along with the application. The file was not directly readable (or at least easy to read) from the assets folder, but every time when the file was altered I copied the sqlite file to the application storage and used it as ordinary application database. The cool thing is that this way I did not have to pay for the parsing of xml every time the application ran.
Several notes here:
My database grew too big and I had to split it in files of 1MB, because this is the limit for a file in the asset folder. For more info see here:
The database update mechanism with the database version still worked well.
When you create the database manually you need to take into account that Android expects one system table to exist in it (it is automatically created if the database is created in Android code). Basically see this answer here for more info on that.

Android - dictionary file. Which is faster, database or reading file directly?

I'm making an dictionary app for android. This app uses stardict and DICT files which is are often pretty large (10MB or more) and contains just plain texts.
When users look up a word, my app will read the file randomly and return the result. I've read on some articles that reading file is expensive and slow. So I wonder if bringing all data into database is a better solution?
I would suggest putting your words into a database for the following reasons:
DB lookups on android with SQLite are "fast enough" (~1ms) for even the most impatient of users
Reading large files into memory is a dangerous practice in memory-limited environments such as android.
Trying to read entries out of a file "in place" rather than "in memory" is effectively trying to solve all the problems that SQLite already solves for you.
The only challenge presented in using a database is initializing it with the data you require. This problem can best be solved by creating the desired database in advance and then attaching it to your APK assets. There is an example here that is quite good.
Hope this helps.

Categories

Resources