├── $:PATH ├── .gitignore ├── .idea ├── .gitignore ├── .name ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── compiler.xml ├── gradle.xml ├── jarRepositories.xml └── misc.xml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── example │ │ └── workmanagerexample │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── workmanagerexample │ │ │ ├── CompressWorker.kt │ │ │ ├── DownloadWorker.kt │ │ │ ├── EmotionAnalysisWorker.kt │ │ │ ├── FilterWorker.kt │ │ │ ├── MainActivity.kt │ │ │ ├── NotificationUtil.kt │ │ │ ├── SendLogWorker.kt │ │ │ └── UploadWorker.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_baseline_celebration_24.xml │ │ ├── ic_launcher_background.xml │ │ └── monalisa.jpeg │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── example │ └── workmanagerexample │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /$:PATH: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FPasaoglu/Work-Manager-Example/5d4282188397a1821684fe3c5a7b7dadd4909388/$:PATH -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Work Manager Example -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 20 | 22 | 23 | 135 | 136 | 138 | 139 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'kotlin-android' 4 | } 5 | 6 | android { 7 | compileSdkVersion 30 8 | buildToolsVersion "30.0.3" 9 | 10 | defaultConfig { 11 | applicationId "com.example.workmanagerexample" 12 | minSdkVersion 21 13 | targetSdkVersion 30 14 | versionCode 1 15 | versionName "1.0" 16 | 17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility JavaVersion.VERSION_1_8 28 | targetCompatibility JavaVersion.VERSION_1_8 29 | } 30 | kotlinOptions { 31 | jvmTarget = '1.8' 32 | } 33 | 34 | buildFeatures { 35 | dataBinding true 36 | } 37 | } 38 | 39 | dependencies { 40 | 41 | def work_version = "2.5.0" 42 | 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 44 | implementation 'androidx.core:core-ktx:1.3.2' 45 | implementation 'androidx.appcompat:appcompat:1.2.0' 46 | implementation 'com.google.android.material:material:1.3.0' 47 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 48 | testImplementation 'junit:junit:4.+' 49 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 50 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 51 | 52 | // Kotlin + coroutines 53 | implementation "androidx.work:work-runtime-ktx:$work_version" 54 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/workmanagerexample/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.example.workmanagerexample", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/CompressWorker.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.content.Context 4 | import android.util.Log 5 | import androidx.work.Worker 6 | import androidx.work.WorkerParameters 7 | 8 | class CompressWorker(context: Context, userParameters: WorkerParameters) : Worker(context, userParameters) { 9 | 10 | override fun doWork(): Result { 11 | try { 12 | for (i in 0..900) { 13 | Log.i("furkanpasa", "Compressing image $i") 14 | } 15 | return Result.success() 16 | }catch (e: Exception) { 17 | return Result.failure() 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/DownloadWorker.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.app.NotificationManager 4 | import android.content.Context 5 | import android.content.Context.NOTIFICATION_SERVICE 6 | import android.util.Log 7 | import androidx.work.Worker 8 | import androidx.work.WorkerParameters 9 | import com.example.workmanagerexample.MainActivity.Companion.KEY_DOWNLOAD_DESC 10 | import com.example.workmanagerexample.MainActivity.Companion.KEY_DOWNLOAD_TITLE 11 | 12 | class DownloadWorker(val context: Context, userParameters: WorkerParameters) : 13 | Worker(context, userParameters) { 14 | 15 | override fun doWork(): Result { 16 | try { 17 | 18 | val downloadTitle = inputData.getString(KEY_DOWNLOAD_TITLE) ?: return Result.failure() 19 | val downloadDesc = inputData.getString(KEY_DOWNLOAD_DESC) ?: return Result.failure() 20 | 21 | for (i in 0..300) { 22 | Log.i("furkanpasa", "Downloading image $i") 23 | } 24 | 25 | val notificationManager: NotificationManager = 26 | context.getSystemService(NOTIFICATION_SERVICE) as NotificationManager 27 | 28 | notificationManager.sendNotification(context, downloadTitle, downloadDesc) 29 | 30 | return Result.success() 31 | } catch (e: Exception) { 32 | return Result.failure() 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/EmotionAnalysisWorker.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.content.Context 4 | import android.util.Log 5 | import androidx.work.Data 6 | import androidx.work.Worker 7 | import androidx.work.WorkerParameters 8 | import com.example.workmanagerexample.MainActivity.Companion.KEY_USER_COMMENT_TEXT 9 | 10 | class EmotionAnalysisWorker(context: Context, userParameters: WorkerParameters) : 11 | Worker(context, userParameters) { 12 | 13 | companion object { 14 | val KEY_USER_EMOTION_RESULT = "key.user.emotion.result" 15 | } 16 | 17 | override fun doWork(): Result { 18 | val text = inputData.getString(KEY_USER_COMMENT_TEXT) 19 | 20 | try { 21 | for (i in 0..200) { 22 | Log.i("furkanpasa", "Emotion Analysing $i") 23 | } 24 | 25 | val outputData = Data.Builder() 26 | .putString(KEY_USER_EMOTION_RESULT, getUserEmotion(text)) 27 | .build() 28 | 29 | return Result.success(outputData) 30 | } catch (e: Exception) { 31 | return Result.failure() 32 | } 33 | 34 | } 35 | 36 | fun getUserEmotion(userText : String?): String { 37 | 38 | val emotionList = listOf("Sad", "Happy", "Angry", "Surprise", "Tired", "Bored") 39 | 40 | return emotionList.random() 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/FilterWorker.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.content.Context 4 | import android.util.Log 5 | import androidx.work.Worker 6 | import androidx.work.WorkerParameters 7 | 8 | class FilterWorker(context: Context, userParameters: WorkerParameters) : Worker(context, userParameters) { 9 | 10 | override fun doWork(): Result { 11 | try { 12 | for (i in 0..300) { 13 | Log.i("furkanpasa", "Filtering image $i") 14 | } 15 | return Result.success() 16 | }catch (e: Exception) { 17 | return Result.failure() 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.app.NotificationChannel 4 | import android.app.NotificationManager 5 | import android.os.Build 6 | import android.os.Bundle 7 | import android.widget.Toast 8 | import androidx.appcompat.app.AppCompatActivity 9 | import androidx.databinding.DataBindingUtil 10 | import androidx.lifecycle.Observer 11 | import androidx.work.* 12 | import com.example.workmanagerexample.EmotionAnalysisWorker.Companion.KEY_USER_EMOTION_RESULT 13 | import com.example.workmanagerexample.databinding.ActivityMainBinding 14 | import java.util.concurrent.TimeUnit 15 | 16 | class MainActivity : AppCompatActivity() { 17 | 18 | lateinit var binding: ActivityMainBinding 19 | 20 | companion object { 21 | val KEY_USER_COMMENT_TEXT = "key.user.comment.text" 22 | val KEY_DOWNLOAD_TITLE = "key.download.title" 23 | val KEY_DOWNLOAD_DESC = "key.download.desc" 24 | val KEY_UPLOAD_TITLE = "key.upload.title" 25 | val KEY_UPLOAD_DESC = "key.upload.desc" 26 | val TAG_SEND_LOG = "tag.send.log" 27 | val CHANNEL_ID = "4747" 28 | } 29 | 30 | override fun onCreate(savedInstanceState: Bundle?) { 31 | super.onCreate(savedInstanceState) 32 | 33 | val binding: ActivityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main) 34 | 35 | createNotificationChannel() 36 | 37 | binding.buttonEmotionAnalysis.setOnClickListener { 38 | val userText = binding.editTextUserComment.text?.toString() ?: "" 39 | setOneTimeEmotionAnalysisRequest(userText) 40 | } 41 | 42 | binding.buttonRaconFilter.setOnClickListener { 43 | setOneTimeGoldenRatioFilterRequest() 44 | } 45 | 46 | binding.switch1.setOnCheckedChangeListener { buttonView, isChecked -> 47 | if (isChecked) { 48 | setPeriodicallySendingLogs() 49 | } else { 50 | cancellSendingLogRequest() 51 | } 52 | } 53 | 54 | } 55 | 56 | private fun setOneTimeEmotionAnalysisRequest(userText: String) { 57 | 58 | val workManager = WorkManager.getInstance(this) 59 | 60 | val data = Data.Builder() 61 | .putString(KEY_USER_COMMENT_TEXT, userText) 62 | .build() 63 | 64 | val constraints = Constraints.Builder() 65 | .setRequiredNetworkType(NetworkType.CONNECTED) 66 | .build() 67 | 68 | val emotionAnalysisWorker = OneTimeWorkRequestBuilder() 69 | .setInputData(data) 70 | .setConstraints(constraints) 71 | .build() 72 | 73 | workManager.enqueue(emotionAnalysisWorker) 74 | 75 | workManager.getWorkInfoByIdLiveData(emotionAnalysisWorker.id) 76 | .observe(this, Observer { workInfo -> 77 | binding.textViewWorkState.text = workInfo.state.name 78 | 79 | if (workInfo.state == WorkInfo.State.SUCCEEDED) { 80 | val userEmotionResult = workInfo.outputData.getString(KEY_USER_EMOTION_RESULT) 81 | Toast.makeText(this, userEmotionResult, Toast.LENGTH_SHORT).show() 82 | } 83 | }) 84 | } 85 | 86 | private fun setOneTimeGoldenRatioFilterRequest() { 87 | 88 | val workManager = WorkManager.getInstance(this) 89 | 90 | val downloadData = workDataOf( 91 | KEY_DOWNLOAD_TITLE to "Download Worker", 92 | KEY_DOWNLOAD_DESC to "Downlading Image is successfully" 93 | ) 94 | 95 | val uploadData = workDataOf( 96 | KEY_UPLOAD_TITLE to "Upload Worker", 97 | KEY_UPLOAD_DESC to "Uploading Image is successfully" 98 | ) 99 | 100 | val constraintUpload = Constraints.Builder() 101 | .setRequiredNetworkType(NetworkType.CONNECTED) 102 | .setRequiresCharging(true) 103 | .build() 104 | 105 | val constraintDownload = Constraints.Builder() 106 | .setRequiredNetworkType(NetworkType.UNMETERED) 107 | .setRequiresStorageNotLow(true) 108 | .setRequiresBatteryNotLow(true) 109 | .build() 110 | 111 | val compressImage = OneTimeWorkRequestBuilder() 112 | .build() 113 | 114 | val filterImage = OneTimeWorkRequestBuilder() 115 | .build() 116 | 117 | val uploadImage = OneTimeWorkRequestBuilder() 118 | .setConstraints(constraintUpload) 119 | .setInputData(uploadData) 120 | .build() 121 | 122 | val downloadImage = OneTimeWorkRequestBuilder() 123 | .setConstraints(constraintDownload) 124 | .setInputData(downloadData) 125 | .setInitialDelay(3, TimeUnit.SECONDS) 126 | .build() 127 | 128 | val parallelWork = mutableListOf() 129 | parallelWork.add(compressImage) 130 | parallelWork.add(filterImage) 131 | 132 | workManager 133 | .beginWith(parallelWork) 134 | .then(uploadImage) 135 | .then(downloadImage) 136 | .enqueue() 137 | 138 | workManager.getWorkInfoByIdLiveData(downloadImage.id) 139 | .observe(this, Observer { workInfoDownload -> 140 | binding.textViewWorkState.text = workInfoDownload.state.name 141 | }) 142 | } 143 | 144 | private fun setPeriodicallySendingLogs() { 145 | val workManager = WorkManager.getInstance(this) 146 | 147 | val sendingLog = PeriodicWorkRequestBuilder(15, TimeUnit.MINUTES) 148 | .addTag(TAG_SEND_LOG) 149 | .build() 150 | 151 | workManager.enqueue(sendingLog) 152 | 153 | workManager.getWorkInfoByIdLiveData(sendingLog.id) 154 | .observe(this, Observer { workInfo -> 155 | binding.textViewWorkState.text = workInfo.state.name 156 | }) 157 | } 158 | 159 | private fun cancellSendingLogRequest() { 160 | WorkManager.getInstance(this).cancelAllWorkByTag(TAG_SEND_LOG) 161 | } 162 | 163 | private fun createNotificationChannel() { 164 | // Create the NotificationChannel, but only on API 26+ because 165 | // the NotificationChannel class is new and not in the support library 166 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 167 | val name = getString(R.string.channel_name) 168 | val descriptionText = getString(R.string.channel_description) 169 | val importance = NotificationManager.IMPORTANCE_HIGH 170 | val channel = NotificationChannel(CHANNEL_ID, name, importance).apply { 171 | description = descriptionText 172 | } 173 | // Register the channel with the system 174 | val notificationManager: NotificationManager = 175 | getSystemService(NOTIFICATION_SERVICE) as NotificationManager 176 | notificationManager.createNotificationChannel(channel) 177 | } 178 | } 179 | 180 | 181 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/NotificationUtil.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.app.NotificationManager 4 | import android.content.Context 5 | import androidx.core.app.NotificationCompat 6 | import com.example.workmanagerexample.MainActivity.Companion.CHANNEL_ID 7 | 8 | fun NotificationManager.sendNotification(context: Context, title: String = "Succeed", desc : String = "Worker is completed") { 9 | 10 | val NOTIFY_ID = 42633687 11 | 12 | val notification = NotificationCompat.Builder(context, CHANNEL_ID) 13 | .setContentTitle(title) 14 | .setContentText(desc) 15 | .setSmallIcon(R.drawable.ic_baseline_celebration_24) 16 | 17 | notify(NOTIFY_ID, notification.build()) 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/SendLogWorker.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.content.Context 4 | import android.util.Log 5 | import androidx.work.Worker 6 | import androidx.work.WorkerParameters 7 | 8 | class SendLogWorker(context: Context, userParameters: WorkerParameters) : Worker(context, userParameters) { 9 | 10 | override fun doWork(): Result { 11 | try { 12 | for (i in 0..500) { 13 | Log.i("furkanpasa", "Sending log $i") 14 | } 15 | return Result.success() 16 | } catch (e: Exception) { 17 | return Result.failure() 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/workmanagerexample/UploadWorker.kt: -------------------------------------------------------------------------------- 1 | package com.example.workmanagerexample 2 | 3 | import android.app.NotificationManager 4 | import android.content.Context 5 | import android.content.Context.NOTIFICATION_SERVICE 6 | import android.util.Log 7 | import androidx.work.Worker 8 | import androidx.work.WorkerParameters 9 | 10 | class UploadWorker(val context: Context, userParameters: WorkerParameters) : Worker(context, userParameters) { 11 | 12 | override fun doWork(): Result { 13 | try { 14 | 15 | val uploadTitle = inputData.getString(MainActivity.KEY_UPLOAD_TITLE) ?: return Result.failure() 16 | val uploadDesc = inputData.getString(MainActivity.KEY_UPLOAD_DESC) ?: return Result.failure() 17 | 18 | 19 | for (i in 0..750) { 20 | Log.i("furkanpasa", "Uploading image $i") 21 | } 22 | 23 | val notificationManager : NotificationManager = context.getSystemService(NOTIFICATION_SERVICE) as NotificationManager 24 | notificationManager.sendNotification(context, uploadTitle, uploadDesc) 25 | 26 | 27 | return Result.success() 28 | }catch (e: Exception) { 29 | return Result.failure() 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_celebration_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 16 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/monalisa.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FPasaoglu/Work-Manager-Example/5d4282188397a1821684fe3c5a7b7dadd4909388/app/src/main/res/drawable/monalisa.jpeg -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | 24 | 25 | 34 | 35 | 39 | 40 | 41 | 42 |