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: Issues · cinder/Cinder · GitHub

  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.

2 Likes

Hi @no_other_alias, I was wondering if you made any progress since your last post. I may be possibly in the process of updating a rather old iOS app of mine and I’d like to port it to Android. I’m not too much of an expert in build systems but I’m very happy to help with testing things out.

Hey there, progress is slow but ongoing. I’m afraid it will be a while before you can port iOS Cinder code directly to Android - my main focus is just to get Cinder working reliable on modern Android devices at all.

If you’ve got a github link for your app I can have a look at it and we can collaborate?

Hi, thanks! I don’t have the code out publicly yet, I want to do a bunch of housecleaning before I release it. At the moment I’m working on porting the audio part from iOS AudioUnits to a libPD-based solution, and I’m also working on separating as much as I can the C++ part from the Objective-C part. Only then I will even start looking at the Android porting.

A few years ago I remember trying out one of the samples that ship with Cinder in the Android branch (is it still where things are happening?) and it worked fairly well on my Android phone, but then again it wasn’t a very sophisticated app – I can’t remember which one it was but touch and drawing worked fairly well.

Anyway, I’ll keep an eye on your good work and jump back as soon as I can make my move into Android territory – hopefully soon!

Housecleaning is the enemy of progress. I promise not to make fun of your work! We’re not talking about release, just migration strategy. If you’d like to send it privately to me that would be great.

@no_other_alias you’re probably right :slight_smile: Anyway, I got embroiled in a bit of refactoring that I can’t easily get out of so I guess I’m going to share what I have so far. I’m currently working on the libpd branch at the moment. Once I complete that transition and manage to isolate Obj-C as much as possible, I can then start transitioning towards Android. Feel free to take a look at this meanwhile.

1 Like

Will do! Have a great weekend.

Hi guys, some good news today, bitrise have agreed to provide a free CI integration for the Cinder Android stuff. It also runs tests on Windows and OS X, as well as iOS, so it will be useful to the Cinder Dev team in general going forward. There’s probably quite a lot of work to do on modernizing the test suite, which I am looking into starting next week, but just to give you a sense of where I’m planning on taking this, I’ve recorded this short (2 min) screencast.

Have a `Preformatted text`
2 Likes

@no_other_alias I really appreciate your work on the Android build. Thanks. I cannot see your screencast, though. Are you sure it was linked/embedded properly?

Sorry about that - looks like a problem with discourse / vimeo. I am doing some work now on the CI stuff, I’m going to do a new screencast as soon as there’s a bit more going on in the pipeline - at the moment the build just kicks off and fails because of the unit tests.

2 Likes