{"id":20652095,"url":"https://github.com/elixir-desktop/android-example-app","last_synced_at":"2025-04-06T15:13:40.932Z","repository":{"id":45856912,"uuid":"406087403","full_name":"elixir-desktop/android-example-app","owner":"elixir-desktop","description":"Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime","archived":false,"fork":false,"pushed_at":"2025-03-07T17:07:28.000Z","size":50596,"stargazers_count":105,"open_issues_count":4,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T06:22:16.918Z","etag":null,"topics":["android","elixir","erlang","liveview"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-desktop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T18:34:41.000Z","updated_at":"2025-03-26T00:26:52.000Z","dependencies_parsed_at":"2024-05-15T22:54:02.198Z","dependency_job_id":null,"html_url":"https://github.com/elixir-desktop/android-example-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fandroid-example-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fandroid-example-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fandroid-example-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fandroid-example-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-desktop","download_url":"https://codeload.github.com/elixir-desktop/android-example-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500469,"owners_count":20948880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","elixir","erlang","liveview"],"created_at":"2024-11-16T17:32:22.126Z","updated_at":"2025-04-06T15:13:40.926Z","avatar_url":"https://github.com/elixir-desktop.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TodoApp Android: An Android Sample App\n\nThis Android Studio project wraps the [Desktop Sample App](https://github.com/elixir-desktop/desktop-example-app) to run on an Android phone.\n\n## Runtime Notes\n\nThe pre-built Erlang runtime for Android ARM/ARM64/x86 is embedded in this example git repository. These native runtime files include Erlang OTP and the exqlite nif to use SQLite on the mobile. These runtimes are generated using the CI of the [Desktop Runtime](https://github.com/elixir-desktop/runtimes) repository.\n\nBecause Erlang OTP has many native hooks for networking and cryptographics the Erlang version used to compile your App must match the pre-built binary release that is embedded. In this example that is Erlang OTP 25.0.4. This sample is shipping with a `.tool-versions` file that `asdf` will automatically use to automate this requirement. \n\n## How to build \u0026 run\n\n1. Install [Android Studio](https://developer.android.com/studio) + NDK.\n1. Install git, npm, asdf\n\n    ```\n    sudo apt install git npm curl\n    git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2\n    echo \". $HOME/.asdf/asdf.sh\" \u003e\u003e ~/.bashrc\n    echo \". $HOME/.asdf/completions/asdf.bash\" \u003e\u003e ~/.bashrc\n    . $HOME/.asdf/asdf.sh\n    ```\n\n1. Install Erlang-OTP (with openssl) in the same version 26.2.5 as the bundled runtime edition:\n\n    ```\n    asdf install erlang 26.2.5\n    asdf install elixir 1.17.2-otp-26\n    ```\n\n1. Go to \"Files -\u003e New -\u003e Project from Version Control\" and enter this URL: https://github.com/elixir-desktop/android-example-app/ \n\n1. Start the App\n\n\n## Customize app name and branding\n\nUpdate these places with your package name:\n\n1) App name in [strings.xml](app/src/main/res/values/strings.xml#L2) and [settings.gradle](settings.gradle)\n1) Package names in [Bridge.kt:1](app/src/main/java/io/elixirdesktop/example/Bridge.kt#L1) and [MainActivity.kt:1](app/src/main/java/io/elixirdesktop/example/MainActivity.kt#L1) (rename `package io.elixirdesktop.example` -\u003e `com.yourapp.name` or use the Android Studios refactor tool)\n1) App icon: [ic_launcher_foreground.xml](app/src/main/res/drawable-v24/ic_launcher_foreground.xml) and [ic_launcher-playstore.png](app/src/main/ic_launcher-playstore.png) \n1) App colors: [colors.xml](app/src/main/res/values/colors.xml) and launcher background [ic_launcher_background.xml](app/src/main/res/values/ic_launcher_background.xml)\n\n## Known todos\n\n### Initial Startup could be faster\n\nRunning the app for the first time will extract the full Elixir \u0026 App runtime at start. On my Phone this takes around 10 seconds. After that a cold app startup takes ~3-4 seconds.\n\n### Menus and other integration not yet available\n\nThis sample only launch the elixir app and shows it in an Android WebView. There is no integration yet with the Android Clipboard, sharing or other OS capabilities. They can though easily be added to the `Bridge.kt` file when needed.\n\n##  Other notes\n\n- Android specific settings, icons and metadata are all contained in this Android Studio wrapper project. \n\n- `Bridge.kt` and the native library are doing most of the wrapping of the Elixir runtime. \n\n## Screenshots\n\n![Icons](/icon.jpg?raw=true \"App in Icon View\")\n![App](/app.png?raw=true \"Running App\")\n\n## Architecture\n\n![App](/android_elixir.png?raw=true \"Architecture\")\n\nThe Android App is initializing the Erlang VM and starting it up with a new environment variable `BRIDGE_PORT`. This environment variable is used by the `Bridge` project to connect to a local TCP server _inside the android app_. Through this new TCP communication channel all calls that usually would go to `wxWidgets` are now redirected. The Android side of things implements handling in `Bridge.kt`.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-desktop%2Fandroid-example-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-desktop%2Fandroid-example-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-desktop%2Fandroid-example-app/lists"}