tctr / openFrameworks

OpenFrameworks is a cross platform open source toolkit for creative coding in C++.

Home Page:http://openframeworks.cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this repo and branch Android_fixes_thierry ?

This is a fork of Dan Rosser (@danoli3) own fork of openFrameworks https://github.com/danoli3/openFrameworks that I've used to experiment with OF on Android with modern Android tools. Dan has indeed rearchitectured the way the OF build for Android can be done.

Default branch is Android_fixes_thierry, starting from Dan's Android_fixes.

I added :

  • a few corrections and completions
  • a composite example under (examples/Android) which works on my Android phone
  • the binaries of the initial libs used by OF (boost, freeimage, openCV...)

I have added these binaries for convenience because current download_libs.sh under scripts/android does not fully work and I had to manually include some the binaries in the right places with the right names. That will need to be fixed.

Building openFrameworks Android lib and composite example

The composite example includes ofShaderExample ofSoundPlayerExample ofSoundStreamExample. It was constructed starting by manually copying the following project : scripts/template/android under example/android. ProjectGenerator was not used.

To make a build, start by building the openFrameworks lib for Android by :

  • opening the following project in Android Studio : libs/openFrameworksCompiled/project/android
  • gradle starts to configure the project
  • launch Build / make module android.openframeworksAndroid
  • if gradle stops asking for another version of Gradle JDK do as stated below and sync
  • rebuild
  • libopenFrameworksAndroid.so binaries are created for arm64-v8a - armeabi-v7a - x86 in libs/openFrameworksCompiled/lib/android

Changing the version of the Gradle JDK : in Settings / Build, Execution, Deployment / Build Tools / Gradle (I use the JetBrains 17.0.6 version).

It is then possible to build the example and generate the corresponding APK / bundle by :

  • opening examples/android/androidCompositeExample in Android Studio
  • in the Android view : select build / make module androidCompositeExample.ofApp
  • then launch build / build bundle / apk / your choice to generate an apk or a bundle in ofApp/build/output
  • with a connected device you can upload and lauch the app

Additional examples : how to

To build additional examples modify with your destination directory and launch the following file : ./scripts/android/create_hierarchy_emptyExample.sh

This creates the file hierarchy needed to build Android example using CMake and Android Studio.

Then :

  • replace the app files ofApp.h ofApp.cpp eventually main.cpp
  • change the name of the app in ofApp/src/amin/res/values*/strings.xml
  • change the application ID in ofApp/build.gradle => example :
