android: GLWallpaperService causing green screen - android

I am trying to create a live wallpaper using opengl (<2.0).
I imported and tried to run Robert Green's GLWallpaperService and Example here (using Eclipse SDK).
My phone is a Huwei Ascend Android 2.1. I already know it can run other opengl LWPs.
When I run the package, it just produces a solid green screen, and no shapes or anything.
Ive researched it alot and still cant figure out why this is happening.
I read a few times that the namespaces have to be changed to my package. But still no luck...
I tried linking his GLWallpaperService JAR library to my package as per instructed. Nope.
Any guidance would be much appreciated.

I fixed this on my Galaxy Nexus by adding
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
to onSurfaceCreated in MyRenderer.java.

try gl.glScale() in your Renderer Code. I also got the same problem and i figured out that my GLView was so much zoomed that i cant see anything. try to reduce scale.
My program wo

The example project you linked to had bugs in the rendering code, as others here have pointed out. It has since been deprecated and deleted for maintenance\workload reasons.
However, there's currently some example wallpaper code embedded into the main repository of GLWallpaperService. It's set up as a full Android application so developers can test using that example as needed.

Related

Unity 2017: Canvas Not Rendering on Build

I've been using unity for quite some time. But I downloaded the latest version 2017.2.1f1 and started a new project. Everything is running fine in the game and scene view. Playing the game in the editor is working fine as well. However, when I build it to my android device (API Level 19). The Canvas and all of the UI elements are not visible. The Render Mode for the Canvas is set to Screen Space Camera and UI Scale is Scale with screen size. I tried looking around but I'm not able to find a fix that works in my case scenario. Any help will be much appreciated.
Please note that I'm working on a 2D game so the environment is set to 2D, if that helps in any way
Let's say you are porting your project from an older version of unity. OR Unity crashed while you were actually building the project. Under these scenarios. Unity might not include all the required shaders and in some cases Classes for some reason. However there is a really easy work-around over this. Just follow the steps as listed:
Close Unity
Browse to the folder/directory of your project.
Delete the Project Settings Folder. (It might delete some editor settings but as far as your project is concerned nothing is going to change.)
Open Unity again and open your Project.
Unity will rebuild the project and the error will be fixed.

How to get an Android WebView as a Unity Texture?

I spent a week on this already, but I'm not an expert so I may miss something, or even want to do something impossible.
I have a Unity project (with Daydream VR) and my goal is to get a WebView working on a 3D surface (as a texture) in VR mode (for Android)
I know it sounds complicated and, I bet it is.
This is where I am so far:
First of all I started with the samples from Oculus. They made a plugin that links an Android MediaPlayer (native class from android) to a Unity Texture, this is kind of easy because the media player of android already use SurfaceTexture to render itself, and with the plugin they just created a bridge between the two environments.
I got this working easily.
Then after I found this article: http://www.felixjones.co.uk/neo%20website/Android_View/
and so I made a deduction that it could be possible to use the same trick to get a native Android WebView in a Unity Texture.
From the article, I thought that the only thing I needed was a custom Android WebView that renders to a SurfaceView (so it will be quite similar to the Android MediaView) and then the oculus plugin would work too.
Of course nothing was like that...
Step 1/
I made an Android plugin for Unity to expose a custom WebView that (IMHO) would render to a SurfaceView (but I'm not sure it is quite right)
see => JrmgxWebView.java
Step 2/
I compiled the oculus plugin, with minor changes
see => *.cpp
Step 3/
I adapted the Unity script that link both the Android plugin and the oculus plugin for unity, added that to a simple Daydream Scene on a 3D cube (with the script associated)
see => WebviewPlayerSampleWeb.cs
I get logs, and from what I understand, the problem is that the SurfaceView does not get refreshed. I can see that my Custom WebView is instanciated well, most of the code works and there are no error (nor crash)
But the texture only change from white (start value) to black (when the plugin is initialized) and then nothing happen.
The textureId coming from the plugin get stuck to either 0 or 29, and AndroidSurfaceTexture->GetNanoTimeStamp() never returns new values.
On the java side I played with .invalidate(), used .loadUrl() and .loadData() and on the C++ part, I checked each method call to see if everything was called. I spend so much time on this code that I can't even remember all the combination I tried.
What is wrong with this?
I'm sure I'm missing a basic point here.
most code here https://gist.github.com/jrmgx/019cba403769dda27a6d42e48c461b1b
PS: be nice with me, it's been a week, and it is my first time with Unity, C++, JNI and C#
Thank you in advance

Android game crashed after displaying unity's splash screen

I found this question on different forums but they didn't helped me to find solution of my issue. I had port unity(5.4) game on my android device (OS 4.4). When i opened the game it crashed after displaying unity's default splash screen. I wonder, it was working fine on unity's editor but didn't worked well on device.
Here is the logcat file link. Please let me know if i can provide any additional information that may help to track the issue. Many thanks.
Regards,
Ali
90% it's native plugins. Try to remove all your native android plugins. You can find them under Plugins/Android folder. You also need to remove all links or scripts that uses those plugins. Don't forget to make a back up. If your app won't crash, replace them with some others or connect with plugin development support.
I found the solution. I followed following steps.
Solution
Go to 'Player Settings' -> 'Other Settings'. Uncheck Auto
Graphic Api. Remove 'OpenGLES2' from list.
Test your game on better android device. In my case i tested on Samsung Glaxy S5.
If solution doesn't work
Remove all objects from scene. Port the project and test, if that
works, it means you need to remove unnecessary objects from scene
that need a lot of render power to load on mobile device.
Make sure your Android SDK is uptodated a long with JDK.
Just make sure Virtual Reality support is unchecked

Game Object working in scene and game view, but completely invisible in Android build

I have thoroughly searched on the web but I couldn't find anyone with my same problem.
I'm working on a 3D game for Android using Unity. Everything works fine within the editor and on the Unity Remote app, but when I build the project, install it on my smartphone and start it... I can't see a game object.
A screen of the project:
As you can see, the sword is active and visible in the editor, but once I start the actual build I get this:
I can't understand what's wrong, could someone kindly help me? Many thanks.
Does the material of the sword have the standart shader?
If so try one of the mobile ones.
Another idea would be to upgrade to one of the newer p versions of Unity.
Since the sword has a rigidbody, have you enabled gravity and somehow disabled collision and its falling through the ground?
Other than that, it could be a shader problem.
Problem solved. I upgraded from Unity 5.3.2 to 5.3.4, re-built the project and everything works like a charm now.
Sometimes Unity can be... strange.

Android Resources OpenGLES 2.0 Example Force Closes

I have just recently started out programming for Android, and have decided that I want to learn how to use OpenGL ES 2.0. I googled around for an example and it turns out that in the resources section of the Android Developers Website there is one.
Link: http://developer.android.com/resources/tutorials/opengl/opengl-es20.html#touch
However, I am trying to run the first example and I get a force-close on my HTC EVO. I have tried literally copy and pasting the code from broswer to Eclipse, and adding the appropriate line in the manifest, but still no dice.
Any help here?
After reading carefully through that, turns out all i had to do was modify the activity in the manifest file. Problem Solved.

Categories

Resources