├── README.md ├── fundamentals ├── modeldemo │ ├── .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 │ │ │ │ └── github │ │ │ │ └── leventarican │ │ │ │ └── modeldemo │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── github │ │ │ │ │ └── leventarican │ │ │ │ │ └── modeldemo │ │ │ │ │ ├── InternetService.kt │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ ├── repository │ │ │ │ │ └── MainRepository.kt │ │ │ │ │ └── screens │ │ │ │ │ ├── MainFragment.kt │ │ │ │ │ └── MainViewModel.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── fragment_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 │ │ │ │ ├── navigation │ │ │ │ └── navigation.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── leventarican │ │ │ └── modeldemo │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── refresh │ ├── .gitignore │ ├── .idea │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ ├── render.experimental.xml │ │ ├── runConfigurations.xml │ │ └── vcs.xml │ ├── README.md │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── leventarican │ │ │ │ └── refresh │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── github │ │ │ │ │ └── leventarican │ │ │ │ │ └── refresh │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ ├── Page0.kt │ │ │ │ │ ├── Page1.kt │ │ │ │ │ ├── Page2.kt │ │ │ │ │ ├── Page3.kt │ │ │ │ │ ├── Page3ImageFragment.kt │ │ │ │ │ ├── Page3JavaFragment.kt │ │ │ │ │ ├── Page3KotlinFragment.kt │ │ │ │ │ ├── Page3TitleFragment.kt │ │ │ │ │ ├── Page4.kt │ │ │ │ │ ├── Page5.kt │ │ │ │ │ ├── Page6.kt │ │ │ │ │ ├── Page7.kt │ │ │ │ │ ├── etc │ │ │ │ │ └── TimerLifecycle.kt │ │ │ │ │ └── model │ │ │ │ │ └── ProgrammingLanguage.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ ├── dice_1.xml │ │ │ │ ├── dice_2.xml │ │ │ │ ├── dice_3.xml │ │ │ │ ├── dice_4.xml │ │ │ │ ├── dice_5.xml │ │ │ │ ├── dice_6.xml │ │ │ │ ├── empty_dice.xml │ │ │ │ ├── ic_computer_black_24dp.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── font │ │ │ │ └── roboto.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_page0.xml │ │ │ │ ├── activity_page1.xml │ │ │ │ ├── activity_page2.xml │ │ │ │ ├── activity_page3.xml │ │ │ │ ├── activity_page4.xml │ │ │ │ ├── activity_page5.xml │ │ │ │ ├── activity_page6.xml │ │ │ │ ├── activity_page7.xml │ │ │ │ ├── fragment_page3_image.xml │ │ │ │ ├── fragment_page3_java.xml │ │ │ │ ├── fragment_page3_kotlin.xml │ │ │ │ └── fragment_page3_title.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 │ │ │ │ ├── navigation │ │ │ │ └── navigation.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── font_certs.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── preloaded_fonts.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── leventarican │ │ │ └── refresh │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── template │ ├── .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 │ │ │ └── github │ │ │ └── leventarican │ │ │ └── template │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── leventarican │ │ │ │ └── template │ │ │ │ ├── FirstFragment.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ └── SecondFragment.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── content_main.xml │ │ │ ├── fragment_first.xml │ │ │ └── fragment_second.xml │ │ │ ├── menu │ │ │ └── menu_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 │ │ │ ├── navigation │ │ │ └── nav_graph.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── leventarican │ │ └── template │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── helloworld ├── .gitignore ├── .idea │ ├── codeStyles │ │ ├── Project.xml │ │ └── codeStyleConfig.xml │ ├── gradle.xml │ ├── misc.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── automotive │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── leventarican │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_launcher-playstore.png │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── leventarican │ │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── mobile │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── leventarican │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── leventarican │ │ │ │ └── MainActivity.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 │ │ └── com │ │ └── github │ │ └── leventarican │ │ └── ExampleUnitTest.kt ├── music.png ├── settings.gradle └── shared │ ├── build.gradle │ ├── build │ ├── .transforms │ │ ├── 14d2211a97b9d30b32a582250d7fb39e.bin │ │ └── 14d2211a97b9d30b32a582250d7fb39e │ │ │ └── classes │ │ │ └── classes.dex │ ├── generated │ │ └── source │ │ │ └── buildConfig │ │ │ └── debug │ │ │ └── com │ │ │ └── github │ │ │ └── leventarican │ │ │ └── shared │ │ │ └── BuildConfig.java │ ├── intermediates │ │ ├── aapt_friendly_merged_manifests │ │ │ └── debug │ │ │ │ └── aapt │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── output.json │ │ ├── annotation_processor_list │ │ │ └── debug │ │ │ │ └── annotationProcessors.json │ │ ├── compile_library_classes │ │ │ └── debug │ │ │ │ └── classes.jar │ │ ├── compile_only_not_namespaced_r_class_jar │ │ │ └── debug │ │ │ │ └── R.jar │ │ ├── compile_symbol_list │ │ │ └── debug │ │ │ │ └── R.txt │ │ ├── compiled_local_resources │ │ │ └── debug │ │ │ │ └── out │ │ │ │ └── xml_automotive_app_desc.xml.flat │ │ ├── incremental │ │ │ ├── debug-mergeNativeLibs │ │ │ │ └── merge-state │ │ │ ├── mergeDebugJniLibFolders │ │ │ │ └── merger.xml │ │ │ ├── mergeDebugShaders │ │ │ │ └── merger.xml │ │ │ ├── packageDebugAssets │ │ │ │ └── merger.xml │ │ │ └── packageDebugResources │ │ │ │ ├── compile-file-map.properties │ │ │ │ └── merger.xml │ │ ├── javac │ │ │ └── debug │ │ │ │ └── classes │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── leventarican │ │ │ │ └── shared │ │ │ │ └── BuildConfig.class │ │ ├── library_java_res │ │ │ └── debug │ │ │ │ └── res.jar │ │ ├── library_manifest │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── local_only_symbol_list │ │ │ └── debug │ │ │ │ └── R-def.txt │ │ ├── manifest_merge_blame_file │ │ │ └── debug │ │ │ │ └── manifest-merger-blame-debug-report.txt │ │ ├── merged_manifests │ │ │ └── debug │ │ │ │ └── output.json │ │ ├── navigation_json │ │ │ └── debug │ │ │ │ └── navigation.json │ │ ├── packaged_res │ │ │ └── debug │ │ │ │ └── xml │ │ │ │ └── automotive_app_desc.xml │ │ ├── runtime_library_classes │ │ │ └── debug │ │ │ │ └── classes.jar │ │ └── symbol_list_with_package_name │ │ │ └── debug │ │ │ └── package-aware-r.txt │ ├── kotlin │ │ └── compileDebugKotlin │ │ │ ├── build-history.bin │ │ │ ├── caches-jvm │ │ │ ├── inputs │ │ │ │ ├── source-to-output.tab │ │ │ │ ├── source-to-output.tab.keystream │ │ │ │ ├── source-to-output.tab.keystream.len │ │ │ │ ├── source-to-output.tab.len │ │ │ │ ├── source-to-output.tab.values.at │ │ │ │ ├── source-to-output.tab_i │ │ │ │ └── source-to-output.tab_i.len │ │ │ ├── jvm │ │ │ │ └── kotlin │ │ │ │ │ ├── class-fq-name-to-source.tab │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream.len │ │ │ │ │ ├── class-fq-name-to-source.tab.len │ │ │ │ │ ├── class-fq-name-to-source.tab.values.at │ │ │ │ │ ├── class-fq-name-to-source.tab_i │ │ │ │ │ ├── class-fq-name-to-source.tab_i.len │ │ │ │ │ ├── internal-name-to-source.tab │ │ │ │ │ ├── internal-name-to-source.tab.keystream │ │ │ │ │ ├── internal-name-to-source.tab.keystream.len │ │ │ │ │ ├── internal-name-to-source.tab.len │ │ │ │ │ ├── internal-name-to-source.tab.values.at │ │ │ │ │ ├── internal-name-to-source.tab_i │ │ │ │ │ ├── internal-name-to-source.tab_i.len │ │ │ │ │ ├── proto.tab │ │ │ │ │ ├── proto.tab.keystream │ │ │ │ │ ├── proto.tab.keystream.len │ │ │ │ │ ├── proto.tab.len │ │ │ │ │ ├── proto.tab.values.at │ │ │ │ │ ├── proto.tab_i │ │ │ │ │ ├── proto.tab_i.len │ │ │ │ │ ├── source-to-classes.tab │ │ │ │ │ ├── source-to-classes.tab.keystream │ │ │ │ │ ├── source-to-classes.tab.keystream.len │ │ │ │ │ ├── source-to-classes.tab.len │ │ │ │ │ ├── source-to-classes.tab.values.at │ │ │ │ │ ├── source-to-classes.tab_i │ │ │ │ │ ├── source-to-classes.tab_i.len │ │ │ │ │ ├── subtypes.tab │ │ │ │ │ ├── subtypes.tab.keystream │ │ │ │ │ ├── subtypes.tab.keystream.len │ │ │ │ │ ├── subtypes.tab.len │ │ │ │ │ ├── subtypes.tab.values.at │ │ │ │ │ ├── subtypes.tab_i │ │ │ │ │ ├── subtypes.tab_i.len │ │ │ │ │ ├── supertypes.tab │ │ │ │ │ ├── supertypes.tab.keystream │ │ │ │ │ ├── supertypes.tab.keystream.len │ │ │ │ │ ├── supertypes.tab.len │ │ │ │ │ ├── supertypes.tab.values.at │ │ │ │ │ ├── supertypes.tab_i │ │ │ │ │ └── supertypes.tab_i.len │ │ │ └── lookups │ │ │ │ ├── counters.tab │ │ │ │ ├── file-to-id.tab │ │ │ │ ├── file-to-id.tab.keystream │ │ │ │ ├── file-to-id.tab.keystream.len │ │ │ │ ├── file-to-id.tab.len │ │ │ │ ├── file-to-id.tab.values.at │ │ │ │ ├── file-to-id.tab_i │ │ │ │ ├── file-to-id.tab_i.len │ │ │ │ ├── id-to-file.tab │ │ │ │ ├── id-to-file.tab.keystream │ │ │ │ ├── id-to-file.tab.keystream.len │ │ │ │ ├── id-to-file.tab.len │ │ │ │ ├── id-to-file.tab.values.at │ │ │ │ ├── lookups.tab │ │ │ │ ├── lookups.tab.keystream │ │ │ │ ├── lookups.tab.keystream.len │ │ │ │ ├── lookups.tab.len │ │ │ │ ├── lookups.tab.values.at │ │ │ │ ├── lookups.tab_i │ │ │ │ └── lookups.tab_i.len │ │ │ └── last-build.bin │ ├── outputs │ │ └── logs │ │ │ └── manifest-merger-debug-report.txt │ └── tmp │ │ └── kotlin-classes │ │ └── debug │ │ ├── META-INF │ │ └── shared_debug.kotlin_module │ │ └── com │ │ └── github │ │ └── leventarican │ │ └── shared │ │ ├── MyMusicService$callback$1.class │ │ └── MyMusicService.class │ └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── github │ │ └── leventarican │ │ └── shared │ │ └── MyMusicService.kt │ └── res │ └── xml │ └── automotive_app_desc.xml └── screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | # android-automotive os 2 | * android automotive is android 3 | * android auto vs android automotive OS 4 | * android auto launched in 2015 5 | * with android automotive OS will the vehicle run android natively without a phone 6 | * the strategy is to build on multible plattforms: phone, automotive. so one project for all. 7 | 8 | ![HelloWorld Android Automotive OS](screenshot.png) 9 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 29 7 | buildToolsVersion "29.0.2" 8 | 9 | defaultConfig { 10 | applicationId "com.github.leventarican.modeldemo" 11 | minSdkVersion 19 12 | targetSdkVersion 29 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | dataBinding { 27 | enabled = true 28 | } 29 | 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(dir: 'libs', include: ['*.jar']) 34 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 35 | implementation 'androidx.appcompat:appcompat:1.1.0' 36 | implementation 'androidx.core:core-ktx:1.2.0' 37 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 38 | testImplementation 'junit:junit:4.12' 39 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 40 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 41 | 42 | // Navigation 43 | implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0" 44 | implementation "android.arch.navigation:navigation-ui-ktx:1.0.0" 45 | 46 | // ViewModel and LiveData 47 | implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' 48 | 49 | // parse HTML 50 | implementation 'org.jsoup:jsoup:1.13.1' 51 | } 52 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/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 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/androidTest/java/com/github/leventarican/modeldemo/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.github.leventarican.modeldemo 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.github.leventarican.modeldemo", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/java/com/github/leventarican/modeldemo/InternetService.kt: -------------------------------------------------------------------------------- 1 | package com.github.leventarican.modeldemo 2 | 3 | import android.os.AsyncTask 4 | import org.jsoup.Jsoup 5 | import org.jsoup.nodes.Document 6 | 7 | 8 | class InternetService { 9 | 10 | private val url = "https://example.com" 11 | private lateinit var times: MutableList 12 | 13 | fun connect(): InternetService { 14 | val doc = Connector().execute(url).get() 15 | val h1 = doc.select("h1") 16 | times = mutableListOf() 17 | h1.forEach { 18 | times.add(it.text()) 19 | } 20 | return this 21 | } 22 | 23 | fun getTimes(): MutableList { 24 | return times 25 | } 26 | } 27 | 28 | /* 29 | * network call! we wont do that in main/ui thread. 30 | * Caused by: android.os.NetworkOnMainThreadException 31 | * 32 | * for https we need a certification 33 | * Caused by: java.security.cert.CertificateException 34 | */ 35 | class Connector : AsyncTask() { 36 | override fun doInBackground(vararg params: String?): Document { 37 | return Jsoup.connect(params[0]).get() 38 | } 39 | } -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/java/com/github/leventarican/modeldemo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.github.leventarican.modeldemo 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 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 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/java/com/github/leventarican/modeldemo/repository/MainRepository.kt: -------------------------------------------------------------------------------- 1 | package com.github.leventarican.modeldemo.repository 2 | 3 | class MainRepository { 4 | } -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/java/com/github/leventarican/modeldemo/screens/MainFragment.kt: -------------------------------------------------------------------------------- 1 | package com.github.leventarican.modeldemo.screens 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.databinding.DataBindingUtil 8 | import androidx.fragment.app.Fragment 9 | import androidx.lifecycle.ViewModelProviders 10 | import com.github.leventarican.modeldemo.R 11 | import com.github.leventarican.modeldemo.databinding.FragmentMainBinding 12 | 13 | class MainFragment : Fragment() { 14 | 15 | // for each layout exists a generated binding class 16 | private lateinit var binding: FragmentMainBinding 17 | private lateinit var viewModel: MainViewModel 18 | 19 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 20 | 21 | binding = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false) 22 | // ViewModelProviders will be deprecated in lifecycle 2.2.0: use ViewModelProvider 23 | viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java) 24 | binding.mainViewModel = viewModel 25 | binding.lifecycleOwner = viewLifecycleOwner 26 | 27 | return binding.root 28 | } 29 | } -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/java/com/github/leventarican/modeldemo/screens/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.github.leventarican.modeldemo.screens 2 | 3 | import androidx.lifecycle.LiveData 4 | import androidx.lifecycle.MutableLiveData 5 | import androidx.lifecycle.Transformations 6 | import androidx.lifecycle.ViewModel 7 | 8 | class MainViewModel : ViewModel() { 9 | var debug = MutableLiveData() 10 | val number = MutableLiveData() 11 | private var numbers: MutableList 12 | val numberCustomized = Transformations.map(number) { _ -> "next num: ${number.value}" } 13 | 14 | init { 15 | debug.value = "init" 16 | numbers = mutableListOf(7, 10, 11, 80, 4, 3, 100) 17 | } 18 | 19 | fun next() { 20 | numbers.shuffle() 21 | number.value = numbers[0] 22 | } 23 | } -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /fundamentals/modeldemo/app/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 19 | 20 | 31 | 32 |