Comments (11)
Run the sample and send me the log crash please.
from androidasync.
I've only realy tested on Gingerbread+. That's API 9
from androidasync.
After fixing SSLcontext creation in...
public class SSLDataExchange implements DataTransformer, DataExchange
...
static SSLContext ctx;
static {
try {
ctx = SSLContext.getInstance("TLS");
ctx.init(null, null, new SecureRandom());
}
catch (Exception ex) {
}
}
...
I'm struggling to find out why is not working. There is no crash, but also no response.
from androidasync.
Fixed with:
from androidasync.
Verified. Works okey. Thnx!
Still missing other stuff but I will try to implement myself in a forked repo.
- there is only http GET method (probably you just wonder when this issue will popup :) )
- SSL context should be as input parameter (client certificates, different TrustManagers)
from androidasync.
TBH, you probably shouldn't use this library for http yet. It's very rough still. Only the socket library portion is flushed out and battle tested. I'd read the project description :)
Asynchronous socket and http library for android. Based on nio, not threads. Seriously though, you probably don't need this. I wrote it for a Tethering app, where hundreds of threads waiting for data input would crush your phone. Your app won't have those demands.
from androidasync.
Well, I read it and also checked Thethering code with jd-gui to see that only sockets nio is used.
So all http, ssl code is not so tested. But is working for me on some SSL problems client certificates.
Do you have any plans to work on it more?
from androidasync.
There's an Array.copyOf
call in ArrayDeque
that has a dependency on API level 9. API 8 doesn't compile. Perhaps the project.properties should target the android-8 platform to catch any back-incompatibilities?
Would you like me to patch that call for something else? System.arraycopy
? Or will AndroidAsync not support API 8? If that's the case the AndroidManifest.xml
should reflect that by bumping the minSdkVersion
.
Let me know what you'd like me to do @koush.
--- a/android/lib/src/com/koushikdutta/async/ArrayDeque.java
+++ b/android/lib/src/com/koushikdutta/async/ArrayDeque.java
@@ -798,7 +798,7 @@ public class ArrayDeque<E> extends AbstractCollection<E>
try {
@SuppressWarnings("unchecked")
ArrayDeque<E> result = (ArrayDeque<E>) super.clone();
- result.elements = Arrays.copyOf(elements, elements.length);
+ System.arraycopy(elements, 0, result.elements, 0, elements.length);
return result;
} catch (CloneNotSupportedException e) {
Moreover, API 9 got the same ArrayDeque
http://developer.android.com/reference/java/util/ArrayDeque.html so it's either not needed at all, or needs a fix.
Also, that method is never called anywhere in the project so even deleting it works, which is why targeting android-9
with a minSdkVersion
value of 9 will still work on 8. This is still probably incorrect and needs a proper fix.
from androidasync.
@soulseekah Will take a look
from androidasync.
Hm, I don't really support API 8 anymore
http://developer.android.com/about/dashboards/index.html
Only 3.1% footprint. I think I originally added the class for API 8 support, but didn't realize that Arrays.copyOf doesn't work. I'll apply your patch though.
from androidasync.
Agreed on API 8 support, 3.1% is not that much.
You will continue (start) supporting it if you'll accept a patch for the ArrayDeque.
Or bump all minimum versions to API 9 (AndroidManifest.xml) and remove ArrayDeque completely since it's part of the API since verion 9, http://developer.android.com/reference/java/util/ArrayDeque.html
Let me know what you want to do.
from androidasync.
Related Issues (20)
- websocket server will close when receive data in version 3.0.8
- websocket server will block after send big text string HOT 1
- java.net.ConnectException: failed to connect to
- version:3.1.0,AsyncHttpServer not work
- Using AyncDataGram Server to Broadcast data to all clients connected to It
- AsyncNetworkSocket allocator give currentAlloc 0 most of time because of it unable to read and write using AsyncSocket
- 设置返回值code无效,啥情况 HOT 1
- mDataHandler failed to consume data HOT 1
- Callback is not received when network is poor and connection is terminated from other End HOT 1
- Version in the readme is old
- exception when connect to server HOT 1
- Running websocket server in background
- Can not add Http Header HOT 2
- Following the basic websocket example code, but HOT 1
- client got Connection reset by peer error when try to send binary message HOT 2
- Does the library use some Tracking link? HOT 2
- Finf
- How to do server support Multi-Threading and High concurrency HOT 2
- NullPointerException in HybiParser ( version 3.1.0 )
- mp3 with mediaplayer of android can not play over http
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidasync.