DZone
IoT Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > IoT Zone > How to Exploit All Sensors of Your Mobile Phone as an IoT Device

How to Exploit All Sensors of Your Mobile Phone as an IoT Device

How to use your Android phone, Apache Camel, Kibana, and ElasticSearch to use your mobile phone sensors as an IoT device.

Abdellatif Bouchama user avatar by
Abdellatif Bouchama
·
Dec. 17, 15 · IoT Zone · Tutorial
Like (16)
Save
Tweet
20.80K Views

Join the DZone community and get the full member experience.

Join For Free


This post will show you how you can exploit and send all data generated by the sensors of your mobile phone to the Internet of Things service by using Apache Camel, store the data with Elasticsearch and then how to visualize with Kibana.

Lastly, it shows you how to create and use a Rhiot Android application that exploit the following android sensors:

  • Accelerometer
  • Linear Acceleration sensor
  • Gravity sensor
  • Gyroscope
  • Light sensor
  • Orientation sensor
  • Other sensor ….

Here is an overview of the architecture:Image title

How Can We Implement This?

  • Step1: Install Camel Route on JBoss Fuse:Image title

As you can see from the camel route, after we retrieve messages from the HTTP endpoint, we will process it and store them into Elasticsearch, which will be picked up by Kibana and displayed in a Dashboard.

  • Step 2: At the Elasticsearch level, you have to create a new index, with the following mapping: https://github.com/abouchama/Rhiot_SensorDevice/blob/master/ELK/Mapping.json
  • Step 3: At this moment all the data is available in Elasticsearch, and we have just to explore, discover data, and visualize it via Kibana. For that, you have to create some visualizations that will be included in your Dashboards.
  • Step 4: Install and configure the Android app.
    • On your phone, go to Settings > Security. Under Device Administration, enable Unknown sources. Now you can install .apk files from outside of Google Play.
    • Download the Rhiot_SensorDevice.apk from the following URL:https://github.com/abouchama/Rhiot_SensorDevice/blob/master/Rhiot_SensorDevice.apk
    • Click Rhiot_SensorDevice.apk. Click Install

The Rhiot app is now installed on your Android device.

Note: The .apk file is compiled for Android version 5.0.1.

    • Start the Rhiot app.
    • Fill the URL and click on Start button.Image title

Below is an example of the Dashboard generated:

Image title

You can find the project code here:

 https://github.com/abouchama/Rhiot_SensorDevice/

Conclusion

Admittedly, this example is very simple and demonstrates how to turn your mobile phone into a sensor device, connect it to the Internet of Things server (Can be a Rhiot gateway), send data, and receive data. You also learned how to process and visualize device data with Apache Camel and Kibana.

I hope that you find this post useful and good luck with your projects!

IoT Mobile phone mobile app

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How API Management Can Ease Your Enterprise Cloud Migration
  • Tools and Integrations to Significantly Improve Code Review in GitHub
  • IntelliJ Integration for Mockito
  • Roles in Data Science Teams

Comments

IoT Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo