Hi @sgold , on your request for new features for jme 3.4 & bug fixes ,i have read through the guidelines for new contributors & thought to create this thread to fix 3 similar bugs.
when i was navigating android related issues at the git repo found those 3 similar bugs:
i already fixed those , although i categorize them to be not really bugs , but i have introduced better approaches , better coding styles & more features .
The Old approach :
com.android.Fragment classes which blocks the user from engaging those instances inside other android services , plus , it’s deprecated.
GLSurfaceView on a
FrameLayout then add that frameLayout as the
com.android.Activity layout(instead of using xml
setContentView(R.layout.activity);) which blocks the user from using other
android.view.View components which really cancels out a powerful default native android feature.
→ creates confusion in using it , really no one knows the purpose of a whole class for rendering , that really shouldn’t be the case.
The new approach :
→ introduces a new feature to jme android that basically utilizes jme as a Component UI (GLSurfaceView) instead of utilizing the whole activity of rendering .
–>Fixes the incompatibility between
AndroidHarness & androidx packages when trying to refer to the AndroidHarness instance from another source.
–>Fixes the confusion that happens from multiple class usages throughout the game cycle, now you can code your pc game normally as
SimpleApplication class with or w/o
AbstractControls,etc & one additional class which is your regular
com.androidx.AppCompatActivity that’s basically created by the default android SDK & loaded inside
Manifest.xml , that
com.androidx.AppCompatActivity would basically hold
JmeSurfaceView that’s a UI component like a button but it holds the powerful renderer
GLSurfaceView & with that
SimpleApplication instance can be passed & the game would be engaged by the help of
SystemListener interface to that gets its methods called within
OGLESContext to initialize
GLRenderer for your game.
→ By this new approach you can render jme on an
com.androidx.AppCompatActivity activity or
com.android.Activity or on
com.android.Fragment , it depends upon in what the user willl use his/her xml layout file.
→ Notice , never uses the whole android activity or fragment for one UI component , without using android
Permissions services &
The idea in more depth : (March 2021) Monthly WIP Screenshot Thread
I donot say that we are going to replace
Androidharness , no , because there’s already jme devs that are still using it , so that will break their code , i am just introducing new feature with git issues fixes.
let me know your feedback , your thoughts , your fears & etc ,
Through reading some of the issues that were fixed along the issues tab , found that TestCases are strongly required , so currently there are 2 proves or TestCases , the game demo which i pasted from
jme.examples & the
Advanced Vehicles project has been converted to android.
I would also convert my
J-Pluto Arcade game into android using the same approach.
Thanks for paying attention .