Turkish Android SQLite

I am working on an Android application that supports English and Turkish . The application contains a SQLite database, which contains a column and Autoincrement _id .

When this application works on an English device, it works fine, but when launched on the device, the Turkish database automatically stops creating identifiers.

I tried to retrieve the database file, and open it in the SQLite Database Browser, it stores all columns correctly, only the value of the column _id still empty in the Turkish Language

Ideas to solve this problem?

Edit:

Database creation:

public class DatabaseHandler extends SQLiteOpenHelper {
    private final static String TAG = "DatabaseHandler";

    private final static int DATABASE_VERSION = 3;
    private final static String DATABASE_NAME = "app_main_database";

    public DatabaseHandler(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String query = "CREATE TABLE tbl_item (_id INTEGER PRIMARY KEY NULL, _serverId TEXT NULL, _itemName TEXT NULL, _lastEditDate DATETIME NOT NULL)";

        db.execSQL(query);
    }

:

    @Override
    public void insert() {
        ContentValues reVal = new ContentValues();

        reVal.put(COL_ITEM_SERVER_ID, getItemServerId());
        reVal.put(COL_ITEM_NAME, getItemName());
        reVal.put(COL_LAST_EDIT_DATE, getLastEditDate());

        SQLiteDatabase sqLite = new DatabaseHandler(this).getWritableDatabase();
        sqLite.insert(tableName, null, obj.getContentValues());
    }
+4
1

( setLocale) . .

openDatabase, NO_LOCALIZED_COLLATORS ( setLocale ( ))

public static final int NO_LOCALIZED_COLLATORS

Added in API level 1
Open flag: Flag for openDatabase(String, SQLiteDatabase.CursorFactory, int) to open the database without support for localized collators.

This causes the collator LOCALIZED not to be created. You must be consistent when using this flag to use the setting the database was created with. If this is set, setLocale(Locale) will do nothing.

Constant Value: 16 (0x00000010)

, setLocale datatabase.

+1

Source: https://habr.com/ru/post/1531394/


All Articles