Dean Hiller
Dean Hiller

Reputation: 20204

How to use libraries in codename one?

I am wondering about the limitations of using libraries in code name one. Specifically, I would like to use a specific http client library that uses nio but I am not sure if that will even work in code name one. There is an http1 client and an http2 client here

https://github.com/deanhiller/webpieces

Can the nio stuff actually be compiled into iOs? or does it have to be synchronous socket http client implementations?

thanks, Dean

Upvotes: 1

Views: 89

Answers (1)

Shai Almog
Shai Almog

Reputation: 52770

It won't work and you can't. This article is from 2016 but it's still mostly accurate. The gist of it is that most of these APIs aren't essential and if we add all of them performance/size would balloon to huge numbers.

E.g. a Codename One application can weigh less than 3mb for iOS production builds with 32 and 64 bit support. Our closest competitors clock at 50mb for the same functionality with only 64bit support. This isn't just a matter of size, it's a matter of quality (QA), maintenance etc.

This also reduces portability as we have to test this on all ports including iOS, UWP, Web etc.

Having said that we're open to adding things and have added some features to the core since the publication of that article. But either way, you can't just use an arbitrary jar and need to use a cn1lib.

Upvotes: 2

Related Questions