URI imageUri = null;
//Setting the Uri of aURL to imageUri.
try {
imageUri = aURL.toURI();
} catch (URISyntaxException e1) {
// TODO Auto-generated catch bl
To save the uri as a preference you first need to translate it to a string using the getPath() method. Then you can store it like this.
SharedPreferences pref = getSharedPreferences("whateveryouwant", MODE_PRIVATE);
SharedPreferences.Editor prefEditor = userSettings.edit();
prefEditor.putString("key", uriString);
prefEditor.commit();