diff --git a/.github/workflows/Techousecodeql.yml b/.github/workflows/Techousecodeql.yml new file mode 100644 index 0000000..f57a15c --- /dev/null +++ b/.github/workflows/Techousecodeql.yml @@ -0,0 +1,81 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '17 15 * * 1' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ubuntu-latest + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: java-kotlin + build-mode: manual + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Setup Java for the build - JDK 17 is required for Android SDK Manager compatibility + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + # Setup Android SDK + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + # Manual build steps for Android Gradle project + - name: Run Gradle build + run: | + chmod +x ./gradlew + ./gradlew assembleDebug --no-daemon --info + env: + GRADLE_OPTS: "-Xmx2048m" + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..0885752 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,67 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle Wrapper + run: ./gradlew build + + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + # with: + # gradle-version: '8.9' + # + # - name: Build with Gradle 8.9 + # run: gradle build + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 diff --git a/README.md b/README.md index 98e1ad6..431aad1 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,47 @@ -# Auto Techno -Due to the limited amount of media apps which are available for Android Auto, I have decided to create one tailored to my music tastes. -Auto Techno is an Android Auto music app for tuning in to DI.FM Premium radio channels. +# Techouse -Play Store link: https://play.google.com/store/apps/details?id=io.github.markspit93.autotechno +## Usage -The app was a nice opportunity to experiment with Google's media playing library, Exo Player 2. -For more information: - * https://developer.android.com/guide/topics/media/exoplayer.html - * https://google.github.io/ExoPlayer/guide.html +Java-Kotlin +Java-Kotlin is a sample application created to explore the interoperability between Java and Kotlin within the Android ecosystem. -## Usage +The project demonstrates how both languages can coexist in the same environment, sharing classes, methods, and resources without losing compatibility or performance. + +Features +Combined source code in Java and Kotlin +Practical examples of interoperability between both languages +Integration with modern Android libraries +Modular and easily extensible architecture +Ideal for developers migrating projects from Java to Kotlin + +Purpose +The main goal of Java-Kotlin is to serve as an educational reference for understanding how Kotlin can be gradually integrated into existing Android projects written in Java. +Through clear examples, it shows how both languages can communicate seamlessly, taking advantage of each one’s strengths. + +How It Improves Music Apps +While Java-Kotlin itself doesn’t directly enhance music files, it can significantly improve how an app handles and plays them: + +Optimized performance: Kotlin’s concise and safe syntax reduces bugs that could affect playback or audio streaming. + +Better code maintenance: Interoperability allows developers to add new features (like equalizers, smart playlists, or streaming) without rewriting the entire codebase. + +Modern library support: Kotlin integrates smoothly with Android’s latest APIs, such as ExoPlayer, improving stability and audio buffer management. + +Lower resource usage: Kotlin’s compiler optimizations make reading, decoding, and playback operations more efficient. + +In short, Java-Kotlin doesn’t modify the music files themselves but enhances the development experience and efficiency of apps that manage or play them. -**NOTE: DI.FM Premium Required**. +Usage +Clone or download the project. +Open it in Android Studio with Kotlin support enabled. -* Make sure Android *and Android Auto* is set to allow apps from unknown sources. Use some internet search tool for instructions. -* Deploy to Android Device. - * If you're having problems, try to disable "Instant Run". - * Running the default "Activity" will prompt you to open Android Auto. It should not crash. -* Start the mobile app and enter your Premium listener key. -* Startup Android Auto and open the app. +Build and run it on an Android device or emulator. +Explore the Java and Kotlin modules to see how they interact. -Screenshots -====== +Integrated Kotlin and Java Code -![Media Session](screenshot1.PNG) +Running in Android Studio -![Media Browser](screenshot2.PNG) +**NOTE: DI.FM/APP Required**. -![Media Browser](screenshot3.PNG) diff --git a/build.gradle b/build.gradle index 72e9ae7..6c7b1cb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,15 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.9.0' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.1' + classpath 'com.android.tools.build:gradle:8.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong @@ -20,7 +20,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 21574f4..52e1c36 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip diff --git a/mobile/build.gradle b/mobile/build.gradle index 46c60c3..3733e2f 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -1,18 +1,17 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { - compileSdkVersion 29 - buildToolsVersion '29.0.2' + compileSdkVersion 34 + buildToolsVersion '34.0.0' defaultConfig { applicationId "io.github.markspit93.autotechno" minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 34 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -28,27 +27,27 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } - androidExtensions { - experimental = true + kotlinOptions { + jvmTarget = '11' } } ext { anko_version = '0.10.8' - androidKtxVersion = '1.1.0' - androidxAppCompatVersion = '1.1.0' - androidxMediaVersion = '1.1.0' - androidxConstraintLayoutVersion = '1.1.3' - androidxRoomVersion = '2.2.1' + androidKtxVersion = '1.12.0' + androidxAppCompatVersion = '1.6.1' + androidxMediaVersion = '1.7.0' + androidxConstraintLayoutVersion = '2.1.4' + androidxRoomVersion = '2.6.1' - androidMaterialVersion = '1.0.0' + androidMaterialVersion = '1.11.0' - exoPlayerVersion = '2.10.4' + exoPlayerVersion = '2.19.1' } dependencies {