Creating special dictionary on the platform android | Статья в журнале «Молодой ученый»

Отправьте статью сегодня! Журнал выйдет 27 апреля, печатный экземпляр отправим 1 мая.

Опубликовать статью в журнале

Автор:

Рубрика: Информационные технологии

Опубликовано в Молодой учёный №8 (112) апрель-2 2016 г.

Дата публикации: 20.04.2016

Статья просмотрена: 47 раз

Библиографическое описание:

Нуржабова, Д. Ш. Creating special dictionary on the platform android / Д. Ш. Нуржабова. — Текст : непосредственный // Молодой ученый. — 2016. — № 8 (112). — С. 141-144. — URL: https://moluch.ru/archive/112/23411/ (дата обращения: 19.04.2024).



This work is considered making the dictionary on three languages: Russian, Uzbek and English on sphere ICT, using оbject-oriented programming languages Java and database SQLite. The words is offered on three languages ICT sphere and created dictionary runs on platforms Android for device smart phones and tablets. Giving dictionary is intended for students, programmer and student studied on this sphere.

Key words: Java, database SQLite, ICT, оbject-oriented programming languages.

1. Introduction

Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google. Applications («apps»), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language that has complete access to the Android APIs. Java may be combined with C/C++, together with a choice of non-default runtimes that allow better C++ support [1, 3].

SQLite- compactly integrated relational database. The source code for the library in the public domain. In 2005 the project was awarded Google-O'Reilly Open Source Awards. As you know in its development SQL rushed in different directions. Young people interested in Android platform, because there is among popular tab, mobile devices or fashionable gadget [2,4].

2. Russian, uzbek and english dictionary on sphere ICT SQLite database

Large manufacturers have started to push any expansion. Although all sorts of accepted standards (SQL 92), in real life all the major databases do not support full have something of their own. So, SQLite tries to live by the principle of «minimal, but the full set». It does not support the complex stuff, but largely corresponds to SQL 92. And introduces some features which are very convenient, but it is not standard [5,6]. The word «embedded» (embedded) means that SQLite does not use the client-server paradigm, the SQLite engine is there is not a separate working process interacts with the program, and provides a library with which the program is assembled and the engine becomes an integral part of the program. Thus, as the protocol used by function calls (API) library SQLite.

This approach reduces overhead costs, response time and simplifies the program. SQLite stores all database (including definitions, tables, indexes, and data) in a single standard file on the computer on which the program is executed. Ease of implementation is achieved due to the fact that prior to the execution of a transaction record the entire file that stores the database is locked; ACID-functions are achieved, including by creating a log file [5,6].

Several processes or threads can be simultaneously without any problem to read data from one database. An entry in the database can be carried out only if no other requests are currently not in service; otherwise write attempt fails, and the program returns an error code. Another scenario is the automatic repetition of attempts to write for a specified length of time. The bundle comes as a functional part of the customer in the form of an executable file sqlite3, by which demonstrates the realization of the main functions of the library. The client side runs from the command line allows access to the database file on the basis of standard functions of the operating system. Creating program and connected together database SQLite. At firstly, we try to create database under the three name:

Dictionary

Ict_temps

Sqllite _sequences

Fig.1. Interface of program SQLite database

Fig.2. Entering words of three languages to SQLite database

Secondly after connected database and entering words, as result is appears on the interface SQLite.

3. SQLiteOpenHelper and program code

Due to the architecture of the engine may use SQLite as embedded systems, as well as on a dedicated machine with a gigabyte data sets. Older versions of the SQLite were designed without any restrictions, the only condition was that the database fits in memory, in which all calculations were performed using 32-bit integers [4,7]. This created some problems. Due to the fact that the upper limits have not been determined and thus properly tested frequently detected errors by using a sufficiently SQLite extreme conditions. Therefore, new versions were introduced SQLite limits are now tested with a common set of tests [4,7]. SQLite is available on any Android-powered device does not need to be installed separately. SQLite supports the types TEXT (analogue of the String Java), INTEGER (analogue long in Java) and REAL (analogue double to Java). Other types must be converted before you save the database. SQLite itself does not check the data types, so you can write an integer in the column designed for strings, and vice versa. In the third step part of dictionary be following view:

package com.aiw.ictdictionary;

import android.content.Context;

import android.database.Cursor;

import android.database.sqlite.SQLiteDatabase;

import android.util.Log;

import android.widget.Toast;

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.sql.SQLException;

import java.util.ArrayList;

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.sql.SQLException;

import java.util.ArrayList;

