Skip to content

Commit fea2e3b

Browse files
author
Daisuke Baba
committed
Merge branch 'release/0.1.0-alpha'
2 parents c61413e + 15fbac7 commit fea2e3b

13 files changed

Lines changed: 43 additions & 66 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
target
22
tmp
3+
.idea
4+
*.iml

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ You can build the project source code though you can download the built binary f
6565

6666
Prior to building the project, you need to install the following software:
6767

68-
1. JDK 6 (Any JDK will be available)
68+
1. JDK 6+ (Any JDK will be available)
6969
1. [Apache Maven](http://maven.apache.org/) (Choose the latest one if possible)
7070

7171
Then run the following command under the root of the project:
@@ -130,6 +130,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
130130

131131
## Change History
132132

133+
0.1.0-alpha : February 29, 2016
134+
135+
* Processing 3 support and Processing 2 is no longer supported
136+
133137
0.0.2-alpha : June 20, 2013
134138

135139
* Fixes an [issue](https://github.com/inventit/processing-android-serial/issues/1) where [Arduino Due](http://arduino.cc/en/Main/arduinoBoardDue) cannot be detected by [usb-serial-for-android](https://code.google.com/p/usb-serial-for-android/) library. Now all Arduino devices are accepted (but not sure they all work properly. [Give us your feedback](https://github.com/inventit/processing-android-serial/issues))

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ paragraph = This library works on Android 3.1 or later.
3939
# is used to compare different versions of the same library, and
4040
# check if an update is available. You should think of it as a
4141
# counter, counting the total number of releases you've had.
42-
version = 1
42+
version = 3
4343

4444
# The version as the user will see it. If blank, the version attribute will be used here
45-
prettyVersion = 0.0.1-alpha
45+
prettyVersion = 0.1.0-alpha
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?><project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>processing</groupId>
4+
<artifactId>android-core</artifactId>
5+
<version>android-mode-0246</version>
6+
<url>https://github.com/processing/processing-android</url>
7+
<name>Processing Android Core</name>
8+
</project>

pom.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.yourinventit.processing.android.serial</groupId>
66
<artifactId>processing-android-serial</artifactId>
7-
<version>0.0.1-alpha</version>
7+
<version>0.1.0-alpha</version>
88
<name>AndroidSerial</name>
99
<organization>
1010
<name>Inventit Inc.</name>
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>processing</groupId>
4040
<artifactId>android-core</artifactId>
41-
<version>2.0</version>
41+
<version>android-mode-0246</version>
4242
<scope>provided</scope>
4343
</dependency>
4444
<dependency>
@@ -80,9 +80,9 @@
8080
<scope>provided</scope>
8181
</dependency>
8282
<dependency>
83-
<groupId>com.pivotallabs</groupId>
83+
<groupId>org.robolectric</groupId>
8484
<artifactId>robolectric</artifactId>
85-
<version>1.1</version>
85+
<version>3.0</version>
8686
<scope>test</scope>
8787
</dependency>
8888
<dependency>
@@ -151,6 +151,9 @@
151151
<groupId>org.apache.maven.plugins</groupId>
152152
<artifactId>maven-javadoc-plugin</artifactId>
153153
<version>2.8.1</version>
154+
<configuration>
155+
<additionalparam>-Xdoclint:none</additionalparam>
156+
</configuration>
154157
<executions>
155158
<execution>
156159
<phase>package</phase>

src/main/java/com/yourinventit/processing/android/serial/AbstractAndroidSerialCommunicator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ abstract class AbstractAndroidSerialCommunicator extends Serial implements
8989
*/
9090
public AbstractAndroidSerialCommunicator(PApplet parent) {
9191
this.parent = parent;
92-
final Context context = (Context) parent;
93-
this.applicatoinContext = context.getApplicationContext();
92+
this.applicatoinContext = parent.getActivity().getApplicationContext();
9493
this.serialEventMethod = resolveSerialEventMethod(parent);
9594
}
9695

src/main/java/com/yourinventit/processing/android/serial/SerialCommunicatorFacory.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55

66
import processing.core.PApplet;
77
import processing.data.JSONObject;
8-
import android.content.Context;
98
import android.os.Build;
109

1110
/**
12-
*
11+
*
1312
* @author dbaba@yourinventit.com
14-
*
13+
*
1514
*/
1615
public final class SerialCommunicatorFacory {
1716

@@ -39,7 +38,7 @@ private SerialCommunicatorFacory() {
3938

4039
/**
4140
* Configures the serial library.
42-
*
41+
*
4342
* @param json
4443
*/
4544
public void configure(String json) {
@@ -48,7 +47,7 @@ public void configure(String json) {
4847

4948
/**
5049
* Configures the serial library.
51-
*
50+
*
5251
* @param jsonObject
5352
*/
5453
public void configure(JSONObject jsonObject) {
@@ -57,16 +56,12 @@ public void configure(JSONObject jsonObject) {
5756

5857
/**
5958
* Returns a {@link SerialCommunicator} instance specified by the type.
60-
*
59+
*
6160
* @param parent
6261
* @param type
6362
* @return
6463
*/
6564
public SerialCommunicator create(PApplet parent, String type) {
66-
if (!(parent instanceof Context)) {
67-
throw new IllegalArgumentException(
68-
"This library works only on Android.");
69-
}
7065
if ("usb".equalsIgnoreCase(type)) {
7166
return new UsbSerialCommunicator(parent);
7267
} else {

src/main/java/com/yourinventit/processing/android/serial/SerialInputOutputManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ private synchronized State getState() {
106106
* NOTE(mikey): Uses inefficient read/write-with-timeout. TODO(mikey): Read
107107
* asynchronously with {@link UsbRequest#queue(ByteBuffer, int)}
108108
*/
109-
@Override
110109
public void run() {
111110
synchronized (this) {
112111
if (getState() != State.STOPPED) {

src/main/java/com/yourinventit/processing/android/serial/UsbSerialCommunicator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ protected void doStop() {
194194
*
195195
* @see com.yourinventit.processing.android.serial.SerialInputOutputManager.Listener#onNewData(byte[])
196196
*/
197-
@Override
198197
public void onNewData(byte[] data) {
199198
sendBuffer(data);
200199
}
@@ -204,7 +203,6 @@ public void onNewData(byte[] data) {
204203
*
205204
* @see com.yourinventit.processing.android.serial.SerialInputOutputManager.Listener#onRunError(java.lang.Exception)
206205
*/
207-
@Override
208206
public void onRunError(Exception e) {
209207
LOGGER.warn("Exception detected. Restart SerialInputOutputManager.", e);
210208
doStop();

0 commit comments

Comments
 (0)