1

i got image content uri from activity result like this

val imagePickerLauncher = rememberLauncherForActivityResult(contract = ActivityResultContracts.GetContent(), onResult = { uri->
    it?.let {
        profilePhoto = uri.toString()
    }
})
  1. should i convert it to byte array and store it as blob ?
  2. should i copy the file to app specific folder and store that path to room ?

bast solution to do this

mk_369
  • 51
  • 1
  • 6

1 Answers1

0

Option 1 May or may not be feasible/practical due to how the Android API retrieves data via a Cursor.

Option 1 would, again depending upon the size, possibly (probably) make poor use of the buffering and be inefficient and thus resource intensive.

As such Option 2 is considered the recommended approach even though in some circumstances SQLite can be more efficient/faster for storing data as per SQLite 35% faster than the Filesystem

MikeT
  • 51,415
  • 16
  • 49
  • 68