public class DatabaseManager {

public final String APP_TAG = "ICT_DICTIONARY";

public final String DB_NAME = "ict_dict.db";

public final String DB_FOLDER = "databases";

private static DatabaseManager instance;

private SQLiteDatabase db;

private Context context;

private DatabaseManager(Context context) {

this.context = context;

this.db = openDatabase(DB_NAME);

}

public static DatabaseManager getInstance(Context context) {

if (instance == null) {

instance = new DatabaseManager(context);

}

return instance;

}

private SQLiteDatabase openDatabase(String dbName) {

File dbFile = this.context.getDatabasePath(dbName);

String dbPath = dbFile.toString();

File dbDir = new File(dbPath.substring(0, dbPath.lastIndexOf('.')));

if ( ! dbFile.exists()) {

if ( ! dbDir.exists() ) dbDir.mkdirs();

copyDatabase(dbFile, dbName);

}

return SQLiteDatabase.openDatabase(dbPath, null, 0);

}

private void copyDatabase(File dbFile, String dbName) {

try {

InputStream istream = this.context.getAssets().open(DB_FOLDER + "/" + dbName);

OutputStream ostream = new FileOutputStream(dbFile);

byte[] buffer = new byte[100 * 1024];

int length;

Android contains an abstract class SQLiteOpenHelper, with which you can create, open and update the database. This is the basic class with which you will have to work in their projects. If you implement this helper class is hiding from you the logic on which the decision to create or update the database before opening it.

References:

  1. Dmitriy Volkov. Google Android eto neslojno. Sbornik urokov. Elektronnoe izdanie, 2012.
  2. Orlov L. V. Web-sayt bez sekretov. 2-e izd. M.: ZAO “Noviy izdatelskiy dom”, 2004. -512 p.
  3. Wikipedia. Internet encyclopedias. (ru.wikipedia.org/wiki/Android)
  4. Official web- site of Android, (android.com)
  5. Spravka — OS Android. (http://support.google.com/android/?hl=ru)
  6. Programmirovanie dlya android, java — s samix pervix shagov. (http://davidmd.ru/tag/eclipse/) API Guides for Android App. (http://developer.android.com/guide/components/index.html)
  7. D.Vinogradov. Start Andorid. (Sbornik urokov) — 2012. 703 p.
Основные термины (генерируются автоматически): ICT, SQL, API, INTEGER, REAL, SDK, TEXT, ZAO.


Ключевые слова

Ява, База данных SQLite, ИКТ, Ориентированные на объектно-ориентированные языки программирования., Java, database SQLite, ICT, оbject-oriented programming languages

Похожие статьи

Алгоритмы веб-сервиса обработки сборок метаданных для...

Поэтому если происходят какие-то изменения в SQL, то они должны быть отражены именно в этом подпроекте. Подпроект Manzana.Loyalty.Service.SDK является набором средств разработки (software development kit)...

Software testing as integral part of software quality | Молодой ученый

Software developers then select a software development process model like spiral, waterfall and v-models for developing that software system. Like all real-world, man-made products, software systems also must be tested in order to meet user requirements and to ensure the quality of a...

Комбинация средств UML И CSP-OZ для разработки приложений...

- Каждый тип данных CSP-OZ переводится в соответствующие типы SQL. Например, типы INTEGER и STRING переводятся в INT и CHARACTER STRING(n) в SQL, где n - максимальная длина строки.

Интеграция информационных систем на основе стандартов XML...

...клиента для конкретной системы в соответствии с ее API (Application Programming Interface – интерфейс программирования приложений).

Текст произвольного SQL-запроса. Source. Наименование источника данных и поле, значение которого следует поместить в качестве...

The use of music and song: an effective approach to ELT

As an integral part of our language experience, it can be of great value to foreign language teaching. This helps to make the learning process not only fascinating, but also effective.

Songs are comprehensible, enjoyable, authentic and full of language we need in real life.

Реализация алгоритма Metaphone для кириллических фамилий...

В статье описан пример собственной реализации алгоритма формирования ключа MetaPhone для кириллических фамилий средствами языка PL/SQL. Ключевые слова база данных; фонетический алгоритм; Metaphone; Soundex; генерация ключа; ключ Metaphone...

Методы выполнения запросов к хранилищу данных в Hadoop и Spark

Классификация методов выполнения запросов в Hadoop и Spark. В реляционных базах данные хранятся в рамках заранее разработанной схемы, и единственный способ получить к ним доступ — это использовать язык структурированных запросов SQL.

Программная реализация алгоритма Левенштейна для устранения...

В статье описан пример реализации алгоритма Левенштейна на языке PL/SQL для устранения опечаток в записях баз данных.

ln_hlen PLS_INTEGER

Похожие статьи

Алгоритмы веб-сервиса обработки сборок метаданных для...

Поэтому если происходят какие-то изменения в SQL, то они должны быть отражены именно в этом подпроекте. Подпроект Manzana.Loyalty.Service.SDK является набором средств разработки (software development kit)...

Software testing as integral part of software quality | Молодой ученый

Software developers then select a software development process model like spiral, waterfall and v-models for developing that software system. Like all real-world, man-made products, software systems also must be tested in order to meet user requirements and to ensure the quality of a...

Комбинация средств UML И CSP-OZ для разработки приложений...

- Каждый тип данных CSP-OZ переводится в соответствующие типы SQL. Например, типы INTEGER и STRING переводятся в INT и CHARACTER STRING(n) в SQL, где n - максимальная длина строки.

Интеграция информационных систем на основе стандартов XML...

...клиента для конкретной системы в соответствии с ее API (Application Programming Interface – интерфейс программирования приложений).

Текст произвольного SQL-запроса. Source. Наименование источника данных и поле, значение которого следует поместить в качестве...

The use of music and song: an effective approach to ELT

As an integral part of our language experience, it can be of great value to foreign language teaching. This helps to make the learning process not only fascinating, but also effective.

Songs are comprehensible, enjoyable, authentic and full of language we need in real life.

Реализация алгоритма Metaphone для кириллических фамилий...

В статье описан пример собственной реализации алгоритма формирования ключа MetaPhone для кириллических фамилий средствами языка PL/SQL. Ключевые слова база данных; фонетический алгоритм; Metaphone; Soundex; генерация ключа; ключ Metaphone...

Методы выполнения запросов к хранилищу данных в Hadoop и Spark

Классификация методов выполнения запросов в Hadoop и Spark. В реляционных базах данные хранятся в рамках заранее разработанной схемы, и единственный способ получить к ним доступ — это использовать язык структурированных запросов SQL.

Программная реализация алгоритма Левенштейна для устранения...

В статье описан пример реализации алгоритма Левенштейна на языке PL/SQL для устранения опечаток в записях баз данных.

ln_hlen PLS_INTEGER

Задать вопрос