openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.83k stars 2.56k forks source link

Android: Bump min API level requirement #4505

Open HalfdanJ opened 8 years ago

HalfdanJ commented 8 years ago

Currently we are having a min api requirement of api level 8. Thats Android 2.2 (Froyo). Can we bump this up a bit? Currently only 0.3% of android phones are running Froyo :)

I'm not sure what a reasonable API requirement would be, i would prefer something very recent like 21, but more realistically 16 (Jelly Bean) or 19 (Kit Kat that has the largest market share).

The reason for doing this is to be able to use some more modern apis, specifically i'm having trouble with the camera code right now.

ofZach commented 8 years ago

+1 to this, on osx / ios we tend support 2-3 versions of the api, sometimes a bit more (ie, OS 10.11, 10.10, 10.9...) for exactly this reason, it would be good to do here as well.

HalfdanJ commented 8 years ago

Then the question is how to count that in android.. http://developer.android.com/guide/topics/manifest/uses-sdk-element.html I would say 3 versions back is Kit Kat (Android 4.4, API 19)

arturoc commented 8 years ago

i haven't incremented the version since the beginning cause there's been no need since then. sometimes i've added support for new apis but in java you can use introspection to know if an api is present or not and only call it conditionally and through introspection not direct calls.

that kind of code is really unreadable though so i've only used it for relatively small things like a feature in the camera where there's only 1 call that is done like that.

if we want to use a whole class like camera2 then it doesn't make sense to use introspection all over.

i guess we can just use the api level that whatever feature we want to use needs.

i would support 4.0 if possible (if camera2 is already supported there)

arturoc commented 8 years ago

actually i'm checking and camera2 is not supported until 5.0 which is pretty new. i would wait to implement it unless we can do it in a way were we can fallback to camera if camera2 is not supported

HalfdanJ commented 8 years ago

Yes, camera2 is a bit to new, but there are other changes that would make life easier. For example is surface texture introduced in 11, right now there is a lot of hard to read code around it that would be great to remove.