├── .gitignore ├── .idea ├── caches │ └── build_file_checksums.ser ├── codeStyles │ └── Project.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── Chapter02 ├── Annotations.kt ├── BasicSyntax.kt ├── ControlFlow.kt ├── Functions.kt ├── NullSafety.kt ├── Ranges.kt ├── Reflection.kt └── StringTemplates.kt ├── Chapter03 ├── AnnotationBasedConfiguration │ ├── .gitignore │ ├── lib │ │ ├── aopalliance-1.0.jar │ │ ├── commons-logging-1.2.jar │ │ ├── kotlin-reflect-sources.jar │ │ ├── kotlin-reflect.jar │ │ ├── kotlin-stdlib-jdk7-sources.jar │ │ ├── kotlin-stdlib-jdk7.jar │ │ ├── kotlin-stdlib-jdk8-sources.jar │ │ ├── kotlin-stdlib-jdk8.jar │ │ ├── kotlin-stdlib-sources.jar │ │ ├── kotlin-stdlib.jar │ │ ├── kotlin-test-sources.jar │ │ ├── kotlin-test.jar │ │ ├── spring-aop-4.3.18.RELEASE.jar │ │ ├── spring-aspects-4.3.18.RELEASE.jar │ │ ├── spring-beans-4.3.18.RELEASE.jar │ │ ├── spring-context-4.3.18.RELEASE.jar │ │ ├── spring-context-support-4.3.18.RELEASE.jar │ │ ├── spring-core-4.3.18.RELEASE.jar │ │ ├── spring-expression-4.3.18.RELEASE.jar │ │ ├── spring-instrument-4.3.18.RELEASE.jar │ │ ├── spring-instrument-tomcat-4.3.18.RELEASE.jar │ │ ├── spring-jdbc-4.3.18.RELEASE.jar │ │ ├── spring-jms-4.3.18.RELEASE.jar │ │ ├── spring-messaging-4.3.18.RELEASE.jar │ │ ├── spring-orm-4.3.18.RELEASE.jar │ │ ├── spring-oxm-4.3.18.RELEASE.jar │ │ ├── spring-test-4.3.18.RELEASE.jar │ │ └── spring-tx-4.3.18.RELEASE.jar │ ├── out │ │ └── production │ │ │ └── AnnotationBasedConfiguration │ │ │ ├── autowiredAnnotation │ │ │ └── beans_for_autowired.xml │ │ │ ├── qualifierAnnotation │ │ │ └── beans_for_qualifier.xml │ │ │ └── requiredAnnotation │ │ │ └── beans_for_req.xml │ └── src │ │ ├── autowiredAnnotation │ │ ├── AnnotationBasedAutowiredApp.kt │ │ ├── UserDetails.kt │ │ ├── Users.kt │ │ ├── UsersForAutowired.kt │ │ └── beans_for_autowired.xml │ │ ├── qualifierAnnotation │ │ ├── AnnotationBasedQualifierApp.kt │ │ ├── Fighters.kt │ │ ├── UsersForQualifier.kt │ │ └── beans_for_qualifier.xml │ │ └── requiredAnnotation │ │ ├── AnnotationBasedReqApp.kt │ │ ├── UsersForReq.kt │ │ └── beans_for_req.xml ├── JavaBasedConfiguration │ ├── .gitignore │ ├── lib │ │ ├── aopalliance-1.0.jar │ │ ├── commons-logging-1.2.jar │ │ ├── kotlin-reflect-sources.jar │ │ ├── kotlin-reflect.jar │ │ ├── kotlin-stdlib-jdk7-sources.jar │ │ ├── kotlin-stdlib-jdk7.jar │ │ ├── kotlin-stdlib-jdk8-sources.jar │ │ ├── kotlin-stdlib-jdk8.jar │ │ ├── kotlin-stdlib-sources.jar │ │ ├── kotlin-stdlib.jar │ │ ├── kotlin-test-sources.jar │ │ ├── kotlin-test.jar │ │ ├── spring-aop-4.3.18.RELEASE.jar │ │ ├── spring-aspects-4.3.18.RELEASE.jar │ │ ├── spring-beans-4.3.18.RELEASE.jar │ │ ├── spring-context-4.3.18.RELEASE.jar │ │ ├── spring-context-support-4.3.18.RELEASE.jar │ │ ├── spring-core-4.3.18.RELEASE.jar │ │ ├── spring-expression-4.3.18.RELEASE.jar │ │ ├── spring-instrument-4.3.18.RELEASE.jar │ │ ├── spring-instrument-tomcat-4.3.18.RELEASE.jar │ │ ├── spring-jdbc-4.3.18.RELEASE.jar │ │ ├── spring-jms-4.3.18.RELEASE.jar │ │ ├── spring-messaging-4.3.18.RELEASE.jar │ │ ├── spring-orm-4.3.18.RELEASE.jar │ │ ├── spring-oxm-4.3.18.RELEASE.jar │ │ ├── spring-test-4.3.18.RELEASE.jar │ │ └── spring-tx-4.3.18.RELEASE.jar │ ├── out │ │ └── production │ │ │ └── JavaBasedConfiguration │ │ │ ├── META-INF │ │ │ └── JavaBasedConfiguration.kotlin_module │ │ │ ├── configurationBeanAnnotations │ │ │ ├── GreetingConfBean.class │ │ │ ├── GreetingConfigurationConfBean.class │ │ │ └── MainAppConfBeanKt.class │ │ │ ├── dependenciesInjectBean │ │ │ ├── GreetingConfigurationDIBean.class │ │ │ ├── GreetingDIBean.class │ │ │ ├── GreetingDetailsDIBean.class │ │ │ └── MainAppDIBeanKt.class │ │ │ ├── importAnnotation │ │ │ ├── Boo.class │ │ │ ├── ConfigBoo.class │ │ │ ├── ConfigFoo.class │ │ │ ├── Foo.class │ │ │ └── MainAppImportKt.class │ │ │ └── lifecycleCallback │ │ │ ├── ConfigFoo.class │ │ │ ├── Foo.class │ │ │ └── MainAppLifeCallKt.class │ └── src │ │ ├── configurationBeanAnnotations │ │ ├── GreetingConfBean.kt │ │ ├── GreetingConfigurationConfBean.kt │ │ └── MainAppConfBean.kt │ │ ├── dependenciesInjectBean │ │ ├── GreetingConfigurationDIBean.kt │ │ ├── GreetingDIBean.kt │ │ ├── GreetingDetailsDIBean.kt │ │ └── MainAppDIBean.kt │ │ ├── importAnnotation │ │ ├── Boo.kt │ │ ├── ConfigBooImport.kt │ │ └── MainAppImport.kt │ │ └── lifecycleCallback │ │ ├── ConfigFoo.kt │ │ ├── Foo.kt │ │ └── MainAppLifeCall.kt ├── SpringMVCKotlin │ ├── .gitignore │ ├── lib │ │ ├── aopalliance-1.0.jar │ │ ├── commons-logging-1.2.jar │ │ ├── spring-aop-4.3.18.RELEASE.jar │ │ ├── spring-aspects-4.3.18.RELEASE.jar │ │ ├── spring-beans-4.3.18.RELEASE.jar │ │ ├── spring-context-4.3.18.RELEASE.jar │ │ ├── spring-context-support-4.3.18.RELEASE.jar │ │ ├── spring-core-4.3.18.RELEASE.jar │ │ ├── spring-expression-4.3.18.RELEASE.jar │ │ ├── spring-instrument-4.3.18.RELEASE.jar │ │ ├── spring-instrument-tomcat-4.3.18.RELEASE.jar │ │ ├── spring-jdbc-4.3.18.RELEASE.jar │ │ ├── spring-jms-4.3.18.RELEASE.jar │ │ ├── spring-messaging-4.3.18.RELEASE.jar │ │ ├── spring-orm-4.3.18.RELEASE.jar │ │ ├── spring-oxm-4.3.18.RELEASE.jar │ │ ├── spring-test-4.3.18.RELEASE.jar │ │ ├── spring-tx-4.3.18.RELEASE.jar │ │ ├── spring-web-4.3.18.RELEASE.jar │ │ ├── spring-webmvc-4.3.18.RELEASE.jar │ │ ├── spring-webmvc-portlet-4.3.18.RELEASE.jar │ │ └── spring-websocket-4.3.18.RELEASE.jar │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── mvckotlin │ │ │ ├── MVCKotlinApp.kt │ │ │ └── MVCKotlinAppController.kt │ └── web │ │ ├── WEB-INF │ │ ├── jsp │ │ │ └── welcome.jsp │ │ ├── spring-mvc-kotlin-servlet.xml │ │ └── web.xml │ │ └── index.html ├── SpringbootkotlinApplication │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── pucktpub │ │ │ │ └── sunnat629 │ │ │ │ └── springbootkotlin │ │ │ │ └── springbootkotlin │ │ │ │ ├── AppController.kt │ │ │ │ └── SpringBootKotlinApplication.kt │ │ └── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ └── index.html │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── pucktpub │ │ └── sunnat629 │ │ └── springbootkotlin │ │ └── springbootkotlin │ │ └── SpringbootkotlinApplicationTests.kt └── XMLBasedSpringConfiguration │ ├── .gitignore │ ├── lib │ ├── aopalliance-1.0.jar │ ├── commons-logging-1.2.jar │ ├── spring-aop-4.3.18.RELEASE.jar │ ├── spring-aspects-4.3.18.RELEASE.jar │ ├── spring-beans-4.3.18.RELEASE.jar │ ├── spring-context-4.3.18.RELEASE.jar │ ├── spring-context-support-4.3.18.RELEASE.jar │ ├── spring-core-4.3.18.RELEASE.jar │ ├── spring-expression-4.3.18.RELEASE.jar │ ├── spring-instrument-4.3.18.RELEASE.jar │ ├── spring-instrument-tomcat-4.3.18.RELEASE.jar │ ├── spring-jdbc-4.3.18.RELEASE.jar │ ├── spring-jms-4.3.18.RELEASE.jar │ ├── spring-messaging-4.3.18.RELEASE.jar │ ├── spring-orm-4.3.18.RELEASE.jar │ ├── spring-oxm-4.3.18.RELEASE.jar │ ├── spring-test-4.3.18.RELEASE.jar │ └── spring-tx-4.3.18.RELEASE.jar │ ├── out │ └── production │ │ └── BeansScopes │ │ ├── META-INF │ │ └── BeansScopes.kotlin_module │ │ ├── beans.xml │ │ └── ktPackage │ │ ├── UserGreeting.class │ │ ├── UserSurname.class │ │ └── XMLBasedApplicationKt.class │ └── src │ ├── UserGreeting.kt │ ├── UserSurname.kt │ ├── XMLBasedApplication.kt │ └── beans.xml ├── Chapter04 ├── RestTempTest │ ├── .gitignore │ ├── .idea │ │ ├── codeStyles │ │ │ └── Project.xml │ │ ├── gradle.xml │ │ └── vcs.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── springforandroid │ │ │ │ └── pactpub │ │ │ │ └── sunnat629 │ │ │ │ └── resttemptest │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ ├── com │ │ │ │ │ └── packt │ │ │ │ │ │ └── learn_spring_for_android_application_development │ │ │ │ │ │ └── chapter8 │ │ │ │ │ │ ├── ListenerActivity.kt │ │ │ │ │ │ ├── RxActivity.kt │ │ │ │ │ │ └── XKCDActivity.kt │ │ │ │ └── springforandroid │ │ │ │ │ └── pactpub │ │ │ │ │ └── sunnat629 │ │ │ │ │ └── resttemptest │ │ │ │ │ ├── GitHubAPIModel.kt │ │ │ │ │ ├── GithubInterface.kt │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ └── Registration.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_listener.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_rx.xml │ │ │ │ └── activity_xkcd2.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ ├── com │ │ │ └── packt │ │ │ │ └── learn_spring_for_android_application_development │ │ │ │ ├── FluxTests.kt │ │ │ │ └── RxTest.kt │ │ │ └── springforandroid │ │ │ └── pactpub │ │ │ └── sunnat629 │ │ │ └── resttemptest │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── RetrofitinKotlinTest │ ├── .gitignore │ ├── .idea │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ └── runConfigurations.xml │ ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── springforandroid │ │ │ └── pactpub │ │ │ └── sunnat629 │ │ │ └── retrofitinkotlintest │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── springforandroid │ │ │ │ └── pactpub │ │ │ │ └── sunnat629 │ │ │ │ └── retrofitinkotlintest │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── model │ │ │ │ └── GitHubUserModel.kt │ │ │ │ └── repository │ │ │ │ ├── GithubService.kt │ │ │ │ └── GithubServiceImpl.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── springforandroid │ │ └── pactpub │ │ └── sunnat629 │ │ └── retrofitinkotlintest │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── Chapter05 ├── BasicAuthinKotlin │ ├── .gitignore │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── springforandroid │ │ │ │ └── pactpub │ │ │ │ └── sunnat629 │ │ │ │ └── basicauthinkotlin │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── springforandroid │ │ │ │ └── pactpub │ │ │ │ └── sunnat629 │ │ │ │ └── basicauthinkotlin │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── adapter │ │ │ │ └── UserListAdapter.kt │ │ │ │ ├── basicauth │ │ │ │ └── BasicAuthInterceptor.kt │ │ │ │ ├── model │ │ │ │ └── UserModel.kt │ │ │ │ └── repository │ │ │ │ ├── UserService.kt │ │ │ │ └── UserServiceImpl.kt │ │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ └── user_list_item.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── springsecurity │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── packtpub │ │ │ │ └── sunnat629 │ │ │ │ └── springsecurity │ │ │ │ ├── AccessDecisionManager.kt │ │ │ │ ├── ApplicationSecurity.kt │ │ │ │ ├── AuthenticationManager.kt │ │ │ │ ├── AuthenticationProvider.kt │ │ │ │ ├── CustomService.kt │ │ │ │ └── SpringSecurityApplication.kt │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── packtpub │ │ └── sunnat629 │ │ └── springsecurity │ │ └── SpringSecurityApplicationTests.kt ├── ssbasicauth │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── packtpub │ │ │ │ └── sunnat629 │ │ │ │ └── ssbasicauth │ │ │ │ ├── SSBasicAuthApplication.kt │ │ │ │ ├── config │ │ │ │ ├── AuthenticationEntryPoint.kt │ │ │ │ ├── MyApplicationInitializer.kt │ │ │ │ └── SSConfig.kt │ │ │ │ ├── controller │ │ │ │ └── UserController.kt │ │ │ │ └── model │ │ │ │ └── Users.kt │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── packtpub │ │ └── sunnat629 │ │ └── ssbasicauth │ │ └── SsBasicAuthApplicationTests.kt └── ssoauth2 │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── packtpub │ │ │ └── sunnat629 │ │ │ └── ssoauth2 │ │ │ └── ssoauth2 │ │ │ ├── SpringSecurityOAuth2Application.kt │ │ │ ├── config │ │ │ ├── client │ │ │ │ └── SecurityConfiguration.kt │ │ │ └── server │ │ │ │ ├── AuthorizationServerConfig.kt │ │ │ │ └── ResourceServerConfig.kt │ │ │ └── controller │ │ │ └── UserController.kt │ └── resources │ │ └── application.properties │ └── test │ └── kotlin │ └── com │ └── packtpub │ └── sunnat629 │ └── ssoauth2 │ └── ssoauth2 │ └── SpringSecurityOAuth2ApplicationTests.kt ├── Chapter06 ├── MVVMRoomExample │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── sunnat629 │ │ │ │ └── mvvmroomexample │ │ │ │ ├── ExampleInstrumentedTest.kt │ │ │ │ └── MainActivityInstrumentationTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── sunnat629 │ │ │ │ │ └── mvvmroomexample │ │ │ │ │ ├── db │ │ │ │ │ └── UsersRoomDatabase.kt │ │ │ │ │ ├── model │ │ │ │ │ └── Users.kt │ │ │ │ │ ├── repository │ │ │ │ │ ├── UsersRepository.kt │ │ │ │ │ └── dao │ │ │ │ │ │ └── UserDAO.kt │ │ │ │ │ ├── ui │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ ├── NewUserActivity.kt │ │ │ │ │ └── adapter │ │ │ │ │ │ └── UserListAdapter.kt │ │ │ │ │ └── viewmodel │ │ │ │ │ └── MainViewModel.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_new_user.xml │ │ │ │ ├── content_main.xml │ │ │ │ └── recyclerview_item.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── sunnat629 │ │ │ └── mvvmroomexample │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ └── gradle │ │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── jdbc_test │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── packtpub │ │ │ │ └── sunnat629 │ │ │ │ └── jdbc_test │ │ │ │ ├── JdbcTestApplication.kt │ │ │ │ ├── controller │ │ │ │ └── UserController.kt │ │ │ │ ├── model │ │ │ │ ├── UserModel.kt │ │ │ │ └── UserRowMapper.kt │ │ │ │ ├── repository │ │ │ │ ├── UserRepository.kt │ │ │ │ └── UsersInterface.kt │ │ │ │ └── service │ │ │ │ └── UserService.kt │ │ └── resources │ │ │ ├── application.properties │ │ │ └── script.sql │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── packtpub │ │ └── sunnat629 │ │ └── jdbc_test │ │ └── jdbc_test │ │ └── JdbcTestApplicationTests.kt └── jpa_db_test │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── packtpub │ │ │ └── sunnat629 │ │ │ └── jpa_db_test │ │ │ ├── JPATestApplication.kt │ │ │ ├── controller │ │ │ └── UserController.kt │ │ │ ├── exception_handle │ │ │ └── ResourceNotFoundException.kt │ │ │ ├── model │ │ │ └── UserModel.kt │ │ │ └── repository │ │ │ └── UserRepository.kt │ └── resources │ │ └── application.properties │ └── test │ └── kotlin │ └── com │ └── packtpub │ └── sunnat629 │ └── jpa_db_test │ └── jpa_db_test │ └── JpaDbTestApplicationTests.kt ├── Chapter07 ├── Callbacks.kt ├── Channels.kt ├── Coroutines.kt ├── Presentation.kt ├── Sequantial.kt ├── ThreadPool.kt └── XKCDActivity.kt ├── Chapter08 ├── ListenerActivity.kt ├── RxActivity.kt └── XKCDActivity.kt ├── Chapter09 ├── ClientSide │ ├── .gitignore │ ├── .idea │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ └── runConfigurations.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── sunnat629 │ │ │ │ └── clientside │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── sunnat629 │ │ │ │ │ └── clientside │ │ │ │ │ ├── adapter │ │ │ │ │ ├── CommentRecycleViewAdapter.kt │ │ │ │ │ └── PostRecycleViewAdapter.kt │ │ │ │ │ ├── api │ │ │ │ │ └── APIClient.kt │ │ │ │ │ ├── basicauth │ │ │ │ │ └── BasicAuthInterceptor.kt │ │ │ │ │ ├── model │ │ │ │ │ ├── Comment.kt │ │ │ │ │ ├── Post.kt │ │ │ │ │ └── Profile.kt │ │ │ │ │ ├── repository │ │ │ │ │ ├── CommentService.kt │ │ │ │ │ ├── PostService.kt │ │ │ │ │ └── ProfileService.kt │ │ │ │ │ ├── ui │ │ │ │ │ ├── LoginActivity.kt │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ ├── PostDetailsActivity.kt │ │ │ │ │ ├── ProfileActivity.kt │ │ │ │ │ └── RegistrationActivity.kt │ │ │ │ │ └── util │ │ │ │ │ ├── Constants.kt │ │ │ │ │ ├── PrefUtils.kt │ │ │ │ │ ├── UIHelper.kt │ │ │ │ │ └── UtilMethods.kt │ │ │ └── res │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_autorenew_white_24dp.png │ │ │ │ ├── ic_face_black_24dp.png │ │ │ │ ├── ic_face_white_24dp.png │ │ │ │ └── post_menu_24dp.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_autorenew_white_24dp.png │ │ │ │ ├── ic_face_black_24dp.png │ │ │ │ ├── ic_face_white_24dp.png │ │ │ │ └── post_menu_24dp.png │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_autorenew_white_24dp.png │ │ │ │ ├── ic_face_black_24dp.png │ │ │ │ ├── ic_face_white_24dp.png │ │ │ │ └── post_menu_24dp.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_autorenew_white_24dp.png │ │ │ │ ├── ic_face_black_24dp.png │ │ │ │ ├── ic_face_white_24dp.png │ │ │ │ └── post_menu_24dp.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_autorenew_white_24dp.png │ │ │ │ ├── ic_face_black_24dp.png │ │ │ │ ├── ic_face_white_24dp.png │ │ │ │ └── post_menu_24dp.png │ │ │ │ ├── drawable │ │ │ │ ├── ic_dashboard_black_24dp.xml │ │ │ │ ├── ic_home_black_24dp.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── ic_notifications_black_24dp.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_login.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_post_details.xml │ │ │ │ ├── activity_profile.xml │ │ │ │ ├── activity_registration.xml │ │ │ │ ├── comment_item.xml │ │ │ │ ├── layout_loading_dialog.xml │ │ │ │ ├── post_dialog.xml │ │ │ │ ├── post_item.xml │ │ │ │ └── user_list_item.xml │ │ │ │ ├── menu │ │ │ │ ├── menu_main.xml │ │ │ │ └── navigation.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── sunnat629 │ │ │ └── clientside │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── social_network │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── packtpub │ │ │ └── sunnat629 │ │ │ └── social_network │ │ │ ├── SocialNetworkApplication.kt │ │ │ ├── controller │ │ │ └── AppController.kt │ │ │ ├── model │ │ │ ├── Comment.kt │ │ │ ├── LikeObj.kt │ │ │ ├── Post.kt │ │ │ ├── Profile.kt │ │ │ └── UserRowMapper.kt │ │ │ ├── repository │ │ │ ├── DeletePCLRepository.kt │ │ │ ├── Repositories.kt │ │ │ ├── UserByNameRepository.kt │ │ │ ├── UserExistRepository.kt │ │ │ └── UserLogInRepository.kt │ │ │ ├── security │ │ │ ├── AuthenticationEntryPoint.kt │ │ │ └── SecurityConfigurer.kt │ │ │ └── service │ │ │ └── CustomUserDetailsService.kt │ └── resources │ │ └── application.properties │ └── test │ ├── kotlin │ └── com │ │ └── packtpub │ │ └── sunnat629 │ │ └── social_network │ │ ├── ProfileRepositoryTest.kt │ │ └── SocialNetworkApplicationTests.kt │ └── resources │ └── application.properties ├── Chapter10 ├── TestingWithEspresso │ ├── .gitignore │ ├── .idea │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ ├── runConfigurations.xml │ │ └── vcs.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── sunnat629 │ │ │ │ └── testingwithespresso │ │ │ │ ├── CustomAssertion.kt │ │ │ │ ├── CustomUserMatchers.kt │ │ │ │ ├── ExampleInstrumentedTest.kt │ │ │ │ ├── MainActivityTest.kt │ │ │ │ └── MyViewAction.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── sunnat629 │ │ │ │ │ └── testingwithespresso │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ ├── User.kt │ │ │ │ │ └── UserItemAdapter.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── user_item.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── sunnat629 │ │ │ └── testingwithespresso │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── testing_application │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── packtpub │ │ │ └── sunnat629 │ │ │ └── testing_application │ │ │ ├── TestingApplication.kt │ │ │ ├── UserController.kt │ │ │ ├── UserRepository.kt │ │ │ └── Users.kt │ └── resources │ │ └── application.properties │ └── test │ └── kotlin │ ├── com │ └── packtpub │ │ └── sunnat629 │ │ └── testing_application │ │ ├── JUnitTestClass.kt │ │ └── TestingApplicationTests.kt │ └── resources │ └── application.properties ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── packt │ │ └── learn_spring_for_android_application_development │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── packt │ │ │ └── learn_spring_for_android_application_development │ │ │ ├── .gitignore │ │ │ ├── MainActivity.kt │ │ │ ├── chapter2 │ │ │ ├── Annotations.kt │ │ │ ├── BasicSyntax.kt │ │ │ ├── ControlFlow.kt │ │ │ ├── Functions.kt │ │ │ ├── NullSafety.kt │ │ │ ├── Ranges.kt │ │ │ ├── Reflection.kt │ │ │ └── StringTemplates.kt │ │ │ ├── chapter7 │ │ │ ├── Callbacks.kt │ │ │ ├── Channels.kt │ │ │ ├── Coroutines.kt │ │ │ ├── Presentation.kt │ │ │ ├── Sequantial.kt │ │ │ ├── ThreadPool.kt │ │ │ └── XKCDActivity.kt │ │ │ └── chapter8 │ │ │ ├── ListenerActivity.kt │ │ │ ├── RxActivity.kt │ │ │ └── XKCDActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_listener.xml │ │ ├── activity_main.xml │ │ ├── activity_rx.xml │ │ ├── activity_xkcd.xml │ │ └── activity_xkcd2.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── test.zip │ └── test │ └── java │ └── com │ └── packt │ └── learn_spring_for_android_application_development │ ├── ChannelsUnitTest.kt │ ├── ExampleUnitTest.kt │ ├── FluxTests.kt │ └── RxTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter02/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 | } -------------------------------------------------------------------------------- /Chapter02/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 | //} -------------------------------------------------------------------------------- /Chapter02/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 | -------------------------------------------------------------------------------- /Chapter02/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 | } -------------------------------------------------------------------------------- /Chapter02/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 -------------------------------------------------------------------------------- /Chapter02/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" -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-reflect-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-reflect-sources.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-reflect.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-reflect.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk7-sources.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk7.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk8-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk8-sources.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-jdk8.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib-sources.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-stdlib.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-test-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-test-sources.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/kotlin-test.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/kotlin-test.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-aop-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-aop-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-aspects-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-aspects-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-beans-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-beans-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-context-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-context-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-context-support-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-context-support-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-core-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-core-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-expression-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-expression-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-instrument-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-instrument-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-jdbc-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-jdbc-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-jms-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-jms-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-messaging-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-messaging-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-orm-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-orm-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-oxm-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-oxm-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-test-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-test-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/lib/spring-tx-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/AnnotationBasedConfiguration/lib/spring-tx-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/autowiredAnnotation/AnnotationBasedAutowiredApp.kt: -------------------------------------------------------------------------------- 1 | package requiredAnnotation 2 | 3 | import org.springframework.context.support.ClassPathXmlApplicationContext 4 | 5 | 6 | fun main(args: Array) { 7 | val context = ClassPathXmlApplicationContext("autowiredAnnotation/beans_for_autowired.xml") 8 | 9 | val usersForAutowired = context.getBean("users") as UsersForAutowired 10 | usersForAutowired.getUserDetails() 11 | } 12 | -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/autowiredAnnotation/UserDetails.kt: -------------------------------------------------------------------------------- 1 | package autowiredAnnotation 2 | 3 | class UserDetails{ 4 | init { 5 | println("This class has all the details of the user") 6 | } 7 | 8 | fun getDetails(){ 9 | println("Name: Naruto Uzumaki") 10 | println("Village: Konohagakure") 11 | } 12 | } -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/autowiredAnnotation/Users.kt: -------------------------------------------------------------------------------- 1 | package autowiredAnnotation 2 | 3 | import org.springframework.beans.factory.annotation.Autowired 4 | 5 | class User(val name: String, 6 | val id: String) 7 | 8 | 9 | class Users{ 10 | private var user:User ?= null 11 | 12 | @Autowired 13 | fun setUser(user: User){ 14 | this.user = user 15 | } 16 | } -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/autowiredAnnotation/UsersForAutowired.kt: -------------------------------------------------------------------------------- 1 | package requiredAnnotation 2 | 3 | import autowiredAnnotation.UserDetails 4 | import org.springframework.beans.factory.annotation.Autowired 5 | 6 | class UsersForAutowired @Autowired constructor(private var userDetails: UserDetails) { 7 | init { 8 | println("UsersForAutowired constructor.") 9 | } 10 | 11 | fun getUserDetails() { 12 | this.userDetails.getDetails() 13 | } 14 | } -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/qualifierAnnotation/AnnotationBasedQualifierApp.kt: -------------------------------------------------------------------------------- 1 | package requiredAnnotation 2 | 3 | import org.springframework.context.support.ClassPathXmlApplicationContext 4 | import qualifierAnnotation.Fighters 5 | 6 | 7 | fun main(args: Array) { 8 | val context = ClassPathXmlApplicationContext("qualifierAnnotation/beans_for_qualifier.xml") 9 | 10 | val fighters = context.getBean("fighters") as Fighters 11 | fighters.getName() 12 | fighters.getVillage() 13 | } 14 | -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/qualifierAnnotation/Fighters.kt: -------------------------------------------------------------------------------- 1 | package qualifierAnnotation 2 | 3 | import org.springframework.beans.factory.annotation.Autowired 4 | import org.springframework.beans.factory.annotation.Qualifier 5 | import sun.text.normalizer.UCharacter.getAge 6 | 7 | 8 | class Fighters { 9 | @Autowired 10 | @Qualifier("fighter2") 11 | lateinit var usersForQualifier: UsersForQualifier 12 | 13 | init { 14 | println("Fighters constructor.") 15 | } 16 | 17 | fun getName() { 18 | println("Name: " + usersForQualifier.getName()) 19 | } 20 | 21 | fun getVillage() { 22 | println("Village: " + usersForQualifier.getVillage()) 23 | } 24 | } -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/qualifierAnnotation/UsersForQualifier.kt: -------------------------------------------------------------------------------- 1 | package qualifierAnnotation 2 | 3 | class UsersForQualifier{ 4 | private var village: String? = null 5 | private var name: String? = null 6 | 7 | fun setVillage(village: String?) { 8 | this.village = village 9 | } 10 | 11 | fun getVillage(): String? { 12 | return village 13 | } 14 | 15 | fun setName(name: String) { 16 | this.name = name 17 | } 18 | 19 | fun getName(): String? { 20 | return name 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/requiredAnnotation/AnnotationBasedReqApp.kt: -------------------------------------------------------------------------------- 1 | package requiredAnnotation 2 | 3 | import org.springframework.context.support.ClassPathXmlApplicationContext 4 | 5 | 6 | fun main(args: Array) { 7 | val context = ClassPathXmlApplicationContext("requiredAnnotation/beans_for_req.xml") 8 | val users = context.getBean("users") as UsersForReq 9 | 10 | println("Name: "+users.getName()) 11 | println("Village: "+users.getVillage()) 12 | } 13 | -------------------------------------------------------------------------------- /Chapter03/AnnotationBasedConfiguration/src/requiredAnnotation/UsersForReq.kt: -------------------------------------------------------------------------------- 1 | package requiredAnnotation 2 | 3 | import org.springframework.beans.factory.annotation.Required 4 | 5 | 6 | 7 | class UsersForReq{ 8 | private var village: String? = null 9 | private var name: String? = null 10 | 11 | @Required 12 | fun setVillage(village: String?) { 13 | this.village = village 14 | } 15 | 16 | fun getVillage(): String? { 17 | return village 18 | } 19 | 20 | @Required 21 | fun setName(name: String) { 22 | this.name = name 23 | } 24 | 25 | fun getName(): String? { 26 | return name 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-reflect-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-reflect-sources.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-reflect.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-reflect.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk7-sources.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk7.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk8-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk8-sources.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-jdk8.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib-sources.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-stdlib.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-test-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-test-sources.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/kotlin-test.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/kotlin-test.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-aop-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-aop-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-aspects-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-aspects-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-beans-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-beans-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-context-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-context-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-context-support-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-context-support-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-core-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-core-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-expression-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-expression-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-instrument-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-instrument-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-jdbc-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-jdbc-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-jms-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-jms-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-messaging-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-messaging-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-orm-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-orm-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-oxm-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-oxm-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-test-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-test-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/lib/spring-tx-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/lib/spring-tx-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/META-INF/JavaBasedConfiguration.kotlin_module: -------------------------------------------------------------------------------- 1 |  2 | 1 3 | configurationBeanAnnotationsMainAppConfBeanKt 4 | ) 5 | dependenciesInjectBeanMainAppDIBeanKt 6 | # 7 | importAnnotationMainAppImportKt 8 | & 9 | lifecycleCallbackMainAppLifeCallKt -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/configurationBeanAnnotations/GreetingConfBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/configurationBeanAnnotations/GreetingConfBean.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/configurationBeanAnnotations/GreetingConfigurationConfBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/configurationBeanAnnotations/GreetingConfigurationConfBean.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/configurationBeanAnnotations/MainAppConfBeanKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/configurationBeanAnnotations/MainAppConfBeanKt.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/GreetingConfigurationDIBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/GreetingConfigurationDIBean.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/GreetingDIBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/GreetingDIBean.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/GreetingDetailsDIBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/GreetingDetailsDIBean.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/MainAppDIBeanKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/dependenciesInjectBean/MainAppDIBeanKt.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/Boo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/Boo.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/ConfigBoo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/ConfigBoo.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/ConfigFoo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/ConfigFoo.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/Foo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/Foo.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/MainAppImportKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/importAnnotation/MainAppImportKt.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/lifecycleCallback/ConfigFoo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/lifecycleCallback/ConfigFoo.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/lifecycleCallback/Foo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/lifecycleCallback/Foo.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/lifecycleCallback/MainAppLifeCallKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/JavaBasedConfiguration/out/production/JavaBasedConfiguration/lifecycleCallback/MainAppLifeCallKt.class -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/configurationBeanAnnotations/GreetingConfBean.kt: -------------------------------------------------------------------------------- 1 | package configurationBeanAnnotations 2 | 3 | class GreetingConfBean{ 4 | private var users: String? = null 5 | fun setUsers(users: String) { 6 | this.users = users 7 | } 8 | fun getUsers() { 9 | println("Welcome, $users!!") 10 | } 11 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/configurationBeanAnnotations/GreetingConfigurationConfBean.kt: -------------------------------------------------------------------------------- 1 | package configurationBeanAnnotations 2 | 3 | import org.springframework.context.annotation.Bean 4 | import org.springframework.context.annotation.Configuration 5 | 6 | 7 | @Configuration 8 | open class GreetingConfigurationConfBean{ 9 | @Bean 10 | open fun greeting(): GreetingConfBean{ 11 | return GreetingConfBean() 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/configurationBeanAnnotations/MainAppConfBean.kt: -------------------------------------------------------------------------------- 1 | package configurationBeanAnnotations 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext 4 | 5 | fun main(args: Array) { 6 | val applicationContext = AnnotationConfigApplicationContext(GreetingConfigurationConfBean::class.java) 7 | 8 | val greeting = applicationContext.getBean(GreetingConfBean::class.java) 9 | greeting.setUsers("Naruto Uzumaki") 10 | greeting.getUsers() 11 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/dependenciesInjectBean/GreetingConfigurationDIBean.kt: -------------------------------------------------------------------------------- 1 | package dependenciesInjectBean 2 | 3 | import org.springframework.context.annotation.Bean 4 | import org.springframework.context.annotation.Configuration 5 | 6 | @Configuration 7 | open class GreetingConfigurationDIBean{ 8 | @Bean 9 | open fun greeting(): GreetingDIBean { 10 | return GreetingDIBean(getUserDetails()) 11 | } 12 | 13 | @Bean 14 | open fun getUserDetails(): GreetingDetailsDIBean { 15 | return GreetingDetailsDIBean() 16 | } 17 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/dependenciesInjectBean/GreetingDIBean.kt: -------------------------------------------------------------------------------- 1 | package dependenciesInjectBean 2 | 3 | class GreetingDIBean (private val userDetails: GreetingDetailsDIBean){ 4 | init { 5 | println("Inside dependenciesInjectBean.GreetingDIBean constructor.") 6 | } 7 | 8 | fun getGreeting() { 9 | userDetails.getGreetingDetails() 10 | } 11 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/dependenciesInjectBean/GreetingDetailsDIBean.kt: -------------------------------------------------------------------------------- 1 | package dependenciesInjectBean 2 | 3 | class GreetingDetailsDIBean{ 4 | init { 5 | println("This class has all the details of the user") 6 | } 7 | 8 | fun getGreetingDetails(){ 9 | println("Welcome, Naruto Uzumaki!!") 10 | } 11 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/dependenciesInjectBean/MainAppDIBean.kt: -------------------------------------------------------------------------------- 1 | package dependenciesInjectBean 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext 4 | 5 | fun main(args: Array) { 6 | val applicationContext = AnnotationConfigApplicationContext(GreetingConfigurationDIBean::class.java) 7 | 8 | val greeting = applicationContext.getBean(GreetingDIBean::class.java) 9 | greeting.getGreeting() 10 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/importAnnotation/Boo.kt: -------------------------------------------------------------------------------- 1 | package importAnnotation 2 | 3 | class Foo{ 4 | init { 5 | println("This is class Foo") 6 | } 7 | } 8 | class Boo{ 9 | init { 10 | println("This is class Boo") 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/importAnnotation/ConfigBooImport.kt: -------------------------------------------------------------------------------- 1 | package importAnnotation 2 | 3 | import org.springframework.context.annotation.Bean 4 | import org.springframework.context.annotation.Configuration 5 | import org.springframework.context.annotation.Import 6 | import org.springframework.stereotype.Controller 7 | 8 | @Configuration 9 | open class ConfigFoo { 10 | @Bean 11 | open fun foo(): Foo{ 12 | return Foo() 13 | } 14 | } 15 | 16 | @Configuration 17 | @Import(ConfigFoo::class) 18 | open class ConfigBoo { 19 | @Bean 20 | open fun foo(): Boo { 21 | return Boo() 22 | } 23 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/importAnnotation/MainAppImport.kt: -------------------------------------------------------------------------------- 1 | package importAnnotation 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext 4 | 5 | fun main(args: Array) { 6 | val applicationContext = AnnotationConfigApplicationContext(ConfigBoo::class.java) 7 | 8 | 9 | val foo: Foo = applicationContext.getBean(Foo::class.java) 10 | val boo: Boo = applicationContext.getBean(Boo::class.java) 11 | 12 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/lifecycleCallback/ConfigFoo.kt: -------------------------------------------------------------------------------- 1 | package lifecycleCallback 2 | 3 | import org.springframework.context.annotation.Bean 4 | import org.springframework.context.annotation.Configuration 5 | 6 | 7 | @Configuration 8 | open class ConfigFoo { 9 | @Bean(initMethod = "init", destroyMethod = "destroy") 10 | open fun foo(): Foo { 11 | return Foo() 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/lifecycleCallback/Foo.kt: -------------------------------------------------------------------------------- 1 | package lifecycleCallback 2 | 3 | class Foo{ 4 | fun init(){ 5 | println("Foo is initializing...") 6 | } 7 | 8 | fun destroy(){ 9 | println("Foo is destroying...") 10 | } 11 | } -------------------------------------------------------------------------------- /Chapter03/JavaBasedConfiguration/src/lifecycleCallback/MainAppLifeCall.kt: -------------------------------------------------------------------------------- 1 | package lifecycleCallback 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext 4 | 5 | fun main(args: Array) { 6 | val applicationContext = AnnotationConfigApplicationContext(ConfigFoo::class.java) 7 | 8 | val foo: Foo = applicationContext.getBean(Foo::class.java) 9 | applicationContext.registerShutdownHook() 10 | } -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/.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/ -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-aop-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-aop-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-aspects-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-aspects-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-beans-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-beans-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-context-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-context-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-context-support-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-context-support-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-core-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-core-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-expression-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-expression-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-instrument-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-instrument-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-instrument-tomcat-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-jdbc-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-jdbc-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-jms-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-jms-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-messaging-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-messaging-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-orm-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-orm-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-oxm-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-oxm-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-test-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-test-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-tx-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-tx-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-web-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-web-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-webmvc-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-webmvc-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-webmvc-portlet-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-webmvc-portlet-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/lib/spring-websocket-4.3.18.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringMVCKotlin/lib/spring-websocket-4.3.18.RELEASE.jar -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/src/main/java/mvckotlin/MVCKotlinApp.kt: -------------------------------------------------------------------------------- 1 | package mvckotlin 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import com.sun.tools.javac.tree.TreeInfo.args 5 | import org.springframework.boot.SpringApplication 6 | 7 | 8 | @SpringBootApplication 9 | open class MVCKotlinApp { 10 | fun main(args: Array) { 11 | SpringApplication.run(MVCKotlinApp::class.java, *args) 12 | } 13 | } -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/src/main/java/mvckotlin/MVCKotlinAppController.kt: -------------------------------------------------------------------------------- 1 | package mvckotlin 2 | 3 | import org.springframework.stereotype.Controller 4 | import org.springframework.web.bind.annotation.RequestMapping 5 | import org.springframework.web.servlet.ModelAndView 6 | 7 | @Controller 8 | class MVCKotlinAppController { 9 | @RequestMapping("/SpringMVCKotlin") 10 | fun greetingMessage(): ModelAndView { 11 | val message = 12 | "

Welcome to Learn Spring for Android Application Development

" 13 | return ModelAndView("welcome", "message", message) 14 | } 15 | } -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/web/WEB-INF/jsp/welcome.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | Spring MVC Kotlin 4 | 5 | 6 |

Hey Naruto..!! This is based on Spring MVC in Kotlin...

7 | 8 | -------------------------------------------------------------------------------- /Chapter03/SpringMVCKotlin/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Spring MVC Kotlin 4 | 5 | 6 |
7 |
8 |

9 | Hey Naruto..!! This is based on Spring MCV in Kotlin..

10 |

11 |
12 | 13 | -------------------------------------------------------------------------------- /Chapter03/SpringbootkotlinApplication/.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/ -------------------------------------------------------------------------------- /Chapter03/SpringbootkotlinApplication/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/bd947b3f409368e384df8ee36141d2c09791b3bb/Chapter03/SpringbootkotlinApplication/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter03/SpringbootkotlinApplication/.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 | -------------------------------------------------------------------------------- /Chapter03/SpringbootkotlinApplication/src/main/kotlin/com/pucktpub/sunnat629/springbootkotlin/springbootkotlin/AppController.kt: -------------------------------------------------------------------------------- 1 | package com.pucktpub.sunnat629.springbootkotlin.springbootkotlin 2 | 3 | import org.springframework.stereotype.Controller 4 | import org.springframework.ui.Model 5 | import org.springframework.ui.set 6 | import org.springframework.web.bind.annotation.GetMapping 7 | 8 | 9 | @Controller 10 | class HtmlController { 11 | 12 | @GetMapping("/") 13 | fun blog(model: Model): String { 14 | model["title"] = "Greeting" 15 | return "index" 16 | } 17 | } -------------------------------------------------------------------------------- /Chapter03/SpringbootkotlinApplication/src/main/kotlin/com/pucktpub/sunnat629/springbootkotlin/springbootkotlin/SpringBootKotlinApplication.kt: -------------------------------------------------------------------------------- 1 | package com.pucktpub.sunnat629.springbootkotlin.springbootkotlin 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class SpringBootKotlinApplication 8 | 9 | fun main(args: Array) { 10 | runApplication(*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 | 17 | 18 | -------------------------------------------------------------------------------- /Chapter04/RetrofitinKotlinTest/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 5 | -------------------------------------------------------------------------------- /Chapter09/ClientSide/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /Chapter09/ClientSide/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter09/ClientSide/app/src/main/res/menu/navigation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 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 | 16 | 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 | --------------------------------------------------------------------------------