Giter Club home page Giter Club logo

Comments (11)

koush avatar koush commented on August 28, 2024

Run the sample and send me the log crash please.

from androidasync.

koush avatar koush commented on August 28, 2024

I've only realy tested on Gingerbread+. That's API 9

from androidasync.

dragom avatar dragom commented on August 28, 2024

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.

koush avatar koush commented on August 28, 2024

Fixed with:

bc96ad9

from androidasync.

dragom avatar dragom commented on August 28, 2024

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.

koush avatar koush commented on August 28, 2024

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.

dragom avatar dragom commented on August 28, 2024

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.

soulseekah avatar soulseekah commented on August 28, 2024

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.

koush avatar koush commented on August 28, 2024

@soulseekah Will take a look

from androidasync.

koush avatar koush commented on August 28, 2024

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.

soulseekah avatar soulseekah commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.