simplinnovation

Android React Native & Favoriot API

Video Lintang

  1. Make sure Node.js is installed on your PC, then simply download or clone this repo and install all dependencies:

    $ git clone https://github.com/LintangWisesa/Android-React_Native-Favoriot-API.git
    
    $ cd Android-React_Native-Favoriot-API
    
    $ npm install

  1. Open your code editor (I'm using Visual Studio Code), insert your Favoriot API key and Favoriot device developer ID to the App.js file!

    • API key goes to request headers:

      var headers = {
      headers: {
          'Content-Type': 'application/json',
          'apikey': 'your_API_key'
          }
      }
    • Device developer ID goes to request headers:

      var dataBody = {
          device_developer_id: 'your_device_developer_ID',
          data: {
              Temperature: this.state.input1,
              Humidity: this.state.input2,
              Potentio: this.state.input3
          }
      }

  1. Open your Android emulator or AVD (Android Virtual Device), in this case I'm using Genymotion cause it's lighter than Android Studio's AVD. Then just run the project!

    $ react-native run-android

    The app will be run automatically on your AVD. Try to POST some data & GET the data back from Favoriot!

    android

    Enjoy your code~ 😍

Lintang Wisesa 💌 lintangwisesa@ymail.com

Facebook | Twitter | Google+ | Youtube | :octocat: GitHub | Hackster