Suppose English-Russian, and you can write the structure of such an application, I will be very grateful, I really need

Closed due to the fact that it is necessary to reformulate the question so that you can give an objectively correct answer by the participants pavlofff , pavel , Streletz , dirkgntly , Vartlok Aug 10 '16 at 11:57 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • from 1 day to a year, it all depends on the number of baubles :) - nick_n_a
  • I rate one table, fields: ID, langID, word, description. that is enough. Or two tables, one is English-Russian, the other way around. - nick_n_a
  • one
    Aandroid Studio is a development tool, programs are written not on it, but in it - for android, mainly in Java. This is the same as asking if it is hard to write a story on Notepad. - pavlofff

1 answer 1

You will need a database with words and tricks for them. Each word has its own ID, as well as the translation. The pivot table associates the word ID to the translation ID. Entering a word - start a JOIN query - find a word in the database and take its ID, take a list of translation IDs from the pivot table, make a selection of translations from the translation table for the ID list.

To add a new word and / or translation - just make a new entry in the corresponding table and associate it in the pivot table.

SQLite is suitable for working with databases ( here is an introductory article )

if there are many languages, create a table of language names and add their ID to the translation table. And then in the JOIN query we filter the necessary records by language ID.

I recommend not to be lazy and create a more or less normalized database. This will make it easier and less painful to increase the functionality of the application. A variant with multiple languages ​​would then be better implemented through the introduction of two more summary tables: translation-language and word-language. Then the structure of the tables will be as follows: a table of languages, a table of words, a table of translations, a pivot table of words-languages, a pivot table of translations-languages, a pivot table of word-translation.

  • Since one word (both in that and in another strontium) can have several translations, many to many connections are appropriate here - pavlofff
  • it is implemented in pivot tables, you are absolutely right. - DimXenon