B4A Library EasyAR (Augmented Reality) Library

walterf25

Expert
Licensed User
Hello everyone, I would like to introduce this Beta version of my B4AEasyAR Library, i have been trying to wrap an AR Library for some months now but have came across some issues while wrapping some of the functions.
I read a post by someone about EasyAR, spent some time looking at the documentation and examples and decided to give it a try, i finally have something that works good and wanted to share it with everyone, please keep in mind that I am not a Java expert, however i am taking an advanced Java class in college along with Python and iOS.

Ok, in order to be able to use this library you will need to register for an account at EasyAR website once you have signed up, you can login and you will need to create an SDK License key.
create_license.PNG
Just click on the Add SDK License Key button, you will be prompted to choose what type of license key you need to generate, Select EasyAR SDK Basic option, next you will need to enter your App's name, then go ahead and Select Android for Supported Platform and lastly you need to enter the same package name you used when creating your application.
app_info.PNG
Once the SDK key is generated you will be able to see it by clicking on the Name of the application created, copy and save your key as you will need it.

I have attached a very simple example which is the very same example that comes with their SDK, what the app does is that it tracks two different images and renders a 3D cube on top of the image, as i mentioned this is a very simple example but just imagine the possibilities.

I have also attached a small video i made showing the app in action, the bxRenderer class is where all the magic happens and it an be modified to your taste granted that you are familiar with OpenGL.

I am using @agraham OpenGL2.0 library, i was almost half way wrapping the OpenGL2.0 library when i realized that it had already been done for us in the forums by @agraham so a big thanks to him for his hard work, it truly saved me lots of time, i added a few functions to his library that were needed with EasyAR library, i have sent him the updated OpenGL2.0 version 1.5 library for him to upload it to his original thread.

B4AEasyAR library uses your device's camera to track certain images that you can upload either to your device or the cloud, currently i have not wrapped any of the functions to be able to recognize images uploaded to the cloud.

I suggest you guys do some research on your own about the capabilities of this SDK, this will be an ongoing effort to maintain this library updated, I think it was definitely time that a library like this was needed in our forums.

For now I will only upload the jar and xml file, you will need to download the SDK once you are signed up with EasyAR.com and copy the EasyAR.jar file that comes with the SDK and paste it into your additional library folder.

Please test the attached APK file, and let me know what device and android version you guys test on, and of course post any problems or suggestions you come across.

The Library files can be downloaded from here.
Updated Library version 1.04 can be downloaded from here
Check this post to get the context of the newer version
The APK File can be downloaded from here.

Updated the APK file, now you can see two examples, the Basic Example and a more advanced which renders a Video on top of the tracked images, there are 3 different images the app will render a different video depending on the image tracked, two of the videos are stored in the local storage and a third video is streamed which is why it may take a little longer to start playing. Also uploaded a new video demonstrating how it works.

UPDATE
I am releasing the Source code of the Examples i have already shown, plus two more examples, one using a custom camera class which uses the Android Camera class and Surface Tracker example.
I am also attaching the documentation for the library, the library is also being updated as I have added a few more things to it.

Library files have also been updated 10/10/2019

Library Documentation can be downloaded from
here
Examples Source Code


You will need to either print out a copy of the two images being used in this example to test the app or just open them up on your laptop and point the camera to the image on your screen, either way will work fine.
idback.jpg namecard.jpgargame00.jpg

and lastly here's the video I made to show the app in action.

Please Donate if you guys find this library useful, i have spent a lot of hours and I will keep this library updated as necessary, your donations will keep me motivated to continue maintaining this library.

Thanks all, can't wait to see what type of apps can be created with this new Library.
 
Last edited:

peacemaker

Well-Known Member
Licensed User
Wow !
Example APK works OK (over both base images) on Samsung A7 (2017) Android 8.0.

Very interesting to try the lib (and donate a bit later), but, it seems, no ready code example yet.
 

walterf25

Expert
Licensed User
Wow !
Example APK works OK (over both base images) on Samsung A7 (2017) Android 8.0.

Very interesting to try the lib (and donate a bit later), but, it seems, no ready code example yet.
Glad to know the example apk works good for you, code example is ready but want to prepare a few more examples before releasing the actual B4A code.

Walter
 

walterf25

Expert
Licensed User
Updated the first post, updated the apk to demonstrate the basic example and a more advanced by rendering videos on top of the tracked images, Please test and let me know if you guys have any issues.

Walter
 

bluedude

Well-Known Member
Licensed User
All cool but I need a sample to track an image and load the video. Cannot do anything with the .apk. Do you have the source for this .apk?
 

walterf25

Expert
Licensed User
All cool but I need a sample to track an image and load the video. Cannot do anything with the .apk. Do you have the source for this .apk?
I do have the source code, but i am not releasing it yet, this is a very big and complicated library and i am still wrapping a lot of the classes. this apk i have posted works with only of a few of the classes wrapped.

Walter
 

DaniDPX

Member
Licensed User
@walterf25 Awesome work you’ve done! I’ve been looking for an AR/VR library for a while and finally I got 1 working lib. Can’t wait to integrate it with my app.

[update] when are you planning to release examples?
 
Last edited:

walterf25

Expert
Licensed User
Updated the Library files, I have also posted a link to the Examples source code and the libraries documentation as well.

Walter
 

walterf25

Expert
Licensed User

Johan Hormaza

Well-Known Member
Licensed User
** Activity (main) Pause, UserClosed = false **
** Activity (surfacetrackingactivity) Create, isFirst = true **
** Activity (surfacetrackingactivity) Resume **
permission granted...
engine has been initialized: true
surfacetrackerar_vvv5 (java line: 210)
java.lang.InstantiationException: java.lang.Class<cn.easyar.OutputFrame> has no zero argument constructor
at java.lang.Class.newInstance(Native Method)
at com.genesis.easyAR.OutputFrameWrapper.Initialize(OutputFrameWrapper.java:24)
at com.genesis.easyar.surfacetrackerar._vvv5(surfacetrackerar.java:210)
at com.genesis.easyar.surfacetrackingactivity._glsurface_draw(surfacetrackingactivity.java:496)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.agraham.opengl2.GLWrapper2$GLSurfaceViewWrapper2$myRenderer.onDrawFrame(GLWrapper2.java:1734)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1553)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)
 

walterf25

Expert
Licensed User
** Activity (main) Pause, UserClosed = false **
** Activity (surfacetrackingactivity) Create, isFirst = true **
** Activity (surfacetrackingactivity) Resume **
permission granted...
engine has been initialized: true
surfacetrackerar_vvv5 (java line: 210)
java.lang.InstantiationException: java.lang.Class<cn.easyar.OutputFrame> has no zero argument constructor
at java.lang.Class.newInstance(Native Method)
at com.genesis.easyAR.OutputFrameWrapper.Initialize(OutputFrameWrapper.java:24)
at com.genesis.easyar.surfacetrackerar._vvv5(surfacetrackerar.java:210)
at com.genesis.easyar.surfacetrackingactivity._glsurface_draw(surfacetrackingactivity.java:496)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.agraham.opengl2.GLWrapper2$GLSurfaceViewWrapper2$myRenderer.onDrawFrame(GLWrapper2.java:1734)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1553)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253)
Are you running in Release Mode or Debug mode?
 

walterf25

Expert
Licensed User
Are you using the latest Lib 1.01, and have you downloaded the EasyAR Jar file from their website and added it to the Additional Libraries folder?

Walter
 

peacemaker

Well-Known Member
Licensed User
Walter, please, publish all B4A depending libs versions, to be sure.
 

walterf25

Expert
Licensed User
Yes, I downloaded the 1.01 library, but I downloaded it from EasyAR.jar from this place https://www.b4x.com/android/forum/threads/can-i-convert-easyar-jar-to-b4a-and- b4i-lib.109326 /
Does the APK example i posted work for you?

I just tested here again and i don't see that problem, i would suggest you register at https://www.easyar.com/ follow the instructions in the first post to create an App and receive your own License key.

Can you post the full Logs please?
Walter
 
Top