8000 GitHub - riseupgroup/cargo-sdl-apk: Build Android packages that use SDL
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

riseupgroup/cargo-sdl-apk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cargo-sdl-apk

Build Android packages that use SDL.

This cargo tool aims to be for Rust SDL what cargo-apk is for Glutin, and cargo-quad-apk is for Miniquad. That is, a simple command to package up an APK and upload it to your phone and start it. The way it works internally is by automating the steps described in this article by Julian Heinken.

Basic usage

  1. Make sure you have the following:
    • The SDL source, clone it from here. Make sure you have the release-2.26.x branch.
    • Java: jdk17
    • Android SDK with command line tools.
    • Android NDK.
  2. Set the environment variables:
    • ANDROID_HOME pointing to the Android SDK.
    • ANDROID_NDK_HOME pointing to the Android NDK.
    • SDL pointing to the SDL source dir.
  3. Run cargo run --release -- build --manifest-path /path/to/your/project/Cargo.toml --release

Project setup

The entry point for your application must be called SDL_main and use the attribute #[no_mangle]. Here is an example project. To build the project, run cargo run --release -- build --manifest-path ./example-project/Cargo.toml --release

Supported [package.metadata.android] keys

title = "Example Project"
package_name = "com.example.example_project"
permissions = ["INTERNET"]
# You can specify an icon OR an adaptive icon
icon = "icon.png"
adaptive_icon_foreground = "icon_foreground.png"
adaptive_icon_background = "icon_background.png"
adaptive_icon_monochrome = "icon_monochrome.png"
improve_fullscreen = true

About

Build Android packages that use SDL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
0