How to create an OpenGL live wallpaper? - java

I'm trying to find the right approach for creating an Android OpenGL live wallpaper i.e. a way to convert an app written to use GLSurfaceView into a live wallpaper. There appears to be nothing in the official Android documentation about this surprisingly and it's not obvious what to do.
I've found a few discussions about this elsewhere where most end up linking to the following code written an Android developer:
http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers
However, the comments on the page suggest there are problems with the code (memory leaks, lock ups). Does anyone know of any alternatives? If I upload a wallpaper to the market, I'd obviously like to avoid complaints caused by buggy code.

I found an open source example that may help you.
http://code.google.com/p/android-deep-wallpaper/
also, it looks like to use open GL, the GL ES code needs to be called from a different thread.
hope this helps :D

There is a library for building OpenGL Live Wallpapers for Android called GLWallpaperService. You can find GLWallpaperService on GitHub. It includes the code you linked to on rbgrn.net but with a few bug fixes included. There are some alternate implementations available as well. Good luck.

Related

Sceneform: Render WebRTC media stream in to ExternalTexture

I am trying to develop an AR app to help visual impaired people to make better their access conditions to a computer.
I am investigating on how AR can help HCI for visual disabilities, so, the application is using WebRTC to get computer Desktop to be magnified at AR environment using Sceneform.
I have successfully used the Sceneform example https://github.com/google-ar/sceneform-android-sdk/tree/master/samples/chromakeyvideo, but, I have no idea of how to render the WebRTC stream directly to a ExternalTexture. -> https://github.com/judicapo/MUITSS-ARBE/tree/master/SampleApps/ARCK
I already tried some Stackoverflow answers, but, have not found the clue.
Thank you all for your replies, hope some one has any idea.
Honestly I have not worked with this. but I could think of a way on how to approach this.
Instead of chromaKey rendering on a texture, why don't you try a 'ViewRenderable'? using this, you can place any android View to a node. You just need to place a VideoView and do your webRTC magic. let me know if this works
https://developers.google.com/ar/reference/java/sceneform/reference/com/google/ar/sceneform/rendering/ViewRenderable
https://developers.google.com/ar/develop/java/sceneform/create-renderables
AugmentedImage example - https://proandroiddev.com/arcore-sceneform-simple-video-playback-3fe2f909bfbc
ViewRenderable example - https://github.com/Hariofspades/ARExperiments/blob/master/AugmentedImages/app/src/main/java/com/hariofspades/augmentedimages/common/AugmentedImageNode.java

How can I do face recognition of two images using opencv java in android

I'm trying to create a face recognition application in android studio in java language. I spent considerable amount of time, searching for step by step guides for achieving this function. I found many tutorials for python language and i couldn't find any proper tutorial or atleast a video tutorial for java.
Can someone please provide me with a proper link with the steps to do face recognition with OpenCv in android using java language.
I'm new to OpenCv, so i have no big idea on its functions.
Your help is highly appreciated
Update 1 ::
I'm trying to capture the image of the user and then cross check the taken image with an image that is already available in the gallery.
I want to know if both are the same so that i can allow the user to use the application.
I actually made a Java program that utilised OpenCV for facial recognition earlier this year.
For me it was an utter nightmare. Guides to doing this on Java are basically nonexistent and the documentation for Java OpenCV is very poor.
What I ended up doing to get to grips with OpenCV was I used PyImageSearch to learn how OpenCV works and then just trawled through the OpenCV javadocs until I found the most similar classes to what was being used in PyImageSearch.
There are a few guides for OpenCV recognition using Java (I'll have a look through my notes when I get a chance and see if I saved any links for my own reference) but none of them were for what I needed.
If you edit your post with some more information on the recognition you're trying to do (video or jpeg or png?; frontal faces or side faces?; specific faces or faces in general?) I may be able to help a little more.
The Youtube link that #Varma posted might help you get to grips with OpenCV as a whole, but that series doesn't seem to cover facial recognition.
EDIT #1
Okay, recognising who someone is via an image is definitely doable with OpenCV, but it's not something I've done. Here's a PyImageSearch page on how to do it in Python. The methodology for doing it in Java with OpenCV will most likely be more or less the same even thought the syntax will - of course - make it look very different (should mostly be a matter of finding the equivalent Java classes and methods).
If it proves difficult, there are alternatives to OpenCV you could use, like these or Google's API. Keep in mind though that facial recognition is not very secure and does come with some controversy.

3d effects in android and Iphone

We have a lot of days of research but can't find a solution for the following project. We need to convert a flux project to IOS and android native app. But as flux supports flash scripting it has easily implementing some 3d effects like shadow, emboss gradient etc. Please check the link here for seeing the swf file we have. We need to convert all this features into a native IOS and android app. We have research some area and found that most of the item we can implement except one icon here. The fourth icon have some 3d effects, shadow effects, border, emboss, contour and gradient etc. Can anybody check on this and guide us whether this can be implemented in IOS and android. I am pasting the entire url here again http://projects.zoondia.org/signfabcreator/signCreator.swf. Please check and let me know if this is possible. Let me if this is possible or not. If yes it will be helpful for me if anybody can give me a clue about implementing those in both android and ios
Very interesting! But I'm afraid you have to reimplement all this functionality by yourself. Don't be upset. There are good news for you - OpenGL ES and GLSL are extremely portable. So you can reuse 100% of your shaders. What is even better now you can share the other code too and stay native. Not long ago Intel announced the Multi-OS Engine. It enables you to develop native mobile applications for iOS and Android with Java. There are a bunch of tutorials inside installation package. One of them is especially dedicated to cross-platform OpenGL capabilities. Please check out my OpenGLBox sample.

How to make H.264 file fast-forwardable in Android application?

I am an intern at company and my 'learning task' is to make Android application in Java, which takes H.264 format videos (at first they will be stored at SD card) and make like a very simple player, which would have the following features:
1.You can pause/play/fast-forward/fast-backward video
2.When you are at certain point of video and it is stopped, you can switch to the same time in a different video (same picture frame index i guess).
How could i do that? Is using Gstreamer a good way? I looked at the poor tutorial available on net and because of my lack of experience in video processing (I've never worked with video in Android applications) I have quite a hard time understanding what is pipelines, also the JNI and even setting up Gstreamer for Eclipse. Is there a better way of doing this? What should I get to know before starting to mess with this program?
Thanks, in advance!
All of your mentioned features are possible in Gstreamer, however, there is a learning curve.
To understand the GStreamer android tutorials, you must first go through the basic tutorials here: http://docs.gstreamer.com/display/GstSDK/Basic+tutorials
If you feel comfortable with the pipeline architecture, then go ahead and set up your android environment (which is no easy task by itself). Gstreamer is a very very powerful framework where you can do almost anything, if you're willing to make the effort to overcome the learning curve.
So i suggest to go ahead in gstreamer only if you have the time and patience, else go for a simpler solution. Unfortunately i'm not familiar with android, so i cannot suggest any. maybe a quick google search will help.

CaptureFromFile in OpenCV on Android in Java

Maybe I'm being a bit slow, but I can't find the equivalent of CaptureFromFile for grabbing video frames one by one from a file in OpenCV in Java on Android.
Can anyone put me out of my misery please and show me where to look?
Many thanks
Barry
OpenCV does not support video reading/writing on Android yet.
Take a look at solution in here. Also, it seems like Open CV is available thrue Android NDK, here you may find how to use it. In addition, you may take a look at Processing, which i believe supports Open CV and able to export code as apk.

Categories