Skip to content

Commit 99cada0

Browse files
committed
use api v1.1.0.
1 parent 8084846 commit 99cada0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ To install the library add:
1414
maven { url "https://jitpack.io" }
1515
}
1616
dependencies {
17-
compile 'com.github.webee:fastjson-json-api-android:v1.0.0'
17+
compile 'com.github.webee:fastjson-json-api-android:v1.1.0'
1818
}
1919
```

fastjson-json-api-android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
})
3333
compile 'com.android.support:appcompat-v7:24.2.1'
3434
compile 'com.alibaba:fastjson:1.1.55.android'
35-
compile 'com.github.webee:java-json-api:v1.0.0'
35+
compile 'com.github.webee:java-json-api:v1.1.0'
3636
testCompile 'junit:junit:4.12'
3737
}
3838

fastjson-json-api-android/src/main/java/com/github/webee/fastjson/fastjsonJSON.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ public com.github.webee.json.JSONArray newArray() {
1515
return new JSONArray(new com.alibaba.fastjson.JSONArray());
1616
}
1717

18+
@Override
19+
public Object parse(String text) {
20+
return com.alibaba.fastjson.JSON.parse(text);
21+
}
22+
1823
@Override
1924
public com.github.webee.json.JSONObject parseObject(String text) {
2025
return new JSONObject(com.alibaba.fastjson.JSON.parseObject(text));

fastjson-json-api-android/src/test/java/com/github/webee/fastjson/JSONTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,13 @@ public void testDecoding() {
3737

3838
System.out.println(jsonObject.toJSONString());
3939
}
40+
41+
@Test
42+
public void test() {
43+
JSON json = new fastjsonJSON();
44+
JSONObject jsonObject = json.newObject();
45+
46+
jsonObject.set("key", "中国\uD83D\uDE00");
47+
System.out.println(jsonObject.toJSONString());
48+
}
4049
}

0 commit comments

Comments
 (0)