commit a52a3a351184af1fec89b90ac47526068ce036c9 Author: bad Date: Sun Apr 17 14:15:51 2022 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6596ba4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Log/OS Files +*.log + +# Android Studio generated files and folders +captures/ +.externalNativeBuild/ +.cxx/ +*.apk +output.json + +# IntelliJ +*.iml +.idea/ +misc.xml +deploymentTargetDropDown.xml +render.experimental.xml + +# Keystore files +*.jks +*.keystore + +# Google Services (e.g. APIs or Firebase) +google-services.json + +# Android Profiling +*.hprof + +.settings +.project diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..ac26f4d --- /dev/null +++ b/build.gradle @@ -0,0 +1,34 @@ +buildscript { + repositories { + google() + jcenter() + } + ext.kotlin_version = '1.6.20' + dependencies { + classpath 'com.android.tools.build:gradle:7.1.3' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} +plugins { + id "org.jetbrains.kotlin.android" version "1.6.20" +} + +allprojects { + repositories { + google() + jcenter() + } +} +apply plugin: 'com.android.application' +android { + defaultConfig { + applicationId "dev.badat.android_template" + minSdk 24 + } + compileSdkVersion 32 + buildToolsVersion '32.0.0' +} +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} +repositories { jcenter() } diff --git a/devshell.nix b/devshell.nix new file mode 100644 index 0000000..170581f --- /dev/null +++ b/devshell.nix @@ -0,0 +1,33 @@ +{ pkgs }: + +with pkgs; + +# Configure your development environment. +# +# Documentation: https://github.com/numtide/devshell +devshell.mkShell { + name = "android-project"; + motd = '' + Entered the Android app development environment. + ''; + env = [ + { + name = "ANDROID_HOME"; + value = "${android-sdk}/share/android-sdk"; + } + { + name = "ANDROID_SDK_ROOT"; + value = "${android-sdk}/share/android-sdk"; + } + { + name = "JAVA_HOME"; + value = jdk11.home; + } + ]; + packages = [ + android-sdk + ( pkgs.writeShellScriptBin "gradle" '' + exec env "ORG_GRADLE_PROJECT_android.aapt2FromMavenOverride"="${android-sdk}/share/android-sdk/build-tools/32.0.0/aapt2" '${gradle}/bin/gradle' $@ + '') + ]; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e7401ee --- /dev/null +++ b/flake.lock @@ -0,0 +1,196 @@ +{ + "nodes": { + "android": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1650140508, + "narHash": "sha256-pR+LCrDgEYB8rVvq31d+bj7kIDIds9iE/0hT5aVJzFQ=", + "owner": "tadfisher", + "repo": "android-nixpkgs", + "rev": "c1c81af9e42ff0415efb05df44793ab2a635ea2a", + "type": "github" + }, + "original": { + "owner": "tadfisher", + "repo": "android-nixpkgs", + "type": "github" + } + }, + "devshell": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1649691969, + "narHash": "sha256-nY1aUWIyh3TcGVo3sn+3vyCh+tOiEZL4JtMX3aOZSeY=", + "owner": "numtide", + "repo": "devshell", + "rev": "e22633b05fec2fe196888c593d4d9b3f4f648a25", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "devshell_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1649691969, + "narHash": "sha256-nY1aUWIyh3TcGVo3sn+3vyCh+tOiEZL4JtMX3aOZSeY=", + "owner": "numtide", + "repo": "devshell", + "rev": "e22633b05fec2fe196888c593d4d9b3f4f648a25", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1649676176, + "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1649676176, + "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1643381941, + "narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1650076401, + "narHash": "sha256-QGxadqKWICchuuLIF2QwmHPVaUk+qO33ml5p1wW4IyA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "75ad56bdc927f3a9f9e05e3c3614c4c1fcd99fcb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1643381941, + "narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1650076401, + "narHash": "sha256-QGxadqKWICchuuLIF2QwmHPVaUk+qO33ml5p1wW4IyA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "75ad56bdc927f3a9f9e05e3c3614c4c1fcd99fcb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "android": "android", + "devshell": "devshell_2", + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..19d66c7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,54 @@ +{ + description = "My Android project"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + devshell.url = "github:numtide/devshell"; + flake-utils.url = "github:numtide/flake-utils"; + android.url = "github:tadfisher/android-nixpkgs"; + }; + + outputs = { self, nixpkgs, devshell, flake-utils, android }: + { + overlay = final: prev: { + inherit (self.packages.${final.system}) android-sdk android-studio; + }; + } + // + flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + overlays = [ + devshell.overlay + self.overlay + ]; + }; + in + { + packages = { + android-sdk = android.sdk.${system} (sdkPkgs: with sdkPkgs; [ + # Useful packages for building and testing. + build-tools-32-0-0 + cmdline-tools-latest + emulator + platform-tools + platforms-android-32 + + # Other useful packages for a development environment. + # sources-android-30 + # system-images-android-30-google-apis + # system-images-android-30-google-apis-playstore + ]); + + # android-studio = pkgs.androidStudioPackages.stable; + # android-studio = pkgs.androidStudioPackages.beta; + # android-studio = pkgs.androidStudioPackages.preview; + # android-studio = pkgs.androidStudioPackage.canary; + }; + + devShell = import ./devshell.nix { inherit pkgs; }; + } + ); +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e69de29 diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e69de29 diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml new file mode 100644 index 0000000..dc9fb0f --- /dev/null +++ b/src/main/AndroidManifest.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/src/main/java/dev/badat/android_template/MainActivity.kt b/src/main/java/dev/badat/android_template/MainActivity.kt new file mode 100644 index 0000000..f21a66c --- /dev/null +++ b/src/main/java/dev/badat/android_template/MainActivity.kt @@ -0,0 +1,13 @@ +package dev.badat.android_template; + +import android.app.Activity +import android.os.Bundle + +class MainActivity : Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + } +} + diff --git a/src/main/res/layout/activity_main.xml b/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..6184f34 --- /dev/null +++ b/src/main/res/layout/activity_main.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..90f9580 --- /dev/null +++ b/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/res/mipmap-hdpi/ic_launcher.png b/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..edd91aa Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png b/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png new file mode 100644 index 0000000..e32edd8 Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png differ diff --git a/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png b/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 0000000..fba53f3 Binary files /dev/null and b/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/main/res/mipmap-mdpi/ic_launcher.png b/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..325b021 Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png b/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png new file mode 100644 index 0000000..6202eb6 Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png differ diff --git a/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png b/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 0000000..ec61891 Binary files /dev/null and b/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/main/res/mipmap-xhdpi/ic_launcher.png b/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..b813721 Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png b/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png new file mode 100644 index 0000000..cd5b663 Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png differ diff --git a/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png b/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 0000000..eacff90 Binary files /dev/null and b/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher.png b/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..7bd1c61 Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png b/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png new file mode 100644 index 0000000..5e7ee9d Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png differ diff --git a/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png b/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 0000000..dfc8291 Binary files /dev/null and b/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png differ diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..206e90a Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png b/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png new file mode 100644 index 0000000..d82cb42 Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png differ diff --git a/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png b/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png new file mode 100644 index 0000000..08be180 Binary files /dev/null and b/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png differ