androidovshchik / KRNJBC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kotlin React-Native Mpp

jCenter PRs Welcome All Contributors Tweet

A React-Native App written with Kotlin JS

Introduction ๐Ÿ™‹โ€โ™‚๏ธ

This is an example project to show how you can use KotlinJS to write React-Native Apps. You can click on an floating action button and a counter will update

๐Ÿ  Architecture

๐Ÿ› ๏ธ Built With

Kotlin

jCenter

Tools

jCenter

Project Structure

  • android - Base android project directory
  • ios - Base ios project directory
  • shared - This module is using the Kotlin Multiplatform Plugin, but is only configured to compile to Javascript/React. The main entry of the module is inside the index.kt. In the imports-folder are all relevant wrapper for the React modules. In the ui-folder are all (you might guessed it), ui relevant files

Development

  1. Install Yarn.
  2. Run yarn install to install all the javascript dependencies.
  3. Run ./gradlew -t :shared:assemble - compiles the Kotlin javascript module located in ./shared, and watches it for changes. Leave this terminal open. Remove the -t argument if you don't want gradle to watch for changes and auto-rebuild.
  4. Run yarn haul start --platform android. You should now see the message "You can now run the app on your * device"
  5. Run the Android app in an Android emulator. Open the app menu, press Command + M on OSX or Ctrl + M on Linux and Windows. Inside "Dev Settings" disable "JS Delta". Leave the dev settings.
  6. Changes in the "shared" folder should now trigger the app to update the content. Altenative you can manually trigger a reload in the app menu.

โœ๏ธ Feedback

Feel free to send feedback on Twitter or file an issue. Feature requests are always welcome.

๐Ÿ“œ License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details

Find this project useful ? โค๏ธ

  • Support it by clicking the โญ button on the upper right of this page. โœŒ๏ธ

License

Copyright 2019 Jens Klingenberg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Acknowledgments

Projects that helped me understand how to setup the project:

About

License:Apache License 2.0


Languages

Language:Kotlin 75.9%Language:Objective-C 13.5%Language:Starlark 5.8%Language:JavaScript 4.8%