Sub Process_Globals
Dim meta() As String = Array As String("GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","DateTime","DateTimeDigitized")
...
Sub Copy
...
'f1 is internal image compressed
'f2 is name of the new file in the external storage directory where I choose the file
Dim in As InputStream = File.OpenInput(File.DirInternal,f1)
Dim out As OutputStream = sto.OpenOutputStream(sto.CreateNewFile(sto.Root,f2))
File.Copy2(in, out)
out.Close
' Setting metadata attributes of new file
Dim in As InputStream = sto.OpenInputStream(sto.FindFile(sto.Root,f2))
Dim exif As JavaObject
exif.InitializeNewInstance("android.media.ExifInterface", Array(in))
Dim v() As String = Regex.Split(";",metadata), i As Int = 0
For Each a As String In meta
exif.RunMethod("setAttribute",Array(a,v(i)))
i = i + 1
Next
' Save modifications...(supposed to create a new file and then replace the file)
exif.RunMethod("saveAttributes",Null)