Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi LED Blueprints

You're reading from  Raspberry Pi LED Blueprints

Product type Book
Published in Sep 2015
Publisher
ISBN-13 9781782175759
Pages 180 pages
Edition 1st Edition
Languages
Author (1):
Agus Kurniawan Agus Kurniawan
Profile icon Agus Kurniawan

Table of Contents (14) Chapters

Raspberry Pi LED Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Getting Started with LED Programming through Raspberry Pi GPIO Make Your Own Countdown Timer Make Your Own Digital Clock Display LED Dot Matrix Building Your Own Traffic Light Controller Building Your Own Light Controller-based Bluetooth Making Your Own Controlled Lamps Through Internet Network Index

Connecting PhoneGap Android to Raspberry Pi through RESTful


It's more convenient to control three LEDs from the Android app. It's fine if you use a browser on Android and navigate to the RESTful server on Raspberry Pi. We call our RESTful from the Android app. In this section, we will build a PhoneGap app for the Android target and control the three LEDs. We use the previous program, the ledrest.js file, as a RESTful server, which controls LEDs on Raspberry Pi.

First, we create a PhoneGap project named leds-android:

$ phonegap create leds-android
$ cd /leds-android
$ phonegap build android --verbose

Try to run the program on the Android emulator for testing purposes:

$ phonegap run android --emulator --verbose

If the program runs well, we continue to modify our program. To communicate between the PhoneGap Android and RESTful server, we use jQuery, the https://jquery.com. Place jquery-*.*.*.min.js file into the <project_root>/www/js folder. The next step is to modify the index.html and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}