Category : database

I recently updated the Room library to 2.3.0-beta01 from 2.2.5. Here is the migration that I added. "CREATE TABLE ‘bookmark’ (‘id’ TEXT, ‘content_id’ TEXT NOT NULL, ‘bookmark_position’ INTEGER NOT NULL, ‘chapter_index’ INTEGER NOT NULL,’chapter_bookmark_position’ INTEGER NOT NULL, ‘bookmarked_at’ INTEGER NOT NULL, ‘bookmark_note’ TEXT, ‘content_type’ INTEGER NOT NULL, ‘title’ TEXT NOT NULL, ‘img_url’ TEXT, ‘sync_pending’ INTEGER ..

Read more

i am creating a button in details activity that displays the data of Sandwitches. i want to add sandwitches to room database with button. This is my code. import android.app.Application; import android.content.Context; import android.content.SharedPreferences; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.squareup.picasso.Picasso; import ..

Read more

I’ve deleted the room database but still, I can see the previous rows in my database inspector unless I kill the app manually and reopen it. The scenario is logging out and reopen the login activity. The code snipet: deleteDatabase(AppDatabase.DATABASE_NAME) FileUtil.deleteDir(cacheDir) FileUtil.deleteDir(filesDir) val intent = Intent(this, LoginActivity::class.java) startActivity(intent) finish() Does anyone know how to clean ..

Read more

I used Picasso but photos don’t show. But text is showing in activity. Here the codes Upload Activity In this activity, I am uploading photos to Firebase. public class UploadActivity extends AppCompatActivity { EditText description; ImageView imageView; FirebaseDatabase firebaseDatabase; DatabaseReference myRef; private FirebaseAuth mAuth; private FirebaseAuth.AuthStateListener mAuthListener; private StorageReference mStorageRef; Uri selected; @Override protected void ..

Read more