Example #1
0
        private string CreateZipFile(Context context, params Android.Net.Uri[] files)
        {
            var fileDestinationPath = $"/sdcard/{DateTime.Now.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture)}.zip";
            var zip = new ZipFileBuilder(this, fileDestinationPath);

            foreach (var file in files)
            {
                using (var stream = context.ContentResolver.OpenInputStream(file))
                {
                    zip.AddFile($"{Guid.NewGuid().ToString("N")}.jpg", stream);
                }
            }
            zip.Build();

            return(fileDestinationPath);
        }