Android C4droid Sfml not rendering anything after minimizing and reopening program - android

I am using the Sfml library on C4droid which has official sfml support. Everything works just fine, I can run the program normally and it renders graphics normally. But after i like minimize the app for a second and then open it back up again, for some reason it doesn't render anything at all, not even the window. Although everything else in the program runs normally like the sound,touch input, calculations etc. And I know it's not because C4droid is doing something wrong because every other graphics library i tried doesn't have that problem. Only sfml has it. I even tried it with Cxxdroid and I get the same problem.
I ran the sample programs so it's not a coding error. I tried using the the onlostfocus event to reload the files after it loses focus, I tried using only sfml shapes and no textures. But still the same thing happened. But after I tried to create a new window onlostfocus by using window.create(), It actually did render the new window even after minimizing and reopening but it only did that and didn't render/draw anything.
Is there a reason why it is happening and is there a way to fix it?

I FOUND THE SOLUTION!
I went to the sfml discord server and a really NICE person helped me out. All you need to do is just window.setActive(false) on lost focus and window.setActive(true) on gained focus AND IT WORKS FLAWLESSLY!!!

Related

Android Program is running slow

I developed a firebase app, where one could post and you could like and react. Then, I stopped working on it. After some time, I started working on it again, when I was working on it, I found that the app now runs very slow, I had 3 layout (fragment used) and view pager added to it via adapter(before). Beforehand it used to work like a charm, but now when I move from one activity to other, the mobile device kind of like hangs. It was not behaving like this previously, why is that? Anyone facing similar problem?
First of all I would propose you allocate a larger memory to your ADB virtual device.
If this doesn't help, use Android Profiler to better understand the cause of this memory loss.
https://developer.android.com/studio/profile/android-profiler.html
Just go to your AVD device settings and disable Device frame, this will improve the speed of your emulator

SDL Android: Exiting an application and issue with colours

My misadventures in Android continue, and altho it seems silly to ask about everything, I haven't had any luck with trial-and-error or even Google.
I am using C++ native SDL program in android via NDK.
So first things first: I can't get as simple thing as exiting an application to work. I have fiddled hours with SDLActivity.java and the cpp but nothing seems to work. I mean exiting a program, not just minimizing the process. I know it's not advised but I would like to implement it to some of my programs.
I have tried, according to stuff found online:
System.exit() in SDLActivity
android.os.Process.killProcess(android.os.Process.myPid() ); in SDLActivity
System.finish() in SDLActivity
System.exit(0);
But nothing works, they all just minimize the process but it's still running and continues from the moment of exit when returning
The second thing is about colors. All colors I'm drawing are off when the app is running normally but they appear what they should be when something system messages or the volume dialog appears and then return to the distorted form when it disappears. Is this because perhaps I'm having wrong pixel format for the window? I'm not initializing it to anything specific.

Android, Text / Font renders as Squares

When I try sharing an image through my program, the share menu sometimes comes out looking like this.
Some Notes:
1) It doesn't seem to occur on the first run, but only after I have paused the application and gone back in.
2) My app uses OpenGL extensively. It is possible I am changing a shared setting, then not returning the value back to the original.
3) Everything else in my application works fine.
4) I have tried removing all the calls that allow transparencies, and I am still having this problem.
I have this problem too. I am using a GLES 2.0 context, the only way I have been able to get rid of this... (it's going to sound weird) is by NOT calling
GLES20.glDeleteTextures ( hTextures.length, hTextures, 0 );
It wasn't happening before I started clearing up my textures, and it hasn't happened again since removing it. I have no idea why that would be though?
I'm also not sure of the ramifications of not releasing my textures.
If anyone can shed light on the matter, that'd be great, there's a few versions of questions floating around. Appears it's a problem in Unity for android and everything.
I have sometimes this problem, and not happens ever, just randomly.
I have cleaned my project and uninstall from device, compile and install again, to me works fine.
Hope this helps.

Android - Eclipse Fast View Not Dismissing LogCat with Escape

Can't seem to find anything on this except an Eclipse bug report in 2004 (which I assume has been fixed!).
While using Eclipse (Galileo), I like to keep the LogCat in a Fast View to keep my screen clean and full of code. But I often have to switch back and forth between the code and the LogCat while chasing bugs. I have a nice keystroke set up to display the Fast View, but does not dismiss this particular Fast View (yes, it works on other Fast Views!).
Any advice? Moving the mouse and clicking on a piece of Eclipse that does not show the LogCat is the only way I know of dismissing this Fast View--and since I'm a keyboard programmer, this is not only a pain, but it really slows me down.
And now for 2000 words of information: Here's a pic of my normal coding screen:
And here's what it looks like with the LogCat:
Thanks,
-s
Yes I was also facing this issue. What I am doing right now is working with LogCat(deprecated). Its working good try to use the deprecated one

Android Emulator does not work with Mono for Android

I am trying to write an application with Mono for Android. In an attempt to do this, I'm using the default template in monodevelop. I can successfully compile and run the application. When I run the application, it looks similar to the one shown here: http://docs.xamarin.com/android/getting_started/hello_world
There are two oddities in my version though:
The button is red
I can't seem to actually click the button. When I use my computers mouse, it acts like it won't click the button. This is not limited to the application either. If I try to click the home or search button in the emulator itself, I noticed that nothing happens either. Its like the emulator is not responding to my mouse.
As someone new to working with Android, can someone please tell me what I'm doing wrong? I'm using MAC OS X with Lion installed. I'm assuming that I have the SDK and Java SDK installed properly considering the app compiles and when I press "play" I can load the app in the emulator. I just can't figure out why I can't actually click the button. So bizarre.
Any ideas?
The title of this question is pretty misleading, since you're saying that the emulator is not very responsive even outside the Mono for Android application. The problem here is with the emulator itself. The one thing I would recommend trying with respect to Mono for Android is to try starting the application without debugging, as debugging will add extra overhead to running the app.
The Android emulator is notoriously slow, since it is fully emulating the ARM instruction set in software. That said, there are certain things you can do in order to squeeze some more speed out of it. One thing that I've seen make a big difference is to decrease the screen size of the emulator image. Setting this to a small screen size (such as QVGA) can make a big difference. You can manage these settings through Android's AVD Manager.

Categories

Resources