Skip to content

Commit b969b11

Browse files
author
Daisuke Baba
committed
Merge branch 'release/0.2.0'
2 parents fea2e3b + 8a36807 commit b969b11

29 files changed

Lines changed: 362 additions & 309 deletions

.classpath

Lines changed: 0 additions & 26 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
target
22
tmp
33
.idea
4-
*.iml
4+
*.iml
5+
libs/com/hoho/usb-serial-for-android/ccc8e8d
6+
libs/com/hoho/usb-serial-for-android/b96f9ca

.project

Lines changed: 0 additions & 23 deletions
This file was deleted.

.settings/org.eclipse.jdt.core.prefs

Lines changed: 0 additions & 5 deletions
This file was deleted.

.settings/org.eclipse.m2e.core.prefs

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
# AndroidSerial for Processing
22

3+
[![GitHub release](https://img.shields.io/github/release/inventit/processing-android-serial.svg)](https://github.com/inventit/processing-android-serial/releases/latest)
4+
[![master Build Status](https://travis-ci.org/inventit/processing-android-serial.svg?branch=master)](https://travis-ci.org/inventit/processing-android-serial/)
5+
[![License MIT](https://img.shields.io/github/license/inventit/processing-android-serial.svg)](http://opensource.org/licenses/MIT)
6+
37
This is a Processing-for-Android library offering the serial communication.
48

5-
This library works on Android 3.1 or later since it uses Android USB Host API.
9+
This library works on Android 5.0 or later since it uses Android USB Host API.
610

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.
11+
This library also includes [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) containing FTDI serial driver and USB CDC/ACM serial driver working on Android. Since the project creates only AAR file by default, there is a shell script, `update_libs.sh`, to extract a jar file from the built AAR file. Use the script when you require the other revision of the project binary.
812

913
Note that this version is alpha release.
1014

1115
## How to use
1216

13-
Build the source code (see below) or download a binary from [our SourceForge project page](https://sourceforge.net/projects/procandser/).
17+
Build the source code (see below) or download a binary from [the release page](https://github.com/inventit/processing-android-serial/releases).
18+
19+
Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial` directory to your `libraries` folder (e.g. `~/Documents/Processing/libraries`).
1420

15-
Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial` directory to your `library` folder (e.g. `~/Documents/Processing/library`).
21+
If you already install the older version of `AndroidSerial` library, remove it prior to copying the new one.
1622

1723
The usage of the library is almost same as [processing.serial.Serial](http://processing.org/reference/libraries/serial/Serial.html) library.
1824

@@ -32,33 +38,40 @@ Other methods in processing.serial.Serial class should work without any changes.
3238

3339
You can get a working example from the [sparkfun's pulse sensor SEN-11574](https://www.sparkfun.com/products/11574).
3440

35-
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)
41+
1. Install Android SDK Platform 23 or higher as well as Android SDK Tools and Android SDK Platform-tools or later (I tried Android SDK Platform 23/24, SDK Platform Tools 24.0.3, SDK Tools 25.2.2, and Processing 3.2.1)
3642
1. Install Android mode on your Processing environment
43+
1. Install this library (Unzip `AndroidSerial-distribution.zip` and copy all files including `AndroidSerial` directory to your `libraries` folder (e.g. `~/Documents/Processing/libraries`))
3744
1. Go to the [page](https://www.sparkfun.com/products/11574)
3845
1. Download the Processing sketch from `Documents` section
39-
1. Open the downloaded sketch
40-
1. Modify the code as below
46+
1. Open the downloaded Processing sketch (not Arduino)
47+
1. On the Processing IDE, choose `Sketch` -> `Import Library` -> `Android Serial Library for Processing` (This will insert `import io.inventit.processing.android.serial.*;`)
48+
1. Modify the code as below (see [here](https://github.com/WorldFamousElectronics/PulseSensor_Amped_Processing_Visualizer/blob/pr/1/PulseSensorAmpd_Processing_1dot1/PulseSensorAmpd_Processing_1dot1.pde) for the source code available at the sparkfun site)
4149

42-
L60: println(Serial.list()); // print a list of available serial ports
50+
L9: // import processing.serial.*; // comment out
51+
L57: println(Serial.list()); // print a list of available serial ports
4352
| (add `this`)
4453
v
45-
L60: println(Serial.list(this)); // print a list of available serial ports
54+
L57: println(Serial.list(this)); // print a list of available serial ports
4655

47-
L62: port = new Serial(this, Serial.list()[0], 19200); // make sure Arduino is talking serial at this baud rate
56+
L61: port = new Serial(this, Serial.list()[0], 115200); // make sure Arduino is talking serial at this baud rate
4857
| (add `this`)
4958
v
50-
L62: port = new Serial(this, Serial.list(this)[0], 19200); // make sure Arduino is talking serial at this baud rate
59+
L61: port = new Serial(this, Serial.list(this)[0], 115200); // make sure Arduino is talking serial at this baud rate
5160

52-
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
61+
1. Please make sure that you need to check and modify the index of `Serial.list(this)` at the line 62 in order to specify the valid port name
5362
1. Create `res/xml` directories under the opened sketch directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1`)
5463
1. Copy `examples/PulseSensor11574/res/xml/device_fileter.xml` to the created directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1/res/xml`)
5564
1. Copy `examples/PulseSensor11574/AndroidManifest.xml` to the opened sketch directory (e.g. `~/Documents/Processing/PulseSensorAmpd_Processing_1dot1`)
56-
1. Connect your Android 3.1+ device to your computer and Run the code
65+
1. Connect your Android device to your computer and Run the code
5766
1. The application may report `Unexpected error` on your Android screen but you can ignore it (tap `OK`)
5867
1. Disconnect the Android device from the computer and connect your FTDI device or Arduino to the Android device with USB cable
5968
1. Android asks you to choose an application to launch, then choose your application (e.g. `PulseSensorAmpd_Processing_1dot1`)
6069
1. Finally, you will see the same screen as your computer!
6170

71+
** Screenshot on Galaxy J **
72+
73+
![Galaxy J Screenshot](images/Galaxy_J_Screenshot.jpg)
74+
6275
## How to build
6376

6477
You can build the project source code though you can download the built binary from [our SourceForge project page](https://sourceforge.net/projects/procandser/).
@@ -67,6 +80,7 @@ Prior to building the project, you need to install the following software:
6780

6881
1. JDK 6+ (Any JDK will be available)
6982
1. [Apache Maven](http://maven.apache.org/) (Choose the latest one if possible)
83+
1. [Gradle](https://gradle.org) is required if you run `update_libs.sh`, which downloads and builds the other revision of `usb-serial-for-android` source code than `b96f9ca`
7084

7185
Then run the following command under the root of the project:
7286

@@ -77,15 +91,15 @@ And you can find the artifact file named `AndroidSerial-distribution.zip` at `ta
7791
## Directory Structure
7892
The directory structure of this application is as follows:
7993

80-
|-- .settings (E)
94+
|-- images
8195
|-- libs
8296
| |-- processing
8397
| | `-- android-core
84-
| | `-- 2.0
98+
| | `-- android-mode-0252
8599
| `-- com
86100
| `-- hoho
87101
| `-- usb-serial-for-android
88-
| `-- v010
102+
| `-- b96f9ca
89103
|-- src
90104
| |-- main
91105
| | |-- assembly
@@ -99,14 +113,13 @@ The directory structure of this application is as follows:
99113
| |-- java
100114
| `-- resources
101115

102-
(E) Eclipse specific setting files
103116
(X) is a working example for Sparkfun's Pulse Sensor SEN-11574
104117

105118
## Source Code License
106119

107120
All program source codes are available under the MIT style License.
108121

109-
Copyright (c) 2013 Inventit Inc.
122+
Copyright (c) 2016 Inventit Inc.
110123

111124
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:
112125

@@ -123,12 +136,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
123136
* [Robolectric](https://github.com/robolectric/robolectric/) ... Android testing library (TEST USE ONLY)
124137
* [Mockito](https://code.google.com/p/mockito/) ... Mock testing library (TEST USE ONLY)
125138

126-
## Known Issues
139+
## Change History
127140

128-
* Unexpected error occurs when the sketch is compiled and installed into a device
129-
* 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
141+
0.2.0 : September 23, 2016
130142

131-
## Change History
143+
* Rename package to `io.inventit.processing.android.serial`
144+
* Processing 3.2 support
145+
* Use the latest version of [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android)
146+
* Android Mode 0252 support
132147

133148
0.1.0-alpha : February 29, 2016
134149

images/Galaxy_J_Screenshot.jpg

17.3 KB
Loading

library.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ authorList = [Daisuke Baba](https://github.com/dbaba)
1010
url = https://github.com/inventit/processing-android-serial
1111

1212
# 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-
#
13+
# "3D" "Animation" "Compilations" "Data"
14+
# "Fabrication" "Geometry" "GUI" "Hardware"
15+
# "I/O" "Language" "Math" "Simulation"
16+
# "Sound" "Utilities" "Typography" "Video & Vision"
17+
#
1818
# If a value other than those listed is used, your library will listed as "Other."
19-
category = Hardware
19+
category = I/O
2020

2121
# A short sentence (or fragment) to summarize the library's function. This will be
2222
# shown from inside the PDE when the library is being installed. Avoid repeating
@@ -29,7 +29,7 @@ sentence = Android Serial Library
2929
# 'sentence' always will be prepended, so you should start by writing the
3030
# second sentence here. If your library only works on certain operating systems,
3131
# mention it here.
32-
paragraph = This library works on Android 3.1 or later.
32+
paragraph = This library works on Android 5.0 or later.
3333

3434
# Links in the 'sentence' and 'paragraph' attributes can be inserted using the
3535
# same syntax as for authors. That is, [here is a link to Processing](http://processing.org/)
@@ -42,4 +42,4 @@ paragraph = This library works on Android 3.1 or later.
4242
version = 3
4343

4444
# The version as the user will see it. If blank, the version attribute will be used here
45-
prettyVersion = 0.1.0-alpha
45+
prettyVersion = 0.2.0
Binary file not shown.

libs/com/hoho/usb-serial-for-android/v010/usb-serial-for-android-v010.pom renamed to libs/com/hoho/usb-serial-for-android/b96f9ca/usb-serial-for-android-b96f9ca.pom

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.hoho</groupId>
44
<artifactId>usb-serial-for-android</artifactId>
5-
<version>v010</version>
5+
<version>b96f9ca</version>
66
<url>https://code.google.com/p/usb-serial-for-android/</url>
77
<description>GNU Lesser GPL</description>
88
<name>USB Serial Driver for Android</name>
9-
</project>
9+
</project>

0 commit comments

Comments
 (0)