Search in sources :

Example 11 with FormsDao

use of org.odk.collect.android.dao.FormsDao in project collect by opendatakit.

the class FormsDaoHelper method getFormLanguage.

public static String getFormLanguage(String formPath) {
    String newLanguage = "";
    try (Cursor c = new FormsDao().getFormsCursorForFormFilePath(formPath)) {
        if (c.getCount() == 1) {
            c.moveToFirst();
            newLanguage = c.getString(c.getColumnIndex(FormsProviderAPI.FormsColumns.LANGUAGE));
        }
    }
    return newLanguage;
}
Also used : FormsDao(org.odk.collect.android.dao.FormsDao) Cursor(android.database.Cursor)

Example 12 with FormsDao

use of org.odk.collect.android.dao.FormsDao in project collect by opendatakit.

the class FormsDaoHelper method getFormPath.

public static String getFormPath(String selection, String[] selectionArgs) {
    FormsDao formsDao = new FormsDao();
    String formPath = null;
    try (Cursor c = formsDao.getFormsCursor(selection, selectionArgs)) {
        if (c != null && c.getCount() > 0) {
            c.moveToFirst();
            formPath = c.getString(c.getColumnIndex(FormsProviderAPI.FormsColumns.FORM_FILE_PATH));
        }
    }
    return formPath;
}
Also used : FormsDao(org.odk.collect.android.dao.FormsDao) Cursor(android.database.Cursor)

Aggregations

FormsDao (org.odk.collect.android.dao.FormsDao)12 Cursor (android.database.Cursor)9 ContentValues (android.content.ContentValues)3 Uri (android.net.Uri)3 File (java.io.File)3 DialogInterface (android.content.DialogInterface)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 AlertDialog (android.app.AlertDialog)1 ContentResolver (android.content.ContentResolver)1 OnCancelListener (android.content.DialogInterface.OnCancelListener)1 SQLException (android.database.SQLException)1 AlertDialog (android.support.v7.app.AlertDialog)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 KeyFactory (java.security.KeyFactory)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 NoSuchProviderException (java.security.NoSuchProviderException)1 PublicKey (java.security.PublicKey)1