I've created G class in-order to using database but in first steps I got this error :
Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
Also in AndroidManifest.xml I added :
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
This is my G class :
package com.example.n5110.database;
import android.app.Application;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;
import java.io.File;
public class G extends Application {
public static Context context;
public static SQLiteDatabase database;
public static final String DIR_SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath();
public static final String DIR_DATABASE = DIR_SDCARD + "/database-test/";
@Override
public void onCreate() {
super.onCreate();
context = this.getApplicationContext();
new File(DIR_DATABASE).mkdirs();
database = SQLiteDatabase.openOrCreateDatabase(DIR_DATABASE + "/database.sqlite", null);
}
}
Does anyone have an idea??
File dbFile = myContext.getDatabasePath(DB_NAME); return dbFile.exists();
Hope it helps
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I'm using onTouch method to acquire positions from ACTION_UP and ACTION_DOWN actionsWith this values I draw a red line from center to the position relative to the difference between the acquired positions
how can I create the below layout where each record is a recyclerview recordI already have a recyclerview but how can i set the left icons to be connected by a line as shown below and what of the data on the right, is that a cardview?
I need to create a pie chart with data from SharedPreferencesThis is part of my code, but I can't understand why this isn't working: