Skip to content

Commit d8e77f3

Browse files
committed
Merge branch 'release/0.0.1-alpha'
2 parents c9a987a + b017155 commit d8e77f3

29 files changed

Lines changed: 2509 additions & 0 deletions

.classpath

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
16+
<attributes>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="output" path="target/classes"/>
26+
</classpath>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>processing-android-serial</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3+
org.eclipse.jdt.core.compiler.compliance=1.6
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.6
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

AndroidSerial-distribution.zip

75.2 KB
Binary file not shown.

README.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# AndroidSerial for Processing
2+
3+
This is a Processing-for-Android library offering the serial communication.
4+
5+
This library works on Android 3.1 or later since it uses Android USB Host API.
6+
7+
This library also includes [usb-serial-for-android](https://code.google.com/p/usb-serial-for-android/downloads/list) containing FTDI serial driver and USB CDC/ACM serial driver (for Arduino). The library still has some issues and also has bunch of improvements according to the google code site. I will update the library when the newer version is released.
8+
9+
Note that this version is alpha release.
10+
11+
## How to use
12+
13+
Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial` directory to your `library` folder (e.g. `~/Documents/Processing/library`).
14+
15+
The usage of the library is almost same as [processing.serial.Serial](http://processing.org/reference/libraries/serial/Serial.html) library.
16+
17+
The difference between processing.serial.Serial and this is a static method `list()`.
18+
19+
The following code does NOT work on the AndroidSerial library.
20+
21+
println(Serial.list()); // processing.serial library
22+
23+
But this does work,
24+
25+
println(Serial.list(this));
26+
27+
Other methods in processing.serial.Serial class should work without any changes.
28+
29+
## Example
30+
31+
You can get a working example from the [sparkfun's pulse sensor SEN-11574](https://www.sparkfun.com/products/11574).
32+
33+
1. Install Android SDK Platform 10 as well as Android 3.1 or later (I tried Android SDK Platform 16 Rev. 4, SDK Platform Tools Rev. 16.0.2, SDK Tools Rev. 22, and Processing 2.0)
34+
1. Install Android mode on your Processing environment
35+
1. Go to the [page](https://www.sparkfun.com/products/11574)
36+
1. Download the Processing sketch from `Documents` section
37+
1. Open the downloaded sketch
38+
1. Modify the code as below
39+
40+
L60: println(Serial.list()); // print a list of available serial ports
41+
| (add `this`)
42+
v
43+
L60: println(Serial.list(this)); // print a list of available serial ports
44+
45+
L62: port = new Serial(this, Serial.list()[0], 19200); // make sure Arduino is talking serial at this baud rate
46+
| (add `this`)
47+
v
48+
L62: port = new Serial(this, Serial.list(this)[0], 19200); // make sure Arduino is talking serial at this baud rate
49+
50+
1. Please make sure that you need to check and modigy the index of `Serial.list(this)` at the line 62 in order to specify the valid port name
51+
1. Create `res/xml` directories under the opened sketch directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1`)
52+
1. Copy `examples/PulseSensor11574/res/xml/device_fileter.xml` to the created directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1/res/xml`)
53+
1. Copy `examples/PulseSensor11574/AndroidManifest.xml` to the opened sketch directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1`)
54+
1. Connect your Android 3.1+ device to your computer and Run the code
55+
1. The application may report `Unexpected error` on your Android screen but you can ignore it (tap `OK`)
56+
1. Disconnect the Android device from the computer and connect your FTDI device or Arduino to the Android device with USB cable
57+
1. Android asks you to choose an application to launch, then choose your application (e.g. `PulseSensorAmpd_Processing_1dot1`)
58+
1. Finally, you will see the same screen as your computer!
59+
60+
## How to build
61+
62+
Install [maven](http://maven.apache.org/) and run the command:
63+
64+
mvn clean deploy
65+
66+
And you can find the artifact file named `AndroidSerial-distribution.zip` at `target` directory.
67+
68+
## Directory Structure
69+
The directory structure of this application is as follows:
70+
71+
|-- .settings (E)
72+
|-- libs
73+
| |-- processing
74+
| | `-- android-core
75+
| | `-- 2.0
76+
| `-- com
77+
| `-- hoho
78+
| `-- usb-serial-for-android
79+
| `-- v010
80+
|-- src
81+
| |-- main
82+
| | |-- assembly
83+
| | |-- examples
84+
| | | `-- PulseSensor11574 (X)
85+
| | | | `-- res
86+
| | | | `-- xml
87+
| | |-- java
88+
| | `-- resources
89+
| `-- test
90+
| |-- java
91+
| `-- resources
92+
93+
(E) Eclipse specific setting files
94+
(X) is a working example for Sparkfun's Pulse Sensor SEN-11574
95+
96+
## Source Code License
97+
98+
All program source codes are available under the MIT style License.
99+
100+
Copyright (c) 2013 Inventit Inc.
101+
102+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
103+
104+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
105+
106+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
107+
108+
## Dependencies
109+
110+
* [usb-serial-for-android](https://code.google.com/p/usb-serial-for-android/) ... LGPL, USB serial driver for Android
111+
* [Processing Core](http://wiki.processing.org/w/FAQ#Is_Processing_Open_Source.3F_How_.27bout_some_code.3F) ... LGPL, Processing core library
112+
* [Android](http://source.android.com/source/licenses.html) ... ASL 2.0, Android API Library
113+
* [SLFJ Android](http://www.slf4j.org/android/) ... MIT, Logging framework
114+
115+
## Known Issues
116+
117+
* The release binary will be moved to [SourceForge](http://sourceforge.net/) though it is currently put under the project root
118+
* Unexpected error occurs when the sketch is compiled and installed into a device
119+
* The current version of [usb-serial-for-android](https://code.google.com/p/usb-serial-for-android/) has several issues regarding data reading. If `java.io.IOException: Expected at least 2 bytes` is observed, please wait a moment or try to re-connect the cable though the trunk version of the driver is already fixed
120+
121+
## Change History
122+
123+
0.0.1-alpha : June 10, 2013
124+
125+
* Initial

library.properties

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# UTF-8 supported.
2+
3+
# The name of your library as you want it formatted
4+
name = Android Serial Library for Processing
5+
6+
# List of authors. Links can be provided using the syntax [author name](url)
7+
authorList = [Daisuke Baba](https://github.com/dbaba)
8+
9+
# A web page for your library, NOT a direct link to where to download it
10+
url = https://github.com/inventit/processing-android-serial
11+
12+
# The category of your library, must be one (or many) of the following:
13+
# "3D" "Animation" "Compilations" "Data"
14+
# "Fabrication" "Geometry" "GUI" "Hardware"
15+
# "I/O" "Language" "Math" "Simulation"
16+
# "Sound" "Utilities" "Typography" "Video & Vision"
17+
#
18+
# If a value other than those listed is used, your library will listed as "Other."
19+
category = Hardware
20+
21+
# A short sentence (or fragment) to summarize the library's function. This will be
22+
# shown from inside the PDE when the library is being installed. Avoid repeating
23+
# the name of your library here. Also, avoid saying anything redundant like
24+
# mentioning that its a library. This should start with a capitalized letter, and
25+
# end with a period.
26+
sentence = Android Serial Library
27+
28+
# Additional information suitable for the Processing website. The value of
29+
# 'sentence' always will be prepended, so you should start by writing the
30+
# second sentence here. If your library only works on certain operating systems,
31+
# mention it here.
32+
paragraph = This library works on Android 3.1 or later.
33+
34+
# Links in the 'sentence' and 'paragraph' attributes can be inserted using the
35+
# same syntax as for authors. That is, [here is a link to Processing](http://processing.org/)
36+
37+
38+
# A version number that increments once with each release. This
39+
# is used to compare different versions of the same library, and
40+
# check if an update is available. You should think of it as a
41+
# counter, counting the total number of releases you've had.
42+
version = 1
43+
44+
# The version as the user will see it. If blank, the version attribute will be used here
45+
prettyVersion = 0.0.1-alpha

0 commit comments

Comments
 (0)