defaultConfig {
       applicationId "cc.openframeworks.androidCameraExample"  // IMPORTANT : THIS DEFINES THE ID OF THE APK
  • change android permissions in AndroidManifest.xml
  • Add additional include and cpp files in CMakeLists.txt as well as links to additional lib binaries if necessary (see androidOfxSoundObject example)
  • in androidOfxSoundObject example, I had to link to GLES1 instead of GLES2 in CMakeLists.txt
  • change Java activity if necessary

Built and tested examples so far as of today (2024/06/20)

  • androidEmptyExample
  • androidCompositeExample : mixes androidShaderExample androidSoundPlayerExample androidSoundStreamExample
  • androidCameraExample
  • androidOfxSoundObject with ofxSoundObjects addon
  • androidOpenCVExample
  • androidOpenCVFaceExample

Special case : ofxOpenCv examples

For ofxOpenCv I created an Android Studio project in addons/ofxOpenCv/android which generates a libofxOpenCVAndroid.so lib in addons/ofxOpenCv/libs/android for arm64-v8a and armeabi-v7a. This project replicates the solution that Dan @danoli3 uses to generate the libopenFrameworksAndroid.so

libofxOpenCVAndroid.so can be linked in all openCV examples without recompiling it each time.

In CMake I don't use the find_package(OPENCV) instructions but build straight from the opencv lib folders under ofxOpenCv. I generated the libs using apocathery. Here is a small howto for those interested building_opencv_for_android.

Tests and Play Store

  • The version of Android Studio that I have used is Android Studio Flamingo | 2022.2.1 Patch 1

  • That was tested on a Xiaomi MI lite 10 from 2020, runnning Android 10, SDK 29.

  • I managed to upload a demo app for internal testing on the Play Store com.tctr.marscollege. I still have one last accessibility warning, but that's the only one. App is doing ok on different kind of devices.

openFrameworks is a C++ toolkit for creative coding. If you are new to OF, welcome!

Build status

  • The master branch contains the newest, most recently updated code. This code is packaged and available for download in the "Nightly Builds" section of openframeworks.cc/download.
  • The stable branch contains the code corresponding to the last stable openFrameworks release. This stable code is packaged and available for download at openframeworks.cc/download.
Platform Master branch Stable branch
Windows MSYS2 Build status Build status
Windows Visual Studio Build status Build status
Linux 64 & Arm Linux Build Status Linux Build Status
Emscripten Emscripten Build Status Emscripten Build Status
macos macos Build Status macos Build Status
iOS & tvOS iOS tvOS Build Status iOS tvOS Build Status

folder structure

This release of OF comes with several folders:

  • addons
  • apps
  • docs
  • examples
  • export (on some systems)
  • libs
  • other
  • scripts
  • projectGenerator

docs has some documentation around OF usage, per platform things to consider, etc. You should definitely take a look in there; for example, if you are on OSX, read the osx.md. apps and examples are where projects go -- examples contains a variety of projects that show you how to use OF, and apps is where your own projects will go. libs contains the libraries that OF uses, including the openframeworks core itself. addons are for additional functionality that's not part of the core. export is for DLLs and dylibs that need to be put in each compiled project. The scripts folder has the templates and small scripts for automating OF per platform. project generator is a GUI based tool for making new projects - this folder is only there in packaged releases.

One idea that's important is that OF releases are designed to be self-contained. You can put them anywhere on your hard drive, but it's not possible to mix different releases of OF together, so please keep each release (0.8.0, 0.8.1) separate. Projects may generally work from release to release, but this is not guaranteed. Because OF is self-contained, there's extensive use of local file paths (ie, ../../../) throughout OF. It's important to be aware of how directories are structured. A common error is to take a project and move it so that it's a level below or above where it used to be compared to the root of OF. This means that links such as ../../../libs will break.

Get involved

The openframeworks forum:

http://forum.openframeworks.cc/

is a warm and friendly place. Please ask or answer a question. The most important part of this project is that it's a community, more than just a tool, so please join us! Also, this is free software, and we learn so much about what is hard, what doesn't make sense, what is useful, etc. The most basic questions are acceptable here! Don't worry, just join the conversation. Learning in OF is social, it's hard to do it alone, but together we can get far!

Our GitHub site is active:

https://github.com/openframeworks/openFrameworks

if you have bugs or feature requests, consider opening an issue. If you are a developer and want to help, pull requests are warmly welcome. Please read the contributing guide for guidelines:

https://github.com/openframeworks/openFrameworks/blob/master/CONTRIBUTING.md

We also have a developer's mailing list, which is useful for discussing issues around the development and future of OF.

Developers

To grab a copy of openFrameworks for your platform, check the download page on the main site.

If you are working with the Git repository, the stable branch of the OF repository corresponds to the most recent release, with a few important differences:

  1. The release includes a simple openFrameworks project generator.
  2. This GitHub repository contains code and libs for all the platforms, but the releases are done on a per-platform basis.
  3. This GitHub repository has no project files for the different examples. They are generated automatically for each release using a tool in apps/projectGenerator/.
  4. There are no external dependencies in this repository, you can download them using the download_libs.sh script for each platform in the particular platform folder inside scripts.

If you want to work with the openFrameworks GitHub repository, you need to download the external dependencies and you should use the project generator to create project files for all the code in examples/. To generate the project files with the project generator enable the 'Advanced Options' in the settings tab, then use 'Update Multiple' to update the projects for the examples/ folder path in the repo.

To set up the project generator submodule within the OF repo, use the command git submodule init then git submodule update whilst inside the openFrameworks repo.

For more info on working with the Project Generator, for per-platform readmes, and more information, see the documentation.

Versioning

openFrameworks uses Semantic Versioning, although strict adherence will only come into effect at version 1.0.0.

About

OpenFrameworks is a cross platform open source toolkit for creative coding in C++.

http://openframeworks.cc

License:Other


Languages

Language:C++ 80.7%Language:C 13.7%Language:Makefile 1.4%Language:Objective-C++ 1.1%Language:Java 1.0%Language:Objective-C 0.7%Language:Shell 0.6%Language:GLSL 0.3%Language:QML 0.2%Language:CMake 0.1%Language:JavaScript 0.1%Language:CSS 0.1%Language:HTML 0.0%Language:Batchfile 0.0%Language:PowerShell 0.0%Language:Python 0.0%Language:Perl 0.0%