1

React Native app about sensors

 1 year ago
source link: https://reactnativeexample.com/react-native-app-about-sensors/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Sensors

Well, I was trying out react-native-sensors and a bunch of other libraries, for getting the real-time (kinda…) sensor data from my phone. This repository contains an app built with React Native.

Features

  • Utilizes accelerometer, magnetometer, gyroscope and light sensors.
  • Displays real-time sensor data.
  • Interactive button to start/stop sensor updates.
  • Simple UI.
  • Additional device info with all system features listed.
  • Automatic flashlight in the dark (only on devices with a light sensor).
  • Location data.
  • Simple music player with Nightwave Plaza radio (uses API).
  • Uses OpenWeather API to fetch location based weather data.

Installation

  1. Clone the repository:
    git clone https://github.com/Saboten758/sensors.git
  2. Navigate to the project directory:
    cd sensors
  3. Install the dependencies:
    npm install
  4. Create a file in the ‘screens’ directory and create a ‘env.tsx’ file and type:

    export  const OpenWeatherAPi=[YOUR API KEY]
  5. Run the project:
    npm start

This will start the Metro bundler and launch the project on an emulator or connected device.

Screenshots

68747470733a2f2f692e696d6775722e636f6d2f396e53444c57342e6a706567
Central
68747470733a2f2f692e696d6775722e636f6d2f366d756e3875482e6a706567
Central
68747470733a2f2f692e696d6775722e636f6d2f476c4d4248624a2e6a7067
Sensors with flashlight and device info
68747470733a2f2f692e696d6775722e636f6d2f3569496735344e2e6a706567
For devices without a light sensor
68747470733a2f2f692e696d6775722e636f6d2f423076774c79462e6a706567
For devices with a light sensor
68747470733a2f2f692e696d6775722e636f6d2f65525a754276792e6a706567
Location
68747470733a2f2f692e696d6775722e636f6d2f453736545568352e6a706722
Nightwave Plaza Radio ♫

Usage

  1. Open the app on your device or emulator.
  2. Navigate to the “Sensors” card
  3. Press the “Press me!” button to start/stop sensor updates.
  4. Explore the real-time sensor data displayed on the screen.
  5. If your device houses a light sensor, you can also use the light sensor to turn on or off flashlight automatically!!
  6. Use the “Flash” button from the main screen for using flashlight.
  7. Tap the “i” from the main screen button for getting more info about the device. In the menu, tap on “All Features” to list all the available android features.
  8. Navigate to “Location” card for getting location details
  9. Navigate to “Music” card for playing music straight from Nightwave Plaza.
  10. Navigate below to “Wheather” card to get location based weather data (work in progress).

Contributing

This is just a basic project, contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Peace!!

GitHub

View Github


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK