Skip to content

A React Native Hello World App that plays with Starcounter via PuppetJS

Notifications You must be signed in to change notification settings

cyberaom/HelloWorld-ReactNative

 
 

Repository files navigation

ReactNative HelloWorld with Starcounter and PuppetJS

Good read before starting: If you're confused about components and containers folders, please refer to Dan Abramov's explanation.

Expected needed time: 30 mins

(download time not included ~1.5GB for Android Studio)

These instructions assume:

Steps:

1. Clone this repo and cd to it

git clone https://github.com/StarcounterSamples/ReactNative-HelloWorld.git
cd ReactNative-HelloWorld

2. Then you need to npm install it, to download all the Node modules your app needs:

ReactNative-HelloWorld> npm install

3. Now, you need to make sure you have an AVD (Android Virtual Device) running and accessible via the ADB. To test that, type:

adb shell

in your command line, and you should have access to the CLI of your Android machine. If you succeed, you can type exit to leave the shell.

Now, you need to navigate to ReactNative-HelloWorld\puppet\puppetContainer.js and change the IP Address to your machine's IP address, keep in mind, that you can't use localhost because it refers to the Android machine itself, Save after the modification.

4. Now in your CLI, that has the current directory set to ReactNative-HelloWorld, type:

react-native run-android

It will take up to 5 minutes, and the app will start and connect to you SC instance and it will show the data in the DB!

Notes

Note 1:

You might run in some trouble when running the app, please navigate to ReactNative-HelloWorld\android\gradle.properties And make sure the line

org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_121

Points to the right JDK location.

Note 2:

This app has PuppetJS and JSONPatch embedded inside for ease of setup and use. Soon these two should be separate Node modules referenced in this app.

Note 3:

To save you some time, the files that are mostly interesting for you are in src folder.

About

A React Native Hello World App that plays with Starcounter via PuppetJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.7%
  • Objective-C 2.0%
  • Other 1.3%