title: Android: Save android.net.Uri object to Database
body: <p>What i m trying to do is get the selected ringtone from the user, set an AlarmManager alarm to play that ringtone when the alarm goes Off. but I need to save the ringtone in the database so I can reset all the alarms after phone reboot.</p>
  
  <p>my question is what is the best way to save the ringtone Uri to the database to retrieve later?</p>
  
  <p>I tried the followings:</p>
  
  <p>1) save the ringtone title in the DB and then retrieve it and append it to a default ringtone path. but the issue, is that the ringtone might be loaded from a different location
  2) Storing the uri scheme, scheme spefici part and fragment and then call Uri.fromParts to create the Uri.
  3) create an inputStream, byte[] array from the Uri and saving it as a blob and then reading it back and cast the result to Uri</p>
  
  <p>none of these works.</p>
  
  <p>Your help is much appreciated.</p>