Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android compatibility #75

Open
NLLAPPS opened this issue Jun 3, 2019 · 13 comments
Open

Android compatibility #75

NLLAPPS opened this issue Jun 3, 2019 · 13 comments

Comments

@NLLAPPS
Copy link

NLLAPPS commented Jun 3, 2019

Hi, I am looking in to integrating your SDK in to my app as another cloud service it supports.
However, I am concerned about the following information.

Readme says that "If the content is less than about 2 GB, we read the content into an in-memory array". This might work on a desktop app but would create issues on a mobile phone.

Is there anyway controlling this behaviour? I would prefer providing InputStream or File to the SDK for upload.
Thanks

@certainmagic
Copy link
Contributor

certainmagic commented Jun 3, 2019 via email

@NLLAPPS
Copy link
Author

NLLAPPS commented Jun 3, 2019 via email

@certainmagic
Copy link
Contributor

certainmagic commented Jun 4, 2019 via email

@NLLAPPS
Copy link
Author

NLLAPPS commented Jun 4, 2019 via email

@NLLAPPS
Copy link
Author

NLLAPPS commented Jun 4, 2019

You might also want to have a look at openFileDescriptor. Something like https://gist.github.com/davidliu/dbebbe0a58a5035ecd541b573518c6cf

However, I am not sure if it would work

@certainmagic
Copy link
Contributor

certainmagic commented Jun 4, 2019 via email

@OldSkoolMark
Copy link

Would a configuration option to always use a temporary local File instead of memory buffering work? Or a configurable threshold that determines when to switch from memory to file?

@NLLAPPS
Copy link
Author

NLLAPPS commented Jun 4, 2019 via email

@NLLAPPS
Copy link
Author

NLLAPPS commented Jun 4, 2019 via email

@2fours
Copy link

2fours commented Jul 11, 2019

Even if you don't care about okhttp issues, or use some android repackage of httpclient ala: https://github.com/smarek/httpclient-android, you're still going to have issues as a lot of the date time util and other jdk 8 usages of classes in this b2 official client require API Level 26. Unless you're only supporting Oreo and above (unlikely), this client is unusable on Android.

@certainmagic
Copy link
Contributor

Mark is running an experiment internally using a web client implemented on the normal java UrlConnection classes. (see the urlCxnExperiment branch.)

I'm not enough of an expert on Android to address the date/time class versioning. Maybe @OldSkoolMark to reply to that when he's around next week.

@2fours
Copy link

2fours commented Jul 11, 2019

Using https://github.com/JakeWharton/ThreeTenABP you can work around the java.time issues on older versions of android, leaving the Supplier.get issues but androidx appcompat now has a Supplier implementation. Once you've refactored to use ThreeTenABP, httpclient-android and androidx supplier you're left with a handful of java.util.Map, List, Comparator, Stream, and Base64 issues which should be relatively easy to work around.

b2lint

@certainmagic
Copy link
Contributor

Thanks, 2fours. Your info is spot on. We're looking into maybe supporting old Android API levels.

thanks,
ab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants