====== [hemmerling] Google Android 14/14 - App Development III ====== Related pages: *Google Android: *[[android.html|Android 1/15]]. *[[android02.html|Android 2/15 - Apps]]. *[[android03.html|Android 3/15 - App Development I]]. *[[android04.html|Android 4/15 - App Debugging & Testing]]. *[[android05.html|Android 5/15 - Simulators, Skins, Operating Systems, System Images]]. *[[android06.html|Android 6/15 - App Protoyping]]. *[[android07.html|Android 7/15 - App Publishing]]. *[[android08.html|Android 8/15 - Hardware]]. *[[android09.html|Android 9/15 - Amazon Fire TV]]. *[[android10.html|Android 10/15 - TV compatible Apps ( for Android TV, Google TV, Amazon Fire TV]]. *[[android11.html|Android 11/15 - Browsers & Internet Apps ( for Android TV, Google TV, Amazon Fire TV )]]. *[[android12.html|Android 12/15 - Google Android, Suggestions for Smartphone Apps to be installed on any Android Smartphone]]. *[[android13.html|Android 13/15 - App Development II]]. *[[android15.html|Android 15/15 - App Development IV]]. ===== My first Google Play App, with Android Studio ===== ==== 1 Install Android Studio & Setup Environment ==== === 1.1 Install Android Studio === *[[http://developer.android.com/studio|Google Developers "Android Studio"]]. === 1.2 Setup Environment === *[[http://developer.android.com/tools/variables|Android Developers "Environment variables"]]. *[[http://www.stackoverflow.com/questions/25176594/android-sdk-location|StackOverflow "Android SDK location"]] - On Windows, "C:\Users\**username**\AppData\Local\Android\Sdk". *On my system, in 2025-04, I included in the environment variable "Path": *"C:\int\w64\develop\Java\jdk\bin". *"C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\36.0.0\". ==== 2. Prepare Debugging ==== === 2.1 Activivate the Developer Mode of my Motorola G54 ( Android 15 ) === *[[http://de-de.support.motorola.com/app/answers/detail/a_id/159678/~/developer-options|Motorola Support "Where are the developer options on my phone ?"]]. *"System" / "Über das Telefon" / "Geräte-IDs" / Tab 7x on "Build-Number". === 2.2 Activivate USB Debugging for my Motorola G54 ( Android 15 ) === *"System" / "Entwickleroptionen" / "USB-Debugging" = YES. === 2.3 Install ADB Driver for Windows === *[[http://adb.clockworkmod.com/|Universal ADB Drivers]] - "One size fits all Windows Drivers for Android Debug Bridge". *At "Windows Control Panel" / "Programs and Features", the application name is "Universal Adb Driver". ==== 3 My first Kotlin App "HemmerlingTheApp" ==== === 3.1 Tutorials === *[[http://developer.android.com/codelabs/basic-android-kotlin-compose-first-app|Android Developers "Create your first Android app"]]. *[[http://developer.android.com/studio/run/device.html|Android Developers "Run apps on a hardware device"]]. *SDK. *AndroidStudio BurgerMenu "Tools" / "SDK Manager". *Android SDK Location "C:\Users\Administrator\AppData\Local\Android\Sdk". *As of 2025-04, please install "Android 15.0 ("VanillaIceCream"), API Level "35". *[[http://developer.android.com/google/play/requirements/target-sdk#:~:text=New%20apps%20and%20app%20updates,API%20level%2033)%20or%20higher.|Google Developers "Meet Google Play's target API level requirement"]] - "Starting August 31 2024: New apps and app updates must target Android 14 (API level 34) or higher to be submitted to Google Play". *There are 2 settings. *Target SDK. *For publication on Google Play, you need to install and use SDK 14 or SDK 15, for bundle generation with Android Studio. *This limit might not be true for other third-party appstores. *Minimum SDK. *For SDK 14, minimum SDK is Android 4.1 ( API level 14 ). *For SDK 15, minimum SDK is Android 7.0 ( API level 24 ). *[[http://www.youtube.com/watch?v=W1nMZiA-JTQ|YouTube "How to Change the API SDK Version in Android Studio"]]. *Android BurgerMenu "File" / "Project Structure" / "Properties". *"Compile Sdk Version" = "35(API 35("VanillaIceCream"; Android 15.0))". *Android BurgerMenu "File" / "Project Structure" / "Default Config". *"Target SDK Version" = "35(API 35("VanillaIceCream"; Android 15.0))". *"Min SDK Version" = "24". *[[http://developer.android.com/studio/publish/versioning|Android Developers "Version your app"]]. *Android BurgerMenu "File" / "Project Structure" / "Default Config". *"Version Code" = "1". *"Version Name" = "1.0". *"Target SDK Version" = "35(API 35("VanillaIceCream"; Android 15.0))". *"Min SDK Version" = "24". === 3.1 My private Google for Developers Profile === *[[http://developers.google.com/profile/u/100422585396492504430|Google for Developers Profile "Rolf Hemmerling"]] - "Your profile is private, and only available to you". === 3.3 Generate Keystore on your Development Computer === *AndroidStudio BurgerMenu "Build" / "Generate Signed App Bundle or APK". *Key store path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Android Studio\hemmerling.keystore". *Password "android". *Key. *Alias ( alias name ): "androidkey", "key0" *"Password: "android". *"Validity (years)": *"25" ( -validity 9125, default ). *"30" ( -validity 10950 ). *"First and Last Name" ( CN ): "Rolf Hemmerling". *"Organizational Unit" ( OU, unit or department ): "http://hemmerling.com". *"Organizsation" ( O ): "Dipl.-Ing.(FH) Hemmerling". *"City or Loyalty" ( L ): "Bielefeld". *"State or Province" ( ST ): "NRW". *"Country Code (XX)" ( C ) : "DE". *( -keyalg RSA -keysize 2048 ). *Destionation Folder: *"E:\users\Public\archive\github\kotlin-htapp\HemmerlingTheApp\app". *"build" / "release". *"keytool -list -v -keystore hemmerling_test.keystore -storepass android: *"Owner: C=DE, ST=state_or_province, L=city_or_locality, O=organisation, OU=organisational_unit, CN=first_and_last_name" *"Issuer: C=DE, ST=state_or_province, L=city_or_locality, O=organisation, OU=organisational_unit, CN=first_and_last_name" *Output: *In folder: "E:\users\Public\archive\github\kotlin-htapp\HemmerlingTheApp\app\release". *File: "E:\users\Public\archive\github\kotlin-htapp\HemmerlingTheApp\app\release\app-release.aab" ==== 4 Publish the App on Google Play ==== *Help. *[[http://support.google.com/googleplay/android-developer/answer/9859152|Google Play Console Help "Create and set up your app"]]. *[[http://play.google.com/console/about/app-bundle-explorer/|Google Play Console About "App bundle explorer"]]. *The tool. *[[http://play.google.com/console/developers/app/bundle-explorer|Google Play Console "App bundle explorer"]]. *Warnings: *There is no deobfuscation file associated with this App Bundle. If you use obfuscated code (R8/proguard), uploading a deobfuscation file will make crashes and ANRs easier to analyse and debug. Using R8/proguard can help reduce app size. *[[http://developer.android.com/build/shrink-code#decode-stack-trace|Google Developers "Shrink, obfuscate, and optimize your app"]] - "Decode an obfuscated stack trace". *This App Bundle contains native code, and you've not uploaded debug symbols. We recommend that you upload a symbol file to make your crashes and ANRs easier to analyse and debug. *[[http://developer.android.com/build/shrink-code#native-crash-support|Google Developers "Shrink, obfuscate, and optimize your app"]] - "Native crash support". ==== 5 Google Playstore ==== === 5.1 Internal Testing === *Google Play Console "Test and release" / "Testing" / "Internal testing". *Testers: *The download of the test release is by a temporary Google Play page. *App testers need an Android smartphone, with a Google Play account ( and so E-Mail address registered for Google Play ). *So the E-Mail address of the registered tester must be that of the Google Play account of its Android smartphone. *How testers join your test. *[[http://play.google.com/apps/internaltest/4701601750678440197|Google Play "App: com.hemmerling.hemmerlingtheapp (unreviewed)"]] - "Welcome to the internal test program for com.hemmerling.hemmerlingtheapp (unreviewed)". *[[http://play.google.com/store/apps/details?id=com.hemmerling.hemmerlingtheapp|Google Play "com.hemmerling.hemmerlingtheapp (unreviewed)"]] - Download. === 5.2 Production === *Google Play Console "Production" / "Create production release". *You need to assign a different version for the bundles "internal testing" and "production". If you fail, error message "Version code 1 has already been used. Try another version code". === 5.3 Setup Google Play Store Listing === == 5.3.1 Create an "App icon" for Google Play Store Listing == *[[http://developer.android.com/studio/write/create-app-icons|Android Developers "Create app icons"]] - "About **Image Asset Studio**. **Android Studio includes a tool called Image Asset Studio** that helps you generate your own app icons from material icons, custom images, and text strings. It generates a set of icons at the appropriate resolution for each pixel density that your app supports". *Android studio: *Select "Full Bleed Layer" icon. *In "Android" view, **select the "round" version of the icon**. Display "app" / "res" / "ic_launcher_**round**" / "ic_launcher_**round**.webp (xxhdpi)". *Take a screenshot and create a 512x512 PNG image. *If you fail, rejection: "App does not match the store listing. When it’s installed, your app's icon or name is different to the one shown in its store listing" :-(. *You might take a screenshot of your Android desktop, which also shows the App icon. But the resolution of your App icon would be too low. *[[http://support.google.com/android/answer/9075928|Google Support "Take a screenshot or record your screen on your Android device"]] - "Press the Power and Volume down buttons at the same time". == 5.3.2 Create an "App icon" Screenshot with MIT App Inventor == *See on this page. == 5.3.3 Setup Google Play Store Listing & Generation of requested Screenshots == *[[http://developer.android.com/distribute/google-play/resources/icon-design-specifications|Android Developers "Google Play icon design specifications"]]. *Images ( height x width ): *App icon: **512x512** - Must be a true screenshot of the icon, which is displayed on the Android desktop. *Feature graphics: **500x1024**. *Phone screenshots: 569x**320** ( 16:9, 9:16 ). *7-inch tablet screenshots: **320**x569 ( 16:9, 9:16 ). *10-inch tablet screenshots: **1080**x1966 ( 16:9, 9:16 ). *Chromebook: ?? 1920x3413 ?? ( 16:9, 9:16, optional ) - I failed find the proper image size for upload :-(. "16:9 or 9:16 aspect ratio, with each side between 1,080 px and 7,680 px". Error message "Image must have an aspect ratio of 16:9 and a width between 1920 px and 7680 px". *[[http://support.google.com/googleplay/android-developer/answer/11070055|Google Play Console Help "Online content"]]. *Target audience. *"You're declaring that your target audience includes children under the age of 13. If your app serves ads to children that don't meet the Families policy requirements, or you inappropriately collect personally-identifiable information from children, your app may be removed from Google Play". *Best choice "13-15", "16-17". *[[http://support.google.com/googleplay/android-developer/answer/6223646|Google Play Console Support "Requirements for distributing apps in specific countries/regions"]] - "Requirements for distributing apps in the EU.... For example, an app should be accessible EU-wide subject to other applicable laws unless the main feature of the service is the provision of access to and use of copyright-protected works or other protected subject matter" == 5.3.4 How to update screenshots for Google Play Store == *[[http://www.bvmobileapps.com/support/how-can-i-change-screenshots-my-app-google-play/|BVMobileApps "How can I change the Screenshots of my app on Google Play"]]. *At "Google Play Developer Console", select the app, then "Grow users" / "Store Listings" / "Default store listing". *[[http://support.google.com/googleplay/android-developer/answer/9866151#screenshots&zippy=%2Cscreenshots|Google Play Console Help "Add preview assets to showcase your app"]] - "Screenshots". ==== 5.4 Google Play - Actions recommended ==== *2 actions recommended *Edge-to-edge may not display for all users *From Android 15, all apps targeting SDK 35 will display edge-to-edge by default. Apps targeting SDK 35 should handle insets to make sure that their app displays correctly on Android 15 and later. We recommend investigating this issue and allowing time to test edge-to-edge on your app and make the required updates to your code. Alternatively, call enableEdgeToEdge() for Kotlin or EdgeToEdge.enable() for Java for backward compatibility. *Your app uses deprecated APIs or parameters for edge-to-edge ==== 5.5 Fixing Google Play Issues ==== *Issue "Metadata policy: Violation of Metadata policy" *"Full description (de-DE)". *[[http://support.google.com/googleplay/android-developer/answer/9898842|Google Play Support "Metadata"]]. ==== 5.6 Google Play - Rejection ==== *Functionality, Content, and User Experience policy: Violation of Functionality, Content, and User Experience policy *"In accordance with the Functionality, Content, and User Experience policy, your app has not met one or more of the following requirements: Your app is static and does not contain app-specific functionalities" :-(. *[[http://support.google.com/googleplay/android-developer/answer/9898783|Google Play Support "Functionality, Content, and User Experience"]] - "Limited Functionality and Content". ===== My first Google Play App, with MIT App Inventor ===== ==== 1 MIT App Inventor ==== *The free online service [[http://ai2.appinventor.mit.edu/|MIT "App Inventor"]]. *See [[android06.html|Android 6/14 - App Protoyping]]. ==== 2 My MIT App Inventor App "Conference Selfie" ==== ==== 3 Publish the App on Google Play ==== === 3.1 Create a new Keystore with Keytool / Android Studio Keytool ==== === 3.2 Let MIT App Inventor create for you a new Keystore for use with Google Play ==== *Delete an existing keystore, built your app & by that, generate a new keystore. *"MIT App Inventor". *"Projects / Delete Keystore". *Set new version number: "Projects / Project Properties / Publising" - "VersionCode", "VersionName". *"Build / Android App Bundle (.aab)". *A file "conference_selfie.aab" is generated. *By this app building, "MIT App Inventor" created a new keystore. *"MIT App Inventor". *Export the new keystore: "MIT App Inventor" - "Projects / Export Keystore", save as "**hemmerling_mit.keystore**". === 3.2 Upload the MIT App Inventor Private Key to Google Play ==== == "Use existing app signing key from Java keystore" - Failure === *"Google Play Console" - "Test and release / Setup / App signing" - "Let Google Play manage your app signing key". *"Use existing app signing key from Java keystore". *"Download PEPK tool. *JAR binary "pepk.jar". *[[http://www.gstatic.com/play-apps-publisher-rapid/signing-tool/prod/pepk-src.jar|Google Play "pepk-src.jar"]]. *Execute "java -jar pepk.jar --keystore=**hemmerling_mit.keystore** --alias=**androidkey** --output=hemmerling_mit.zip --rsa-aes-encryption --encryption-key-path=encryption_public_key.pem". *"Enter password for store 'hemmerling_mit.keystore'": "**android**". *"Enter password for key 'androidkey'": "**android**". *"Upload private key" - Upload of "hemmerling_mit.zip" was rejected by the error message "The private key doesn't match the current app certificate" :-(. == "Use existing app signing key from another repository" - Failure === *"Google Play Console" - "Test and release / Setup / App signing" - "Let Google Play manage your app signing key". *"Use existing app signing key from Java keystore". *"Download PEPK tool. *JAR binary "pepk.jar". *[[http://www.gstatic.com/play-apps-publisher-rapid/signing-tool/prod/pepk-src.jar|Google Play "pepk-src.jar"]]. *Execute "java -jar pepk.jar --keystore=**hemmerling_mit.keystore** --alias=**androidkey** --output=hemmerling_mit.zip --rsa-aes-encryption --encryption-key-path=encryption_public_key.pem" ??????? *"Enter password for store 'hemmerling_mit.keystore'": "**android**". *"Enter password for key 'androidkey'": "**android**". *"Upload private key" - Upload of "hemmerling_mit.zip" was rejected by the error message "The private key was not properly encrypted, or is not a type of key we support" :-(. === 3.3 Create an "App icon" Screenshot with MIT App Inventor === *[[http://community.appinventor.mit.edu/t/how-can-i-change-the-mit-app-icon-from-my-created-apk/45420|MIT App Inventor Community "How can i change the MIT APP icon from my created apk"]]. *[[https://community.appinventor.mit.edu/t/nb195a-where-do-you-find-app-name-icon-version-number-code-theming-blocks-toolkit-default-filescope-properties/100747|MIT App Inventor Community "nb195a - Where do you find: App Name & Icon, Version Number & Code, Theming, Blocks Toolkit, Default Filescope properties?"]]. ===== Resources ====== ==== My first App ==== *[[http://developer.android.com/codelabs/basic-android-kotlin-compose-first-app|Android Developers "Create your first Android app"]]. ==== App Signing for Google Play ==== === 1 Basics of App Signing ==== *[[http://developer.android.com/studio/publish/app-signing|Android Developers "Sign your app"]] #. *[[http://developer.android.com/guide/app-bundle|Android Developers "About Android App Bundles"]]. *[[http://developers.google.com/android/guides/client-auth|Android Developers "Authenticating Your Client"]] - "Using Keytool on the certificate". *Execute keytool -list -v \ -alias -keystore *[[http://support.google.com/googleplay/android-developer/answer/9859152|Google Play Console Help "Create and set up your app"]]. *[[http://play.google.com/console/about/app-bundle-explorer/|Google Play Console About "App bundle explorer"]]. *[[http://support.google.com/googleplay/android-developer/answer/9842756|Google Play Console Support "Use Play app signing"]]. *"Descriptions of keys, artifacts and tools". *"Create an upload key and update keystores". *"keytool -export -rfc -keystore upload-keystore.jks -alias upload -file upload_certificate.pem". *[[http://source.android.com/docs/security/features/apksigning|Android Source Docs "App signing"]] - About APK signing. *"Google Play Console" - "Test and release / Setup / App signing". -Let Google Play manage your app signing key. Use existing app signing key from Java keystore. *"Download PEPK tool. *JAR binary "pepk.jar". *[[http://www.gstatic.com/play-apps-publisher-rapid/signing-tool/prod/pepk-src.jar|Google Play "pepk-src.jar"]]. *Execute java -jar pepk.jar --keystore=foo.keystore --alias=foo --output=encrypted_private_key_path --rsa-aes-encryption --encryption-key-path=/path/to/encryption_public_key.pem -Use existing app signing key from another repository. *Download encryption public key. *Upload private key. -Use a new app signing key (this requires ongoing dual releases) :-(. === 2 Android Keystore System === *[[http://developer.android.com/privacy-and-security/keystore|Android Developers "Android Keystore system"]]. *[[http://www.google.com/search?q=android+keystore|Google - Search for "android keystore"]]. === 3 Publishing an MIT App Inventor App to Google Play === *[[http://appinventor.mit.edu/explore/ai2/google-play.html|MIT App Inventor "Publishing Apps to Google Play (App Inventor 2)"]]. *"MIT App Inventor" - "Projects / Project Properties / Publising" - "VersionCode", "VersionName". *A Word about keystores: -During the .apk building process your application is **signed with a digital private key** which is associated with your account. -Whenever you build a new version this **same key** is used to sign the new version. When an android phone has an application installed on it, it remembers the key that was used to sign it. In order to install an updated version of an application, the new application must be signed by the same key. It is therefore important that you not lose this key! *Your **private digital key is stored in a keystore file**. Normally the MIT App Inventor server will create this file when needed and store it for you so you do not need to worry about it. Although we do not anticipate losing your keystore file, we recommend that you back it up. *[[http://community.appinventor.mit.edu/|MIT App Inventor Community]]. *[[http://community.appinventor.mit.edu/t/keystore-password/2435|MIT App Inventor Community "Keystore password"]] # - "Default Keystore Password: android Default Keystore Alias: androidkey Default Key Password: android". *[[http://community.appinventor.mit.edu/t/aab-file-signing-tutorial/41392|MIT App Inventor Community "AAB file signing tutorial"]]. *[[http://community.appinventor.mit.edu/t/preparing-aab-bundle-for-google-play/61656|MIT App Inventor Community "Preparing .aab bundle for Google Play"]]. *[[http://community.appinventor.mit.edu/t/apk-signing-with-google-play/15449|MIT App Inventor Community "APK signing with Google Play"]] - "Assuming the only way forward is going through with the App Signing, you will need to export your android.keystore from App Inventor (see Projects > Export Keystore) and then upload it to Google. Once you've done that, use the Delete Keystore menu item to remove your old keystore. The next time you build your app, App Inventor will generate a new keystore for signing. Upload the resulting APK to Google Play Store to deploy it. You'll also want to back up your new android.keystore because losing it will mean you can't (easily) update your apps in the future". *[[http://community.appinventor.mit.edu/t/app-signing-publishing-error-for-abb-file/44676|MIT App Inventor Community "App Signing publishing error for abb file"]]. *[[http://community.appinventor.mit.edu/t/use-a-valid-app-signing-key-to-continue/90496|MIT App Inventor Community "Use a valid app signing key to continue"]]. *[[http://community.appinventor.mit.edu/t/app-signing-and-keystore/6639|MIT App Inventor Community "App signing and keystore"]]. *[[http://community.appinventor.mit.edu/t/app-signing-publishing-error-for-abb-file/44676/3|MIT App Inventor Community "App Signing publishing error for abb file"]]. -Export the current keystore and backup it. -Delete the current keystore in the Designer (AI2). -Reload the browser (not quite sure if necessary). -Build the AAB (a new keystore is generated then). -Upload AAB to the Play Store. ==== General Resources ==== *Error message when trying to upload the signed "MIT App Inventor" .aab file: "To upload an Android App Bundle you must be enrolled in Play app signing". *[[http://www.google.com/search?client=firefox-b-d&q=To+upload+an+Android+App+Bundle+you+must+be+enrolled+in+Play+app+signing|Google - Search for "To upload an Android App Bundle you must be enrolled in Play app signing"]]. *[[http://support.google.com/googleplay/android-developer/thread/232306839/facing-this-issue-to-upload-an-android-app-bundle-you-must-be-enrolled-in-play-app-signing|Google Play Console Help "Facing this issue : To upload an Android App Bundle you must be enrolled in Play App Signing"]]. *[[htpp://support.google.com/googleplay/android-developer/answer/9842756|Google Play Console Help "Use Play App Sign"]]. *[[http://developer.android.com/tools/apksigner|Android Developers "apksigner"]] - "The apksigner tool, available in revision 24.0.3 and higher of the Android SDK Build Tools, lets you sign APKs and confirm that an APK's signature will be verified successfully on all versions of the Android platform supported by that APK". *Search. *[[http://support.google.com/googleplay/android-developer/community-guide/243925915|Google Play Support "How to request a new upload key"]]. *[[hhttp://www.google.com/search?q=The+private+key+was+not+properly+encrypted+or+is+not+a+type+of+key+we+support|Google - Search for "The private key was not properly encrypted or is not a type of key we support"]]. *[[http://www.google.com/search?q=The+private+key+doesn%27t+match+the+current+app+certificate+google+play|Google - Search for "The private key doesn't match the current app certificate google play"]]. *[[http://devjorgecastro.medium.com/update-your-android-app-signing-key-from-a-new-keystore-with-play-app-signing-8bd998a81d31|Medium, Jorge Luis Castro Medina "Update your Android app signing key from a new Keystore with Play App Signing"]]. *With Keytool, the generated keystore isn't accepted by "MIT App Inventor" :-( keytool -genkey -v -keystore new_keystore.keystore -alias new_alias -keyalg RSA -keysize 2048 -validity 10000 *[[http://medium.com/androiddevelopers/answers-to-common-questions-about-app-signing-by-google-play-b28fef836af0|Medium, "Answers to common questions about Play App Signing"]]. {{tag>"Google Android" Android}}