Android Image Gallery Using Kotlin Tutorial

01:46

Today I wanna show you how easy to build a simple Android Image Gallery using Kotlin and Glide library. Building an image gallery is one of a must step for beginner Android developers (also for experienced developers). There are so many similar tutorials like this one but most of them are confusing and hard to be understood. So I don’t wanna confuse you with so many steps building this kind of app, so I will just stick with a few steps just to get you to understand the basic concepts.

What the app will look like?
The app will look like this after you finish this tutorial:

more

Android Create Temp File In Cache Directory (Kotlin)

01:43

Create a file in cache directory

// create file in cache directory
val outputFile = File(context.cacheDir, "output.txt")

Create a file in cache directory including date & time in filename.

val timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd-kkmmss"))
val outputFile = File(context.cacheDir, "output-${timestamp}.txt")

Create a temp file in cache directory.

val timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd-kkmmss"))
val outputFile = File.createTempFile(timestamp, null, context.cacheDir);

You might want to delete output file if already exist and create the necessary directory before usage.

if (outputFile.exists()) {
    outputFile.delete()
}
else {
    outputFile.parentFile?.mkdirs()
}

Write single large string output to file.

val input = "I am String"
val inputStream = ByteArrayInputStream(input.toByteArray(UTF_8))

val outputStream = FileOutputStream(outputFile)
// the following should work as well 
// val outputStream = outputFile.outputStream()

inputStream.use { input ->
    outputStream.use { output ->
        input.copyTo(output)
    }
}
(c)
Далее

Ashes & Roses preset for KLWP

14:59

Ashes & Roses preset for KLWP

Available on google play

Cheese! preset for KLWP

10:00

Cheese! preset for KLWP

Available on google play

FTS presets for KLWP

22:54

FTS presets for KLWP

Available on google play

RGB presets for KLWP

17:51

RGB presets for KLWP

Available on google play

Happy Halloween preset for KLWP

22:21

Happy Halloween preset for KLWP

Available on google play

Your Music preset for KLWP

23:22

Your Music preset for KLWP

Available on google play

Lunar Night preset for KLWP

17:39

Lunar Night preset for KLWP

Available on google play

Clean Solo preset for KLWP

14:31

Clean Solo preset for KLWP

Available on google play

«123 »