What's the state of Cinder for Android?

Hi :slight_smile:

I have a 9k LOC Cinder app that works perfectly on Windows.

I’d like to port it to Android now, while still using Cinder. Would that be wise?

More specifically:

  • Any missing features that I’m gonna bump into? or,
  • Any serious bugs?
  • Would it be hard to make my app fit Android’s UI conventions?
  • Does the camera API work well? Including access to Android’s “Camera2” api

TIA :slight_smile:
Stefan

Hi Stefan,

I used the Android port recently. In my opinion it’s still experimental. You can count on it that you will encounter issues. I only did things that I would normally do from Cinder, no special Android stuff. It works ok, but not as fluent as it is on other plafroms. Probably there are not many Android Cinder users at the moment, so it’s also a bit difficult to get help if you are stuck. On the other hand, it’s quite convenient that your Cinder code can run on Android with some effort. It’s probably much less work than rewriting the whole code in some other environment.

-Gabor

1 Like

I basically agree with Gabor - things are certainly possible with Cinder on Android, but there is work to be done there by the developer, especially around the build and debug environment. The thing is that the original port and subsequent projects (which were funded) were multiple years ago now, and there currently isn’t much support for regular core contributors. Contributions like these would be very welcome. :slight_smile:. Currently, we really need a big update on the build system since it has changed so much over the years.

All in all, most of the cinder codebase is cross platform and designed to be easy to get up and running on whatever platform is necessary, so porting a Windows application to Android shouldn’t be a very difficult task for any seasoned developer… especially those that are already experienced with developing native applications on Android.

cheers,
Rich

1 Like

Hey guys. I might be in a position to help out a little with this as I’ve worked on some native C++ projects in Android recently.

I have a few questions:

1: Where is the most recent version of Cinder for Android? Have all the different versions been consolidated into one place? I’d like to have a look at the build process.
2: Do we have a centralized repository of outstanding issues?
3. Does the removal of boost as a dependency significantly lower the barriers to getting this working?
4: Is there a roadmap for the Camera API? It seems that a lot of cinder apps could benefit from ARCore support etc. and it would definitely be good to be able to share code between Android and Windows apps.
5: What are the main obstacles that you can see to getting this working?

Hi @no_other_alias, perhaps I can help answer a few of these questions, although I’m pretty far out of the cinder android loop. In any event, glad that you’re willing / able to tackle some of this stuff! The project could really use more android experts.

1: Where is the most recent version of Cinder for Android? Have all the different versions been consolidated into one place? I’d like to have a look at the build process.

I think the official cinder master branch is mostly latest, although the build system is way out of date. When the original android port was completed, Android Studio barely supported C++ and a custom solution was created as workaround. There’re probably breadcrumbs on this forum of different folks who have gotten things to work despite this, and there is this open pull request that we should have but haven’t yet managed to get merged. Perhaps this is the best place to start, although maybe even things have changed since this time.

2: Do we have a centralized repository of outstanding issues?

This is probably the best, although perhaps a bit dated now: https://github.com/cinder/cinder/issues?q=is%3Aopen+is%3Aissue+label%3Aandroid

  1. Does the removal of boost as a dependency significantly lower the barriers to getting this working?

I think so, if can we remove boost with the latest clang versions in the android ndk. Does it support C++17 / <filesystem> . <system> now?

4: Is there a roadmap for the Camera API? It seems that a lot of cinder apps could benefit from ARCore support etc. and it would definitely be good to be able to share code between Android and Windows apps.

I think this is open to those who have experience here, what is most reliable, efficient and widely usable.

5: What are the main obstacles that you can see to getting this working?

Probably getting the build system updated. I also think that debugging support was a huge issue when I worked on an android port years ago, which I think is related (my issues were largely because we were using the custom build tools, so we have minimal debugger integration).

cheers,
Rich

https://developer.android.com/ndk/guides/cpp-support

With boost gone and C++17 supported in master, the path to an Android build should be a bit smoother now.

1 Like

Yeah, I have a bit of spare time to work on this, anyone else wanna pitch in?

So, with regard to the build system - that has completely changed since NDK17.

In terms of build configs, I am thinking that getting the Linux build working first makes sense, because it’s usually easier to add in OSX & Windows support to that than vice versa.

Is there any documentation for the existing Android code in master? What kind of state is it in? I’m noticing there are some .groovy build scripts, I’ll try to get those working first and see where we are.

OK, so as far as I can tell, the build system really should be completely redone. While I am in awe of the ingenuity of writing a custom gradle plugin as a workaround, I think it should be possible using NDK21 to use a much more standard approach now, using Android studio / CLion.

I am going to setup a Linux VM as a build server, so that the configuration can be shared and kept consistent, if anyone is interested I’d be happy to collaborate.

With regard to Linux distros, there are some issues with using Ubuntu as the graphic drivers that ship with it are non-standard and cause issues with Vulkan and NVIDIA hardware. A slightly better option is Kubuntu, a combined Ubuntu/KDE distro, which uses KDE/KVM for the graphics pipelines and windowing servers, which means it supports Android Studio emulators out of the box and is much easier to configure than regular Ubuntu.

https://kubuntu.org/news/kubuntu-19-10-is-released-today/

I think if the Linux stuff works, it should be easy to get everything else working afterwards.

In response to OP, I would prioritize fixing the Camera stuff, as it is not super reliable, there are already some open issues in git about it.

This is probably a JNI / threading issue, I’ll look into it once I get a build system working.

1 Like