(*args)
11 | }
12 |
--------------------------------------------------------------------------------
/Chapter03/SpringbootkotlinApplication/src/main/resources/application.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringbootkotlinApplication/src/main/resources/application.properties
--------------------------------------------------------------------------------
/Chapter03/SpringbootkotlinApplication/src/main/resources/templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Spring Boot Kotlin Application
6 |
7 |
8 | Welcome, Naruto. This project is based on Spring Boot in Kotlin
9 |
10 |
--------------------------------------------------------------------------------
/Chapter03/SpringbootkotlinApplication/src/test/kotlin/com/pucktpub/sunnat629/springbootkotlin/springbootkotlin/SpringbootkotlinApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.pucktpub.sunnat629.springbootkotlin.springbootkotlin
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.springframework.boot.test.context.SpringBootTest
6 | import org.springframework.test.context.junit4.SpringRunner
7 |
8 | @RunWith(SpringRunner::class)
9 | @SpringBootTest
10 | class SpringbootkotlinApplicationTests {
11 |
12 | @Test
13 | fun contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 |
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/aopalliance-1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/aopalliance-1.0.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/commons-logging-1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/commons-logging-1.2.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-aop-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-aop-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-aspects-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-aspects-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-beans-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-beans-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-context-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-context-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-context-support-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-context-support-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-core-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-core-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-expression-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-expression-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-instrument-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-instrument-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-jdbc-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-jdbc-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-jms-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-jms-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-messaging-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-messaging-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-orm-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-orm-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-oxm-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-oxm-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-test-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-test-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/lib/spring-tx-4.3.18.RELEASE.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/lib/spring-tx-4.3.18.RELEASE.jar
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/META-INF/BeansScopes.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | "
3 | ktPackageXMLBasedApplicationKt
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/ktPackage/UserGreeting.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/ktPackage/UserGreeting.class
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/ktPackage/UserSurname.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/ktPackage/UserSurname.class
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/ktPackage/XMLBasedApplicationKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/XMLBasedSpringConfiguration/out/production/BeansScopes/ktPackage/XMLBasedApplicationKt.class
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/src/UserSurname.kt:
--------------------------------------------------------------------------------
1 | package ktPackage
2 |
3 | class UserSurname {
4 | init {
5 | println("This is init of UserSurname")
6 | }
7 |
8 | fun getSurname(){
9 | println("This is the surname of user")
10 | }
11 | }
--------------------------------------------------------------------------------
/Chapter03/XMLBasedSpringConfiguration/src/XMLBasedApplication.kt:
--------------------------------------------------------------------------------
1 | package ktPackage
2 |
3 | import org.springframework.context.support.ClassPathXmlApplicationContext
4 |
5 |
6 | fun main(args: Array) {
7 | val context = ClassPathXmlApplicationContext("beans.xml")
8 | val objectA = context.getBean("userGreeting", UserGreeting::class.java)
9 | objectA.getUserSurname()
10 | //
11 | // objectA.setGreeting("Naruto Uzumaki")
12 | // objectA.getGreeting()
13 | // context.registerShutdownHook()
14 | }
15 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches/build_file_checksums.ser
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/misc.xml
9 | .DS_Store
10 | /build
11 | /captures
12 | .externalNativeBuild
13 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/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
22 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/java/springforandroid/pactpub/sunnat629/resttemptest/GitHubAPIModel.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.resttemptest
2 |
3 | class Users(var id: Int,
4 | var name: String,
5 | var login: String,
6 | var company: String,
7 | var location: String)
8 |
9 | class Repository(var id: String,
10 | var name: String,
11 | var private: Boolean,
12 | var html_url: String,
13 | var description: String)
14 |
15 | class Gist(var description: String,
16 | var public: Boolean)
17 |
18 | class DeleteRepos(var id: String,
19 | var name: String,
20 | var private: Boolean)
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/java/springforandroid/pactpub/sunnat629/resttemptest/Registration.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.resttemptest
2 |
3 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Rest Temp Test
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/app/src/test/java/springforandroid/pactpub/sunnat629/resttemptest/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.resttemptest
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.2.61'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.3.0'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
15 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RestTempTest/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Chapter04/RestTempTest/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches/build_file_checksums.ser
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | .DS_Store
9 | /build
10 | /captures
11 | .externalNativeBuild
12 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/java/springforandroid/pactpub/sunnat629/retrofitinkotlintest/model/GitHubUserModel.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.retrofitinkotlintest.model
2 |
3 |
4 | class GitHubUserModel {
5 | val name: String? = null
6 | }
7 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/java/springforandroid/pactpub/sunnat629/retrofitinkotlintest/repository/GithubService.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.retrofitinkotlintest.repository
2 |
3 | import retrofit2.Call
4 | import retrofit2.http.GET
5 | import retrofit2.http.Path
6 | import springforandroid.pactpub.sunnat629.retrofitinkotlintest.model.GitHubUserModel
7 |
8 | interface GithubService {
9 | @GET("/users/{user}/repos")
10 | fun reposOfUser(@Path("user") user: String): Call>
11 | }
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/java/springforandroid/pactpub/sunnat629/retrofitinkotlintest/repository/GithubServiceImpl.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.retrofitinkotlintest.repository
2 |
3 | import retrofit2.Retrofit
4 | import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
5 | import retrofit2.converter.gson.GsonConverterFactory
6 |
7 | class GithubServiceImpl{
8 | fun getGithubServiceImpl(): GithubService {
9 | val retrofit = Retrofit.Builder()
10 | .baseUrl("https://api.github.com/")
11 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
12 | .addConverterFactory(GsonConverterFactory.create())
13 | .build()
14 | return retrofit.create(GithubService::class.java)
15 | }
16 | }
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Retrofit in Kotlin Test
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/app/src/test/java/springforandroid/pactpub/sunnat629/retrofitinkotlintest/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.retrofitinkotlintest
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.0'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.2.1'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
15 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter04/RetrofitinKotlinTest/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Chapter04/RetrofitinKotlinTest/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/*
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/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
22 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/java/springforandroid/pactpub/sunnat629/basicauthinkotlin/basicauth/BasicAuthInterceptor.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.basicauthinkotlin.basicauth
2 |
3 | import okhttp3.Credentials
4 | import okhttp3.Interceptor
5 | import okhttp3.Response
6 | import java.io.IOException
7 |
8 | class BasicAuthInterceptor(user: String, password: String) : Interceptor {
9 |
10 | private val credentials: String = Credentials.basic(user, password)
11 |
12 | @Throws(IOException::class)
13 | override fun intercept(chain: Interceptor.Chain): Response {
14 | val request = chain.request()
15 | val authenticatedRequest = request.newBuilder()
16 | .header("Authorization", credentials).build()
17 | return chain.proceed(authenticatedRequest)
18 | }
19 | }
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/java/springforandroid/pactpub/sunnat629/basicauthinkotlin/model/UserModel.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.basicauthinkotlin.model
2 |
3 |
4 | class UserModel (val name: String?,
5 | val contact_number: String?,
6 | val id: String?,
7 | val email: String? )
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/java/springforandroid/pactpub/sunnat629/basicauthinkotlin/repository/UserService.kt:
--------------------------------------------------------------------------------
1 | package springforandroid.pactpub.sunnat629.basicauthinkotlin.repository
2 |
3 | import retrofit2.Call
4 | import retrofit2.http.GET
5 | import springforandroid.pactpub.sunnat629.basicauthinkotlin.model.UserModel
6 |
7 | interface UserService {
8 | @GET("/users")
9 | fun getUserList(): Call>
10 | }
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Basic Auth in Kotlin
3 | User Name List
4 |
5 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
15 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/BasicAuthinKotlin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Chapter05/BasicAuthinKotlin/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Chapter05/springsecurity/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter05/springsecurity/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/springsecurity/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter05/springsecurity/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/kotlin/com/packtpub/sunnat629/springsecurity/AccessDecisionManager.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.springframework.security.access.ConfigAttribute
4 | import org.springframework.security.core.Authentication
5 |
6 |
7 | interface AccessDecisionManager {
8 | fun supports(attribute: ConfigAttribute): Boolean
9 |
10 | fun supports(clazz: Class<*>): Boolean
11 |
12 | // fun vote(authentication: Authentication, object: S,
13 | // attributes: Collection): Int
14 | }
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/kotlin/com/packtpub/sunnat629/springsecurity/ApplicationSecurity.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
4 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
5 | import org.springframework.beans.factory.annotation.Autowired
6 | import javax.sql.DataSource
7 |
8 |
9 | class ApplicationSecurity: WebSecurityConfigurerAdapter() {
10 | @Autowired
11 | fun initialize(builder: AuthenticationManagerBuilder, dataSource: DataSource){
12 | builder.jdbcAuthentication().dataSource(dataSource).withUser("Sunnat629")
13 | .password("packtPub").roles("USER")
14 | }
15 | }
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/kotlin/com/packtpub/sunnat629/springsecurity/AuthenticationManager.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.springframework.security.core.Authentication
4 | import org.springframework.security.core.AuthenticationException
5 |
6 | /**
7 | * a sample code of AuthenticationManager interface which is used for authentication process
8 | * */
9 |
10 | interface AuthenticationManager {
11 | @Throws(AuthenticationException::class)
12 | fun authenticate(authentication: Authentication): Authentication
13 | }
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/kotlin/com/packtpub/sunnat629/springsecurity/AuthenticationProvider.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.springframework.security.core.Authentication
4 | import javax.security.sasl.AuthenticationException
5 |
6 | interface AuthenticationProvider {
7 | @Throws(AuthenticationException::class)
8 | fun authenticate(authentication: Authentication):Authentication
9 |
10 | fun supports(authentication: Class<*>): Boolean
11 | }
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/kotlin/com/packtpub/sunnat629/springsecurity/CustomService.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.springframework.security.access.annotation.Secured
4 |
5 | @Secured
6 | class CustomService{
7 | @Secured
8 | fun secure(): String{
9 | return "The is Secured..."
10 | }
11 | }
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/kotlin/com/packtpub/sunnat629/springsecurity/SpringSecurityApplication.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity
6 |
7 | @SpringBootApplication
8 | @EnableGlobalMethodSecurity(securedEnabled = true)
9 | class SpringSecurityApplication
10 |
11 | fun main(args: Array) {
12 | runApplication(*args)
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/main/resources/application.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/springsecurity/src/main/resources/application.properties
--------------------------------------------------------------------------------
/Chapter05/springsecurity/src/test/kotlin/com/packtpub/sunnat629/springsecurity/SpringSecurityApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.springsecurity
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.springframework.boot.test.context.SpringBootTest
6 | import org.springframework.test.context.junit4.SpringRunner
7 |
8 | @RunWith(SpringRunner::class)
9 | @SpringBootTest
10 | class SpringSecurityApplicationTests {
11 |
12 | @Test
13 | fun contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/ssbasicauth/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/src/main/kotlin/com/packtpub/sunnat629/ssbasicauth/SSBasicAuthApplication.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.ssbasicauth
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
6 | import org.springframework.context.annotation.ComponentScan
7 |
8 | @SpringBootApplication
9 | class SSBasicAuthApplication: SpringBootServletInitializer()
10 |
11 | fun main(args: Array) {
12 | runApplication(*args)
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/src/main/kotlin/com/packtpub/sunnat629/ssbasicauth/model/Users.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.ssbasicauth.model
2 |
3 | class Users(val id: String?,
4 | val name: String?,
5 | val email: String?,
6 | val contactNumber: String?)
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/src/main/resources/application.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/ssbasicauth/src/main/resources/application.properties
--------------------------------------------------------------------------------
/Chapter05/ssbasicauth/src/test/kotlin/com/packtpub/sunnat629/ssbasicauth/SsBasicAuthApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.ssbasicauth
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.springframework.boot.test.context.SpringBootTest
6 | import org.springframework.test.context.junit4.SpringRunner
7 |
8 | @RunWith(SpringRunner::class)
9 | @SpringBootTest
10 | class SsBasicAuthApplicationTests {
11 |
12 | @Test
13 | fun contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter05/ssoauth2/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/src/main/kotlin/com/packtpub/sunnat629/ssoauth2/ssoauth2/SpringSecurityOAuth2Application.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.ssoauth2.ssoauth2
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 |
6 |
7 | @SpringBootApplication
8 | class SpringSecurityOAuth2Application
9 |
10 | fun main(args: Array) {
11 | runApplication(*args)
12 | }
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/src/main/kotlin/com/packtpub/sunnat629/ssoauth2/ssoauth2/controller/UserController.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.ssoauth2.ssoauth2.controller
2 |
3 | import org.springframework.web.bind.annotation.GetMapping
4 | import org.springframework.web.bind.annotation.RestController
5 |
6 | @RestController
7 | class UserController{
8 |
9 | // This is for all means there is no security issue for this URL path
10 | @GetMapping(value = ["/", "","/open_for_all"])
11 | fun home(): String{
12 | return "This area can be accessed by all."
13 | }
14 |
15 | // Yu have to use token to get this URL path
16 | @GetMapping("/private")
17 | fun securedArea(): String{
18 | return "You used an access token to enter this area."
19 | }
20 | }
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | #this project server port
2 | server.port=8081
--------------------------------------------------------------------------------
/Chapter05/ssoauth2/src/test/kotlin/com/packtpub/sunnat629/ssoauth2/ssoauth2/SpringSecurityOAuth2ApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.ssoauth2.ssoauth2
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.springframework.boot.test.context.SpringBootTest
6 | import org.springframework.test.context.junit4.SpringRunner
7 |
8 | @RunWith(SpringRunner::class)
9 | @SpringBootTest
10 | class SpringSecurityOAuth2ApplicationTests {
11 |
12 | @Test
13 | fun contextLoads() {
14 | }
15 |
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Example user template template
3 | ### Example user template
4 |
5 | # IntelliJ project files
6 | .idea
7 | *.iml
8 | out
9 | gen
10 | .DS_Store
11 | .gradle/
12 | app/.gitignore
13 | app/libs/
14 | app/proguard-rules.pro
15 | gradlew
16 | gradlew.bat
17 | local.properties
18 | settings.gradle
19 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/androidTest/java/com/sunnat629/mvvmroomexample/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.mvvmroomexample
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.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.getTargetContext()
22 | assertEquals("com.sunnat629.mvvmroomexample", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/java/com/sunnat629/mvvmroomexample/repository/dao/UserDAO.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.mvvmroomexample.repository.dao
2 |
3 | import android.arch.lifecycle.LiveData
4 | import android.arch.persistence.room.Dao
5 | import android.arch.persistence.room.Insert
6 | import android.arch.persistence.room.OnConflictStrategy
7 | import android.arch.persistence.room.Query
8 | import com.sunnat629.mvvmroomexample.model.Users
9 |
10 | @Dao
11 | interface UserDAO {
12 |
13 | @Insert(onConflict = OnConflictStrategy.REPLACE)
14 | fun addNewUser(users: Users)
15 |
16 | @Query("DELETE FROM USERS")
17 | fun deleteAllUsers()
18 |
19 | @Query("SELECT * FROM USERS ORDER BY username ASC")
20 | fun getAllUsers(): LiveData>
21 | }
22 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MVVM Room Example
3 | MainActivity
4 | No User
5 | User…
6 | Email ID…
7 | Contact Number…
8 | Address…
9 |
10 | Save
11 |
12 | ResultReplay
13 |
14 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/app/src/test/java/com/sunnat629/mvvmroomexample/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.mvvmroomexample
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/MVVMRoomExample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter06/MVVMRoomExample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/jdbc_test/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/src/main/kotlin/com/packtpub/sunnat629/jdbc_test/JdbcTestApplication.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jdbc_test
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 |
6 | @SpringBootApplication
7 | class JdbcTestApplication
8 |
9 | fun main(args: Array) {
10 | runApplication(*args)
11 | }
12 |
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/src/main/kotlin/com/packtpub/sunnat629/jdbc_test/model/UserModel.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jdbc_test
2 |
3 | data class UserModel(val id: Int,
4 | val name: String,
5 | val email: String,
6 | val contact_number: String)
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/src/main/kotlin/com/packtpub/sunnat629/jdbc_test/model/UserRowMapper.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jdbc_test.model
2 |
3 | import com.packtpub.sunnat629.jdbc_test.UserModel
4 | import org.springframework.jdbc.core.RowMapper
5 | import java.sql.ResultSet
6 | import java.sql.SQLException
7 |
8 | class UserRowMapper : RowMapper {
9 |
10 | @Throws(SQLException::class)
11 | override fun mapRow(row: ResultSet, rowNumber: Int): UserModel? {
12 | return UserModel(row.getInt("id"),
13 | row.getString("name"),
14 | row.getString("email"),
15 | row.getString("contact_number"))
16 | }
17 | }
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/src/main/kotlin/com/packtpub/sunnat629/jdbc_test/repository/UsersInterface.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jdbc_test.repository
2 |
3 | import com.packtpub.sunnat629.jdbc_test.UserModel
4 |
5 | interface UsersInterface {
6 | fun getAllUserList(): List
7 | fun getUserByID(id: Int): UserModel?
8 | fun addNewUser(userModel: UserModel)
9 | fun updateUser(userModel: UserModel, id: Int)
10 | fun deleteUser(id: Int)
11 | }
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # Database Configuration
2 |
3 | spring.datasource.url=jdbc:mysql://localhost:3306/my_app_schema
4 | spring.datasource.username=root
5 | spring.datasource.password=12345678
6 |
7 | # New port
8 | server.port=8082
--------------------------------------------------------------------------------
/Chapter06/jdbc_test/src/test/kotlin/com/packtpub/sunnat629/jdbc_test/jdbc_test/JdbcTestApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jdbc_test.jdbc_test
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.springframework.boot.test.context.SpringBootTest
6 | import org.springframework.test.context.junit4.SpringRunner
7 |
8 | @RunWith(SpringRunner::class)
9 | @SpringBootTest
10 | class JdbcTestApplicationTests {
11 |
12 | @Test
13 | fun contextLoads() {
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter06/jpa_db_test/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/src/main/kotlin/com/packtpub/sunnat629/jpa_db_test/JPATestApplication.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jpa_db_test
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing
6 |
7 | @SpringBootApplication
8 | @EnableJpaAuditing
9 | class JpaDbTestApplication
10 |
11 | fun main(args: Array) {
12 | runApplication(*args)
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/src/main/kotlin/com/packtpub/sunnat629/jpa_db_test/exception_handle/ResourceNotFoundException.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jpa_db_test.exception_handle
2 |
3 | import org.springframework.http.HttpStatus
4 | import org.springframework.web.bind.annotation.ResponseStatus
5 |
6 |
7 | @ResponseStatus(value = HttpStatus.NOT_FOUND)
8 | class ResourceNotFoundException( modelName: String,
9 | fieldName: String,
10 | fieldValue: Any) :
11 | RuntimeException(String.format("%s not found with %s : '%s'",
12 | modelName, fieldName, fieldValue))
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/src/main/kotlin/com/packtpub/sunnat629/jpa_db_test/repository/UserRepository.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.jpa_db_test.repository
2 |
3 | import com.packtpub.sunnat629.jpa_db_test.model.UserModel
4 | import org.springframework.data.jpa.repository.JpaRepository
5 | import org.springframework.stereotype.Repository
6 |
7 | @Repository
8 | interface UserRepository: JpaRepository
--------------------------------------------------------------------------------
/Chapter06/jpa_db_test/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
2 | spring.datasource.url = jdbc:mysql://localhost:3306/my_app_schema?useSSL=false&allowPublicKeyRetrieval=true
3 | spring.datasource.username = root
4 | spring.datasource.password = 12345678
5 |
6 |
7 | ## Hibernate Properties
8 | # The SQL dialect makes Hibernate generate better SQL for the chosen database
9 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
10 |
11 | # Hibernate ddl auto (create, create-drop, validate, update)
12 | spring.jpa.hibernate.ddl-auto = update
13 |
14 |
15 | # New port
16 | server.port=8081
17 |
--------------------------------------------------------------------------------
/Chapter07/Channels.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import kotlinx.coroutines.channels.Channel
4 | import kotlinx.coroutines.delay
5 | import kotlinx.coroutines.joinAll
6 | import kotlinx.coroutines.launch
7 | import kotlinx.coroutines.runBlocking
8 |
9 |
10 | fun main() = runBlocking {
11 | val channel = Channel()
12 | launch {
13 | channel.send(0)
14 | delay(100)
15 | channel.send(1)
16 | delay(200)
17 | }
18 | val theFirstElement = channel.receive()
19 | delay(400)
20 | val theSecondElement = channel.receive()
21 |
22 |
23 | joinAll()
24 | }
25 |
--------------------------------------------------------------------------------
/Chapter07/Coroutines.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import kotlinx.coroutines.GlobalScope
4 | import kotlinx.coroutines.async
5 | import kotlinx.coroutines.runBlocking
6 |
7 |
8 | class Image
9 |
10 | fun loadImage() : Image {
11 | Thread.sleep(3000)
12 | return Image()
13 | }
14 |
15 | fun main() = runBlocking {
16 | val subTask1 = GlobalScope.async { loadImage() }
17 | val subTask2 = GlobalScope.async { loadImage() }
18 | val subTask3 = GlobalScope.async { loadImage() }
19 |
20 | showImages(subTask1.await(), subTask2.await(), subTask3.await())
21 | }
22 |
23 | fun showImages(image1: Image, image2: Image, image3: Image) {
24 | // .......
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/Chapter07/Sequantial.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import kotlinx.coroutines.GlobalScope
4 | import kotlinx.coroutines.async
5 | import kotlinx.coroutines.delay
6 | import kotlinx.coroutines.runBlocking
7 |
8 |
9 | suspend fun loadUserDetails(): User {
10 | delay(3000)
11 | return User(0, "avatar")
12 | }
13 |
14 | suspend fun loadImage(avatar: String): Image {
15 | delay(3000)
16 | return Image()
17 | }
18 |
19 | fun main(args: Array) = runBlocking {
20 | val user = GlobalScope.async { loadUserDetails() }.await()
21 | val image = async { loadImage(user.avatar) }.await()
22 | showImage(image)
23 | }
--------------------------------------------------------------------------------
/Chapter07/ThreadPool.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import java.util.concurrent.Executors
4 |
5 | fun main() {
6 | val executor = Executors.newSingleThreadExecutor()
7 | executor.submit { loadImage() }
8 | executor.submit { loadImage() }
9 | }
--------------------------------------------------------------------------------
/Chapter09/ClientSide/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches/build_file_checksums.ser
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | .DS_Store
9 | /build
10 | /captures
11 | .externalNativeBuild
12 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/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
22 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/androidTest/java/com/sunnat629/clientside/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.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.getTargetContext()
22 | assertEquals("com.sunnat629.clientside", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/java/com/sunnat629/clientside/basicauth/BasicAuthInterceptor.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside.basicauth
2 |
3 | import okhttp3.Credentials
4 | import okhttp3.Interceptor
5 | import okhttp3.Response
6 | import java.io.IOException
7 |
8 | class BasicAuthInterceptor(user: String, password: String) : Interceptor {
9 |
10 | private val credentials: String = Credentials.basic(user, password)
11 |
12 | @Throws(IOException::class)
13 | override fun intercept(chain: Interceptor.Chain): Response {
14 | val request = chain.request()
15 | val authenticatedRequest = request.newBuilder()
16 | .header("Authorization", credentials).build()
17 | return chain.proceed(authenticatedRequest)
18 | }
19 | }
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/java/com/sunnat629/clientside/model/Comment.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside.model
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import java.util.*
5 |
6 | data class Comment (
7 | @SerializedName("id") var comment: Long?,
8 | @SerializedName("text") var text: String?,
9 | @SerializedName("postedBy") var profile: Profile?,
10 | @SerializedName("commentCreatedTime") var commentCreatedTime: Date?
11 | )
12 | {
13 | override fun toString(): String {
14 | return "Comment(comment=$comment, text=$text, profile=$profile, commentCreatedTime=$commentCreatedTime)"
15 | }
16 | }
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/java/com/sunnat629/clientside/model/Post.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside.model
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import java.util.*
5 |
6 | data class Post(
7 | @SerializedName("id") var postId: Long?,
8 | @SerializedName("text") var text: String?,
9 | @SerializedName("postedBy") var profile: Profile?,
10 | @SerializedName("postCreatedTime") var postCreatedTime: Date?,
11 | @SerializedName("comments") var comment: ArrayList?
12 | )
13 | {
14 | override fun toString(): String {
15 | return "Post(postId=$postId, text=$text, profile=$profile, postCreatedTime=$postCreatedTime, comment=$comment)"
16 | }
17 | }
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/java/com/sunnat629/clientside/repository/CommentService.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside.repository
2 |
3 | import com.sunnat629.clientside.model.Post
4 | import io.reactivex.Observable
5 | import retrofit2.http.*
6 |
7 | interface CommentService {
8 |
9 | // POST http://localhost:8080/comment/{user_id}/{post_id}
10 | // DELETE http://localhost:8080/comment/{id}
11 |
12 |
13 | // Post comment in a post by Profile ID and Post ID
14 | @POST("/comment/{user_id}/{post_id}")
15 | fun postCommentByPostId(@Path("post_id") postId: Long, @Path("user_id") userId: Long,
16 | @Query("commentText") commentText: String): Observable
17 |
18 | // delete comment List of a status
19 | @DELETE("/comment/{id}")
20 | fun deleteCommentByPostId(@Field("id") id: Long): Any
21 | }
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/java/com/sunnat629/clientside/util/Constants.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside.util
2 |
3 | object Constants {
4 | const val API_BASE_PATH = "http://10.0.2.2:8080"
5 | const val TIME_FORMAT = "EEE, d MMM yyyy hh:mm aaa"
6 | }
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/ic_autorenew_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/ic_autorenew_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/ic_face_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/ic_face_black_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/ic_face_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/ic_face_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/post_menu_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-hdpi/post_menu_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/ic_autorenew_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/ic_autorenew_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/ic_face_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/ic_face_black_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/ic_face_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/ic_face_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/post_menu_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-mdpi/post_menu_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/ic_autorenew_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/ic_autorenew_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/ic_face_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/ic_face_black_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/ic_face_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/ic_face_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/post_menu_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xhdpi/post_menu_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/ic_autorenew_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/ic_autorenew_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/ic_face_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/ic_face_black_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/ic_face_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/ic_face_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/post_menu_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxhdpi/post_menu_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/ic_autorenew_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/ic_autorenew_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/ic_face_black_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/ic_face_black_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/ic_face_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/ic_face_white_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/post_menu_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/drawable-xxxhdpi/post_menu_24dp.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable/ic_dashboard_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable/ic_home_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/drawable/ic_notifications_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/layout/layout_loading_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
12 |
19 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/menu/navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 | #43B8Ff
7 | #005A91
8 | #F1F6F9
9 |
10 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 12sp
7 |
8 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/app/src/test/java/com/sunnat629/clientside/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.clientside
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/ClientSide/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter09/ClientSide/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Chapter09/ClientSide/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Chapter09/social_network/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter09/social_network/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter09/social_network/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter09/social_network/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter09/social_network/src/main/kotlin/com/packtpub/sunnat629/social_network/SocialNetworkApplication.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.social_network
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing
6 |
7 | @SpringBootApplication
8 | @EnableJpaAuditing
9 | class SocialNetworkApplication
10 |
11 | fun main(args: Array) {
12 | runApplication(*args)
13 | }
--------------------------------------------------------------------------------
/Chapter09/social_network/src/main/kotlin/com/packtpub/sunnat629/social_network/model/LikeObj.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.social_network.model
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties
4 | import java.io.Serializable
5 | import javax.persistence.*
6 |
7 | @Entity
8 | class LikeObj(mProfile: Profile) : Serializable {
9 |
10 | @Id
11 | @GeneratedValue
12 | var id: Long? = 0
13 |
14 | @ManyToOne
15 | @JoinColumn(name = "profile_id")
16 | @JsonIgnoreProperties(/*"username",*/"password","email","accCreatedTime","firstName","lastName",
17 | "contactNumber","dob","city","country")
18 | var profile: Profile? = mProfile
19 |
20 | companion object {
21 |
22 | private const val serialVersionUID = 1
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Chapter09/social_network/src/main/kotlin/com/packtpub/sunnat629/social_network/model/UserRowMapper.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.social_network.model
2 |
3 | import org.springframework.jdbc.core.RowMapper
4 | import java.sql.ResultSet
5 | import java.sql.SQLException
6 |
7 | class UserRowMapper : RowMapper {
8 |
9 | @Throws(SQLException::class)
10 | override fun mapRow(row: ResultSet, rowNumber: Int): Profile? {
11 | val profile = Profile(row.getLong("id"),
12 | row.getString("username"),
13 | row.getString("password"))
14 |
15 | println(profile.toString())
16 | return profile
17 | }
18 | }
--------------------------------------------------------------------------------
/Chapter09/social_network/src/main/kotlin/com/packtpub/sunnat629/social_network/repository/UserExistRepository.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.social_network.repository
2 |
3 | import org.springframework.beans.factory.annotation.Autowired
4 | import org.springframework.jdbc.core.JdbcTemplate
5 | import org.springframework.stereotype.Repository
6 |
7 | @Repository
8 | class UserExistRepository: UserExistInterface {
9 | @Autowired
10 | private lateinit var jdbcTemplate: JdbcTemplate
11 |
12 | override fun isUserExist(name: String): Boolean {
13 | val sql = "SELECT count(*) FROM PROFILE WHERE username = ?"
14 | val count = jdbcTemplate.queryForObject(sql, Int::class.java, name)
15 | return count != 0
16 | }
17 |
18 | }
19 |
20 | interface UserExistInterface{
21 | fun isUserExist(name: String): Boolean
22 | }
23 |
--------------------------------------------------------------------------------
/Chapter09/social_network/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # ===============================
2 | # DATABASE
3 | # ===============================
4 |
5 | spring.datasource.url=jdbc:mysql://localhost:3306/e_borrow_book_schema?useSSL=false&allowPublicKeyRetrieval=true
6 | spring.datasource.username=root
7 | spring.datasource.password=12345678
8 |
9 | # ===============================
10 | # JPA / HIBERNATE
11 | # ===============================
12 | spring.jpa.show-sql=true
13 |
14 | # Hibernate ddl auto (create, create-drop, validate, update)
15 | spring.jpa.hibernate.ddl-auto = update
16 | spring.jpa.properties.hibernate.format_sql = true
17 |
18 | ## Hibernate Properties
19 | # The SQL dialect makes Hibernate generate better SQL for the chosen database
20 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
--------------------------------------------------------------------------------
/Chapter09/social_network/src/test/kotlin/com/packtpub/sunnat629/social_network/SocialNetworkApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.social_network
2 |
3 | import org.junit.runner.RunWith
4 | import org.springframework.boot.test.context.SpringBootTest
5 | import org.springframework.test.context.junit4.SpringRunner
6 |
7 | @RunWith(SpringRunner::class)
8 | @SpringBootTest
9 | class SocialNetworkApplicationTests {
10 |
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches/build_file_checksums.ser
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | .DS_Store
9 | /build
10 | /captures
11 | .externalNativeBuild
12 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/java/com/sunnat629/testingwithespresso/User.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.testingwithespresso
2 |
3 | data class User(var userID: Int,
4 | var username: String)
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Testing With Espresso
3 |
4 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/app/src/test/java/com/sunnat629/testingwithespresso/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.sunnat629.testingwithespresso
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.11'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.2.1'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/TestingWithEspresso/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Chapter10/TestingWithEspresso/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Chapter10/testing_application/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/Chapter10/testing_application/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter10/testing_application/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/Chapter10/testing_application/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/Chapter10/testing_application/src/main/kotlin/com/packtpub/sunnat629/testing_application/TestingApplication.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.testing_application
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 |
6 | @SpringBootApplication
7 | class TestingApplication
8 |
9 | fun main(args: Array) {
10 | runApplication(*args)
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/Chapter10/testing_application/src/main/kotlin/com/packtpub/sunnat629/testing_application/UserRepository.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.testing_application
2 |
3 | import org.springframework.data.jpa.repository.JpaRepository
4 |
5 | interface UserRepository: JpaRepository
--------------------------------------------------------------------------------
/Chapter10/testing_application/src/main/kotlin/com/packtpub/sunnat629/testing_application/Users.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.testing_application
2 |
3 | class Users {
4 | constructor(id: String?,
5 | name: String?) {
6 | this.id = id
7 | this.name = name
8 | }
9 |
10 | constructor(name: String?) {
11 | this.name = name
12 | }
13 |
14 | private var name: String? = null
15 | private var id: String? = null
16 | }
--------------------------------------------------------------------------------
/Chapter10/testing_application/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # ===============================
2 | # DATABASE
3 | # ===============================
4 |
5 | spring.datasource.url=jdbc:mysql://localhost:3306/my_app_schema?useSSL=false&allowPublicKeyRetrieval=true
6 | spring.datasource.username=root
7 | spring.datasource.password=12345678
8 |
9 | # ===============================
10 | # JPA / HIBERNATE
11 | # ===============================
12 | spring.jpa.show-sql=true
13 |
14 | # Hibernate ddl auto (create, create-drop, validate, update)
15 | spring.jpa.hibernate.ddl-auto = update
16 | spring.jpa.properties.hibernate.format_sql = true
17 |
18 | ## Hibernate Properties
19 | # The SQL dialect makes Hibernate generate better SQL for the chosen database
20 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
--------------------------------------------------------------------------------
/Chapter10/testing_application/src/test/kotlin/com/packtpub/sunnat629/testing_application/TestingApplicationTests.kt:
--------------------------------------------------------------------------------
1 | package com.packtpub.sunnat629.testing_application
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.springframework.boot.test.context.SpringBootTest
6 | import org.springframework.test.context.junit4.SpringRunner
7 |
8 | @RunWith(SpringRunner::class)
9 | @SpringBootTest
10 | class TestingApplicationTests {
11 |
12 | @Test
13 | fun contextLoads() {
14 | }
15 |
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/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
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/*
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 |
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development
2 |
3 | import android.os.Bundle
4 | import android.support.v7.app.AppCompatActivity
5 |
6 | class MainActivity : AppCompatActivity() {
7 |
8 | override fun onCreate(savedInstanceState: Bundle?) {
9 | super.onCreate(savedInstanceState)
10 | setContentView(R.layout.activity_main)
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter2/Annotations.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter2
2 |
3 | /**
4 | * Created by ihor_kucherenko on 9/18/18.
5 | * https://github.com/KucherenkoIhor
6 | */
7 |
8 |
9 | class Example1 {
10 | companion object {
11 | @JvmStatic
12 | fun companionClassMember() {}
13 | }
14 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter2/BasicSyntax.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter2
2 |
3 | /**
4 | * Created by ihor_kucherenko on 9/12/18.
5 | * https://github.com/KucherenkoIhor
6 | */
7 |
8 |
9 | val readOnly = 3
10 | var mutable = 3
11 |
12 | fun changeMutable() {
13 | mutable = 4
14 | }
15 |
16 | class Foo {
17 | val readOnly = 3
18 | var mutable = 3
19 |
20 | fun changeMutable() {
21 | mutable = 4
22 | }
23 | }
24 |
25 | class Bar {
26 | companion object {
27 | const val NAME = "Igor"
28 |
29 | fun printName() = println(NAME)
30 | }
31 | }
32 |
33 | fun test() {
34 | Bar.NAME
35 | Bar.printName()
36 | }
37 |
38 |
39 |
40 |
41 | //fun collection() {
42 | // List()
43 | //}
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter2/NullSafety.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter2
2 |
3 | /**
4 | * Created by ihor_kucherenko on 9/17/18.
5 | * https://github.com/KucherenkoIhor
6 | */
7 | fun example1() {
8 | var name: String? = "Igor"
9 | name = null
10 |
11 |
12 | name?.length?.compareTo(4)
13 |
14 | name?.length?.compareTo(4) ?: { println("name is null") }()
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter2/Ranges.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter2
2 |
3 | /**
4 | * Created by ihor_kucherenko on 9/16/18.
5 | * https://github.com/KucherenkoIhor
6 | */
7 | fun ranges() {
8 | for (i in 0..100) {
9 | // .....
10 | }
11 |
12 | (0..100)
13 | .filter { it > 50 }
14 | .map { it * 2 }
15 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter2/Reflection.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter2
2 |
3 | import kotlin.reflect.KClass
4 |
5 | /**
6 | * Created by ihor_kucherenko on 9/17/18.
7 | * https://github.com/KucherenkoIhor
8 | */
9 |
10 |
11 | val reference: KClass = String::class
12 |
13 | fun isOdd(number: Int): Boolean = number % 2 == 0
14 | val odds = listOf(1, 2, 3, 4, 5).filter(::isOdd)
15 |
16 | val referenceToOddsPreperty = ::odds
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter2/StringTemplates.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter2
2 |
3 | /**
4 | * Created by ihor_kucherenko on 9/17/18.
5 | * https://github.com/KucherenkoIhor
6 | */
7 |
8 |
9 | var number = 1
10 | val string = "number is $number"
11 |
12 |
13 | val name = "Igor"
14 | val lengthOfName = "length is ${name.length} and number is $number"
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter7/Channels.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import kotlinx.coroutines.channels.Channel
4 | import kotlinx.coroutines.delay
5 | import kotlinx.coroutines.joinAll
6 | import kotlinx.coroutines.launch
7 | import kotlinx.coroutines.runBlocking
8 |
9 |
10 | fun main() = runBlocking {
11 | val channel = Channel()
12 | launch {
13 | channel.send(0)
14 | delay(100)
15 | channel.send(1)
16 | delay(200)
17 | }
18 | val theFirstElement = channel.receive()
19 | delay(400)
20 | val theSecondElement = channel.receive()
21 |
22 |
23 | joinAll()
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter7/Coroutines.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import kotlinx.coroutines.GlobalScope
4 | import kotlinx.coroutines.async
5 | import kotlinx.coroutines.runBlocking
6 |
7 |
8 | class Image
9 |
10 | fun loadImage() : Image {
11 | Thread.sleep(3000)
12 | return Image()
13 | }
14 |
15 | fun main() = runBlocking {
16 | val subTask1 = GlobalScope.async { loadImage() }
17 | val subTask2 = GlobalScope.async { loadImage() }
18 | val subTask3 = GlobalScope.async { loadImage() }
19 |
20 | showImages(subTask1.await(), subTask2.await(), subTask3.await())
21 | }
22 |
23 | fun showImages(image1: Image, image2: Image, image3: Image) {
24 | // .......
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter7/Sequantial.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import kotlinx.coroutines.GlobalScope
4 | import kotlinx.coroutines.async
5 | import kotlinx.coroutines.delay
6 | import kotlinx.coroutines.runBlocking
7 |
8 |
9 | suspend fun loadUserDetails(): User {
10 | delay(3000)
11 | return User(0, "avatar")
12 | }
13 |
14 | suspend fun loadImage(avatar: String): Image {
15 | delay(3000)
16 | return Image()
17 | }
18 |
19 | fun main(args: Array) = runBlocking {
20 | val user = GlobalScope.async { loadUserDetails() }.await()
21 | val image = async { loadImage(user.avatar) }.await()
22 | showImage(image)
23 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/packt/learn_spring_for_android_application_development/chapter7/ThreadPool.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development.chapter7
2 |
3 | import java.util.concurrent.Executors
4 |
5 | fun main() {
6 | val executor = Executors.newSingleThreadExecutor()
7 | executor.submit { loadImage() }
8 | executor.submit { loadImage() }
9 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_xkcd.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Learn-Spring-for-Android-Application-Development
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/app/src/test.zip
--------------------------------------------------------------------------------
/app/src/test/java/com/packt/learn_spring_for_android_application_development/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.packt.learn_spring_for_android_application_development
2 |
3 | import com.packt.learn_spring_for_android_application_development.chapter7.loadImage
4 | import kotlinx.coroutines.experimental.async
5 | import kotlinx.coroutines.experimental.runBlocking
6 | import org.junit.Assert.assertNotNull
7 | import org.junit.Test
8 |
9 | /**
10 | * Example local unit test, which will execute on the development machine (host).
11 | *
12 | * See [testing documentation](http://d.android.com/tools/testing).
13 | */
14 | class ExampleUnitTest {
15 |
16 | @Test
17 | fun comicLoading() = runBlocking {
18 | val image = async { loadImage() }.await()
19 | assertNotNull(image)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.20'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.3.0'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Jan 29 10:03:29 EET 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------