#!/bin/bash set -xe #APP_NAME while test -z "${APP_NAME:-}" do read -p "Please provide a Name for the Android App:" APP_NAME done #APP_PACKAGE while test -z "${APP_PACKAGE:-}" do APP_PACKAGE_DEFAULT="${APP_NAME,,}" APP_PACKAGE_DEFAULT="${APP_PACKAGE_DEFAULT//[!a-z0-9]/_}" read -p "Please provide a Package.Name for the App [default=$APP_PACKAGE_DEFAULT]:" APP_PACKAGE APP_PACKAGE="${APP_PACKAGE:-$APP_PACKAGE_DEFAULT}" APP_PACKAGE="${APP_PACKAGE,,}" APP_PACKAGE="${APP_PACKAGE//[!a-z0-9\.]/}" test -d "apps/$APP_PACKAGE" && { echo "There is already an app with APP_PACKAGE '$APP_PACKAGE'. Choose other APP_PACKAGE name" >&2 APP_PACKAGE="" } done #APP_TARGET_VERSION while test -z "${APP_TARGET_VERSION:-}" do cat << API_LEVEL read -p "Please choose the APP_TARGET_VERSION Apilevel:' 35 = Android 15 = 2024 34 = Android 14 = 2023 33 = Android 13 = 2022 32 = Android 12L = 2022 31 = Android 12 = 2021 30 = Android 11 = 2020 20 = Android 10 = 2019 (see https://apilevels.com/ for more info) API_LEVEL APP_TARGET_VERSION_DEFAULT="33" read -p "Please choose [default=$APP_TARGET_VERSION_DEFAULT]:" APP_TARGET_VERSION APP_TARGET_VERSION="${APP_TARGET_VERSION:-$APP_TARGET_VERSION_DEFAULT}" test "$APP_TARGET_VERSION" -gt 0 || { echo "Error: APP_TARGET_VERSION 'APP_TARGET_VERSION' is not valid" APP_TARGET_VERSION=''; } done cat << INFO Creating an skeleton for an Android app with the following info: APP_PACKAGE: ${APP_PACKAGE} APP_NAME: ${APP_NAME} INFO mkdir -p "apps/$APP_PACKAGE" cat > "apps/$APP_PACKAGE/AndroidManifest.xml" << ANDROIDMANIFEST ANDROIDMANIFEST