https://github.com/bpevs/tauri_deno_mobile_sample
Sample app using the Tauri Mobile Alpha version with a Deno app
https://github.com/bpevs/tauri_deno_mobile_sample
Last synced: about 1 year ago
JSON representation
Sample app using the Tauri Mobile Alpha version with a Deno app
- Host: GitHub
- URL: https://github.com/bpevs/tauri_deno_mobile_sample
- Owner: bpevs
- Created: 2023-01-12T04:55:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T21:27:52.000Z (about 2 years ago)
- Last Synced: 2025-03-26T08:51:39.224Z (about 1 year ago)
- Language: Kotlin
- Size: 961 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tauri Deno Mobile (Android) Sample
For building Android apps on MacOS, using Tauri and Solidjs
Heavy inspiration from [Tauri Deno Starter](https://github.com/marc2332/tauri-deno-starter)!
# Environment Setup
Assuming you have already installed latest `Deno` and `Rust`...
### Install full xcode (Maybe optional?)
I had to install this to run `cargo mobile` and `cargo android`, which I mistakenly used first. So maybe `cargo tauri android` gets around this? I haven't uninstalled it, so not sure if it's actually necessary.
When I was running `cargo mobile`, it made me use the full xcode instead of xcode-select, because it was trying to build for iOS. So maybe that is required as well, not sure.
### Install Tauri Beta Version (with Mobile)
Since it's beta, just make sure to specifically tag the version when installing Tauri: `cargo install tauri-cli@2.0.0-beta.{release version here}`
### Android Stuff
Basically following the [getting started guide](https://tauri.app/v1/guides/getting-started/prerequisites), installing thrigs via cargo when possible, and ignoring the any npm stuff.
Downloaded Android Studio...
The download for NDK was in:
`Android Studio > Tools > SDK Manager > Android SDK > SDK TOOLS`
I installed:
- Android SDK Build-TOols
- NDK (Side by side)
- Android Emulator
- Android SDK Platform-Tools
Then found NDK version via `ls $HOME/Library/Android/sdk/ndk`
My env variables ended up looking like this:
```sh
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export NDK_HOME="$ANDROID_HOME/ndk/25.1.8937393"
```
# Project Setup
How we got the repo to this point...
- build /gen dir: `cargo tauri init` (recc to delete, rebuild after updating Carto.toml and tauri.conf.json with your app identifiers)
- points to `../src/www`
- beforeDevCommand: `deno run -A scripts/main.ts dev`
- beforeBuildCommand: `deno run -A scripts/main.ts build`
- host: `http://localhost:3000`
- Added Deno Files
- `scripts/main.ts`: build script, using esbuild
- Prevent screen rotation by modifying `/gen/android/app/app/src/main/AndroidManifest.xml`:
- adds `android:screenOrientation`
# Usage
Available tasks are in the `deno.json` file. Run like so:
`deno task dev`