mkuklis / phonegap-websocket

Websocket PhoneGap plugin for Android
203 stars 78 forks source link

Java String constructor not supported on Gingerbread #25

Closed MayurChandra closed 10 years ago

MayurChandra commented 10 years ago

In function public void onFragment(Framedata frame)

The line below is not supported on Gingerbread and throws error as the constructor for String is supported only on API Level 9 and above. Would be good to fix this. Otherwise excellent. Thanks.

this.onMessage(new String( bytes.array(), Charset.forName("UTF-8") ));

MayurChandra commented 10 years ago

On further debugging it seems Uint8Array is not supported on Android 2.x

My app has min-SDK=10 and this code fails trying to call Uint8Array

Is there a substitute for this which will run on API 10?

mkuklis commented 10 years ago

@MayurChandra will look into it. @dhuyvett is this something you could help with?

eliseumds commented 10 years ago

@MayurChandra can you create another issue for the Uint8Array problem? Besides, give more suggestive titles to them... for example, you could entitle this one as "Java String constructor not supported on Gingerbread".

Can you try a TypedArray polyfill for the last issue?

Thanks!

mkuklis commented 10 years ago

@eliseumds thank you for jumping in!

MayurChandra commented 10 years ago

@mkuklis @eliseumds OK creating another issue now. Thanks

dhuyvett commented 10 years ago

@mkuklis #27 addressed this issue also. This should be OK to close.

mkuklis commented 10 years ago

@dhuyvett Thanks!