Get Processing For Android: Create Mobile, Sensor-Aware, and XR Applications Using Processing 2nd Edition Colubri PDF Ebook With Full Chapters Now
Get Processing For Android: Create Mobile, Sensor-Aware, and XR Applications Using Processing 2nd Edition Colubri PDF Ebook With Full Chapters Now
com
https://ebookmass.com/product/processing-for-
android-create-mobile-sensor-aware-and-xr-
applications-using-processing-2nd-edition-colubri/
https://ebookmass.com/product/processing-for-android-create-
mobile-sensor-aware-and-xr-applications-using-processing-2nd-
edition-andres-colubri/
https://ebookmass.com/product/signal-processing-for-
neuroscientists-2nd-ed-edition-drongelen/
https://ebookmass.com/product/tensors-for-data-processing-theory-
methods-and-applications-yipeng-liu/
https://ebookmass.com/product/oil-palm-biomass-for-composite-
panels-fundamentals-processing-and-applications-s-m-sapuan/
Digital Image Processing Using MATLAB Rafael C.
Gonzalez
https://ebookmass.com/product/digital-image-processing-using-
matlab-rafael-c-gonzalez/
https://ebookmass.com/product/food-waste-recovery-processing-
technologies-industrial-techniques-and-applications-2nd-edition-
charis-m-galanakis/
https://ebookmass.com/product/designing-applications-for-google-
cloud-platform-create-and-deploy-applications-using-java-
ashutosh-shashi/
https://ebookmass.com/product/essentials-of-thermal-
processing-2nd-edition-gary-tucker/
https://ebookmass.com/product/android-for-dummies-2nd-edition-
dan-gookin/
Processing
for Android
Create Mobile, Sensor-aware, and XR
Applications Using Processing
—
Second Edition
—
Andrés Colubri
Processing for Android
Create Mobile, Sensor-aware, and XR
Applications Using Processing
Second Edition
Andrés Colubri
■
■Part I: First Steps with Processing for Android���������������������������������� 1
■
■Chapter 1: Getting Started with the Android Mode����������������������������������������������� 3
What Is the Processing Project?��������������������������������������������������������������������������������������� 3
The Processing Language���������������������������������������������������������������������������������������������������������������������� 3
The Processing Development Environment�������������������������������������������������������������������������������������������� 4
Extending Processing������������������������������������������������������������������������������������������������������� 6
The Contribution Manager���������������������������������������������������������������������������������������������������������������������� 7
Summary������������������������������������������������������������������������������������������������������������������������ 16
■
■Chapter 2: The Processing Language������������������������������������������������������������������ 17
A Programming Sketchbook for Artists and Designers�������������������������������������������������� 17
The Structure of a Processing Sketch���������������������������������������������������������������������������� 17
Summary������������������������������������������������������������������������������������������������������������������������ 51
■
■Part II: Drawing and Interaction������������������������������������������������������� 53
■
■Chapter 4: Drawing Graphics and Text���������������������������������������������������������������� 55
Drawing Shapes������������������������������������������������������������������������������������������������������������� 55
More Types of Shapes��������������������������������������������������������������������������������������������������������������������������� 55
Curve Shapes��������������������������������������������������������������������������������������������������������������������������������������� 58
Using Bézier Curves����������������������������������������������������������������������������������������������������������������������������� 60
Shape Attributes����������������������������������������������������������������������������������������������������������������������������������� 66
Shape Styles����������������������������������������������������������������������������������������������������������������������������������������� 67
vi
Drawing Images������������������������������������������������������������������������������������������������������������� 69
Drawing Text������������������������������������������������������������������������������������������������������������������� 70
Loading and Creating Fonts������������������������������������������������������������������������������������������������������������������ 70
Text Attributes��������������������������������������������������������������������������������������������������������������������������������������� 73
Scaling Text������������������������������������������������������������������������������������������������������������������������������������������ 73
Renderers in Processing������������������������������������������������������������������������������������������������ 75
The PShape Class����������������������������������������������������������������������������������������������������������� 76
Creating PShapes��������������������������������������������������������������������������������������������������������������������������������� 76
Loading Shapes from SVG�������������������������������������������������������������������������������������������������������������������� 79
Texturing Shapes���������������������������������������������������������������������������������������������������������������������������������� 81
Summary������������������������������������������������������������������������������������������������������������������������ 82
■
■Chapter 5: Touchscreen Interaction��������������������������������������������������������������������� 83
Touch Events in Android������������������������������������������������������������������������������������������������� 83
Basic Touch Events������������������������������������������������������������������������������������������������������������������������������� 83
Multi-touch Events������������������������������������������������������������������������������������������������������������������������������� 89
Touch-Based Interaction������������������������������������������������������������������������������������������������ 93
Item Selection��������������������������������������������������������������������������������������������������������������������������������������� 93
Scrolling����������������������������������������������������������������������������������������������������������������������������������������������� 95
Swipe and Pinch����������������������������������������������������������������������������������������������������������������������������������� 97
vii
Summary���������������������������������������������������������������������������������������������������������������������� 126
■
■Part III: Sensors������������������������������������������������������������������������������ 127
■
■Chapter 7: Reading Sensor Data������������������������������������������������������������������������ 129
Sensors in Android Devices������������������������������������������������������������������������������������������ 129
Accelerometer������������������������������������������������������������������������������������������������������������������������������������ 129
Gyroscope������������������������������������������������������������������������������������������������������������������������������������������� 130
Magnetometer������������������������������������������������������������������������������������������������������������������������������������ 130
Location���������������������������������������������������������������������������������������������������������������������������������������������� 130
viii
Summary���������������������������������������������������������������������������������������������������������������������� 162
■
■Chapter 9: Geolocation�������������������������������������������������������������������������������������� 163
Location Data in Android���������������������������������������������������������������������������������������������� 163
Using Location API in Processing��������������������������������������������������������������������������������� 164
Location Permissions������������������������������������������������������������������������������������������������������������������������� 165
Accessing Data from Multiple Threads����������������������������������������������������������������������������������������������� 167
Location with Ketai����������������������������������������������������������������������������������������������������������������������������� 171
Using Additional Location Data����������������������������������������������������������������������������������������������������������� 172
Summary���������������������������������������������������������������������������������������������������������������������� 182
■
■Part IV: Wearables and Watch Faces���������������������������������������������� 183
■
■Chapter 10: Wearable Devices��������������������������������������������������������������������������� 185
From Activity Trackers to Smartwatches���������������������������������������������������������������������� 185
Smartwatches������������������������������������������������������������������������������������������������������������������������������������ 186
Summary���������������������������������������������������������������������������������������������������������������������� 195
ix
■
■Chapter 11: Visualizing Time����������������������������������������������������������������������������� 197
From Sundials to Smartwatches���������������������������������������������������������������������������������� 197
Using Time to Control Motion������������������������������������������������������������������������������������������������������������� 198
Square vs. Round Watch Faces���������������������������������������������������������������������������������������������������������� 200
Summary���������������������������������������������������������������������������������������������������������������������� 209
■
■Chapter 12: Visualizing Physical Activity���������������������������������������������������������� 211
Body Sensors��������������������������������������������������������������������������������������������������������������� 211
Step Counter��������������������������������������������������������������������������������������������������������������������������������������� 211
Heart Rate������������������������������������������������������������������������������������������������������������������������������������������� 211
Summary���������������������������������������������������������������������������������������������������������������������� 235
■
■Part V: 3D and Shaders������������������������������������������������������������������� 237
■
■Chapter 13: 3D in Processing���������������������������������������������������������������������������� 239
The P3D Renderer�������������������������������������������������������������������������������������������������������� 239
Hello World in 3D�������������������������������������������������������������������������������������������������������������������������������� 239
Summary���������������������������������������������������������������������������������������������������������������������� 255
■
■Chapter 14: Lighting and Texturing������������������������������������������������������������������� 257
Making 3D Scenes more Realistic with Lights and Textures���������������������������������������� 257
Light Sources and Material Properties����������������������������������������������������������������������������������������������� 257
Texture Mapping��������������������������������������������������������������������������������������������������������������������������������� 261
xi
■
■Part VI: Extended Reality: VR and AR��������������������������������������������� 303
■
■Chapter 16: Basics of VR����������������������������������������������������������������������������������� 305
Brief History of VR�������������������������������������������������������������������������������������������������������� 305
Google Cardboard������������������������������������������������������������������������������������������������������������������������������� 305
Hardware Requirements��������������������������������������������������������������������������������������������������������������������� 306
VR in Processing���������������������������������������������������������������������������������������������������������� 306
Stereo Rendering�������������������������������������������������������������������������������������������������������������������������������� 307
Monoscopic Rendering����������������������������������������������������������������������������������������������������������������������� 309
VR Interaction��������������������������������������������������������������������������������������������������������������� 310
Eye and World Coordinates����������������������������������������������������������������������������������������������������������������� 311
The Line of Sight��������������������������������������������������������������������������������������������������������������������������������� 313
Selecting a Shape with Screen Coordinates��������������������������������������������������������������������������������������� 315
Bounding Box Selection���������������������������������������������������������������������������������������������������������������������� 318
Summary���������������������������������������������������������������������������������������������������������������������� 328
■
■Chapter 17: Basics of AR����������������������������������������������������������������������������������� 329
A Brief History of AR����������������������������������������������������������������������������������������������������� 329
AR on Android������������������������������������������������������������������������������������������������������������������������������������� 330
Requirements������������������������������������������������������������������������������������������������������������������������������������� 331
Getting Started����������������������������������������������������������������������������������������������������������������������������������� 331
Summary���������������������������������������������������������������������������������������������������������������������� 350
xii
■
■Chapter 18: Creating XR Experiences���������������������������������������������������������������� 351
Challenges with XR Apps���������������������������������������������������������������������������������������������� 351
Drawing in VR������������������������������������������������������������������������������������������������������������������������������������� 352
Initial Sketches����������������������������������������������������������������������������������������������������������������������������������� 353
Summary���������������������������������������������������������������������������������������������������������������������� 373
■
■Part VII: Appendixes����������������������������������������������������������������������� 375
■
■Chapter 19: Appendix A: Gradle and Android Studio Integration���������������������� 377
Google Tools for Android Development������������������������������������������������������������������������� 377
Exporting a Sketch As a Gradle Project������������������������������������������������������������������������ 379
Importing into Android Studio�������������������������������������������������������������������������������������� 380
Adding a Processing Sketch to a Layout���������������������������������������������������������������������� 384
■
■Chapter 20: Appendix B: Processing Libraries for Android������������������������������� 389
Extending Processing with Libraries���������������������������������������������������������������������������� 389
Installing Libraries with the Contribution Manager���������������������������������������������������������������������������� 389
Installing Libraries Manually�������������������������������������������������������������������������������������������������������������� 392
Index��������������������������������������������������������������������������������������������������������������������� 397
xiii
xv
xvii
Æsop, 30.
Aristippus, 43.
Aristophanes, 64.
Bardolph, 124.
Brighton, 103.
Chaucer, 7, 119.
Cicero, 33.
Erasmus, 118.
Eulenspiegel, 173.
Fabliaux, 30.
—— Epigrams, 59-64.
—— Parodies, 42.
Herodotus, 63.
Homer, 33.
Liston, 35.
Merry Tales and Quick Answers, 33-4, 105, 117, 119, 123,
162-7.
Myrtilus, 43.
Nithardus, 1.
Plato, 64.
Quin, 10.
Rahere, 1.
Raleigh, Sir Walter, 116.
Smith, Sydney, 9.
Spenser, 7, 159.
Strawberry, 140.
Tavern-life, 32.
Thales, 52-3.
Walworth, 1.
Wright Thomas, 5.
Yorick, 173.
THE BOOK-LOVER’S LIBRARY.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.