Skip to content

Releases: slick-lab/native.cr

0.1.4

20 Jun 22:28
330324a

Choose a tag to compare

What's Changed

Full Changelog: v0.1.2...v0.1.4

fixed all macros issues

18 Jun 12:19
d58ea5c

Choose a tag to compare

What's Changed

Full Changelog: v0.1.1...v0.1.2

v0.1.1

11 Jun 14:43

Choose a tag to compare

Full Changelog: v0.1.0...v0.1.1

release v0.1.

11 Jun 14:25

Choose a tag to compare

First Public Release

native.cr is a framework for building native mobile applications using the Crystal language. Write your app logic once in Crystal. Deploy to Android. Run on desktop during development.

Features

Core Framework

  • Native::App base class with state preservation
  • UI components: View, Text, Button, Image, Column, Row, Container
  • Styling system with colors, fonts, themes, edge insets, corner radius
  • Touch events and gesture handling
  • Animation system with curves (linear, ease-in, ease-out, bounce, elastic)
  • Math utilities: Vector2, Vector3, Rect, Matrix3, Color

Platform Support

  • Android: Full support via JNI + NDK
  • Desktop: Development preview via SDL2
  • iOS: Coming soon (requires Mac with Xcode)

Modules

  • Network (HTTP client, WebSocket)
  • Storage (Preferences, FileStorage, SQLite)
  • Audio (Sound playback, Music streaming, Recording)
  • Camera (Photo capture, Video recording, Preview)
  • Notifications (Local and push notifications)
  • Permissions (Runtime permission handling)
  • Biometric (Fingerprint, Face ID)
  • Payments (In-app purchases)
  • Game Loop (Fixed, Variable, Adaptive timestep)
  • Location (GPS, Geocoding)
  • Sensors (Accelerometer, Gyroscope, Magnetometer, Light, Proximity)
  • Connectivity (Network status, WiFi, Cellular)
  • Image Picker (Camera, Gallery)
  • Clipboard (Copy, Paste)
  • Share (Text, URL, Image)

UI Components (15+)

  • TextView, EditText, Button, ImageView
  • ProgressBar, SeekBar, Switch, CheckBox, RadioButton
  • Spinner, RecyclerView, WebView, CardView
  • LinearLayout, ScrollView, Icon

CLI Commands

  • native.cr create - Create new project
  • native.cr build android - Build APK
  • native.cr reload - Desktop preview with fast restart
  • native.cr doctor - Check toolchain installation

Installation

Add to your shard.yml:

dependencies:
  native:
    github: slick-lab/native.cr
    version: ~> 0.1.0

Then run:

shards install

Quick Start

# Create a new project
native.cr create my_app
cd my_app

# Build for Android
native.cr build android

# Desktop preview
native.cr reload src/main.cr

Example

include Native

class MyApp < Native::App
  @[Preserve]
  property count : Int32 = 0

  def setup : Nil
    @label = Text.new
    @label.text = "Tap: 0"
    @label.text_size = 24

    button = Button.new
    button.text = "Tap Me"
    button.on_click = ->{ increment }

    column = Column.new
    column.spacing = 20
    column.add_child(@label)
    column.add_child(button)

    @root = column
  end

  def increment : Nil
    @count += 1
    @label.text = "Tap: #{@count}"
  end
end

Native::App.start(MyApp)

Requirements

  • Crystal 1.20+
  • Android NDK r25+ (for Android builds)
  • Android SDK (for APK packaging)

Documentation

Acknowledgments

  • Crystal Language Team
  • Android NDK Team
  • SDL2 Community
  • Open Source Contributors

License

MIT


Built with frustration. Released with love.

v0.1.0-beta

11 Jun 13:35
642b0a9

Choose a tag to compare

v0.1.0-beta Pre-release
Pre-release

Full Changelog: v0.0.99...v0.1.0-beta

v0.0.99

11 Jun 08:29

Choose a tag to compare

v0.0.99 Pre-release
Pre-release

__

Full Changelog: v0.0.98...v0.0.99

Release v0.0.98

07 Jun 14:56
cdf4874

Choose a tag to compare

Changed

  • Complete rewrite of state preservation system
  • Removed JSON::Serializable to fix macro conflicts
  • New .native file format for state storage (key=type:value)
  • Added automatic macro inheritance (users no longer need to call preserve)
  • Fixed CRYSTAL_PATH issues in Termux builds
  • Improved error handling in state save/load
  • Added --release flag for production builds

Fixed

  • undefined constant UI::Text resolved
  • expected argument #1 to be IO, not JSON::Builder resolved
  • can't find file 'prelude' error fixed with CRYSTAL_PATH docs
  • State preservation now works without macro conflicts

Breaking Changes

  • State file format changed from JSON to .native (text-based key=value)
  • Users must update any custom state handling code

Installation

dependencies:
  native:
    github: slick-lab/native.cr
    version: ~> 0.0.98

Release v0.0.97

06 Jun 23:48
ad1887b

Choose a tag to compare

Recent Changes

  • Fixed Android engine compilation on Termux
  • Added prebuilt Android libraries (libnative_cr.so, libnative_cr_engine.so)
  • Added android_entry.cr with fun crystal_android_main for C interop
  • Fixed APP_CMD_INIT_WINDOW and APP_CMD_TERM_WINDOW constants
  • Added ndk-sysroot and libglvnd-dev packages for Termux builds
  • Fixed app.cr export handling for Android target
  • Improved build.cr with NDK detection and prebuilt library copying
  • Added postinstall script to download prebuilt Android libraries
  • Added .so files to GitHub Releases for distribution
  • Fixed CRYSTAL_PATH for Termux environment
  • Added gitignore for Android and iOS build artifacts

Known Issues

  • Android build requires NDK installed and ANDROID_NDK environment variable set
  • iOS build requires macOS with Xcode
  • Desktop preview only works on Linux/macOS
  • Camera module untested on real devices

Installation

Add to shard.yml:

dependencies:
  native:
    github: slick-lab/native.cr
    version: ~> 0.0.97

v0.0.23

06 Jun 23:22
b444773

Choose a tag to compare

v0.0.23 Pre-release
Pre-release
Change extern declaration to function definition