Could someone help install a working android development environment?

  1. Download and install Visual Studio 2015
    (You only need to install the C/C++ components but it should still
    work if you installed everything.)

  2. Download and install Android Studio
    Make sure to tell it to install the NDK components if given the option.
    (There are some screenshots in the Blurrr SDK Instructions.md)

  3. Download and unzip Blurrr SDK for Windows
    Launch BlurrrGenProj.exe in the root of the folder. Follow the setup
    directions I told you in the previous message.

-Eric

one more quick question. Does the code seem to run oke now (except for maybe it’s not Unicode base & the sdl-geteventfilter) ? Also my original code wasn’t so bad was it , except that I didn’t use ALmixer and didn’t know how to port to blurrr? It did run perfectly fine on my laptop before you tested it, with no noticeable bugs at all, graphics were fine etc.

I will test it all tomorrow .
Thanks.

I didn’t spend much time with your program. After fixing the graphics
glitch, I haven’t been able to make the program do anything. Since
there is no mouse support, I wasn’t inclined to explore it. On
Android, none of my touches did anything, but I don’t know what it’s
supposed to do.

I suspect you may still have a few bugs to fix. However since you said
your program worked fine before, I think you’ll be able to solve these
bugs reasonably quickly. Cross-platform can be a double edged sword.
It’s a little more effort to do, but it can also help reveal bugs
quickly.

-Eric

Justadot, before Eric fixed your code, i fixed your code, making it to run in Linux. I don’t know where did your code run before, but in Linux it didn’t compile and run at all. Eric took your code that were fixed by me, and further fixed bugs in it.

it compiles and runs perfectly fine in windows 7 , and using devc++ / mingw? I don’t understand how it can be so many bugs while it works perfectly fine for me on my laptop ?? I tested every way possible etc. no problems encountered.
I just want this to run on android at this point.

Eric: There’s a start button in the top left , that should load the next screen at least. I know the screen background and buttons are too dark and barely visible , I was going to change that still. Hopefully it works, I hope to be able to test it myself soon as well.

The button isn’t responding when I try it.
I didn’t have time to debug it because I was debugging another
problem. You were using both SDL_GetWindowSurface() and the
SDL_Renderer APIs. You are not allowed to mix these. Windows was
letting you get away with this, but this was one of the original
reasons why Android and Mac originally failed. When I fixed Android
and Mac, I ended up breaking Windows (I had not tested it again until
now.) I think you want SDL_Renderer, so I removed GetWindowSurface and
code that used it. (pushed to my Github). You should review those
changes because I don’t really know your full intent in those
sections. But the good news is that I’m getting the exact same thing
now on Windows, Mac, and Android.

I’ve uploaded binaries for Windows and Android so you can see what I’m
getting (with the lack of touch input response.)
http://blurrrsdk.com/tempdownload/BlurrrBinaries/JustADot.apk
http://blurrrsdk.com/tempdownload/BlurrrBinaries/BlurrrJustADotWindows.zip

You should be able to reproduce both of these binaries yourself using Blurrr.

-Eric

Sadly I’m still up as well , can’t sleep with all this. Maybe it’s because the code is testing for touch events tfinger , I did not code this for mouse motion/up/down ?

You might consider putting back the mouse code and maybe even
commenting out the finger code. As I said earlier, SDL automatically
applies mouse code to single finger touches. So if you get the mouse
working again, the touch code just might work by itself.

But you should get some sleep. Programming bugs are the norm in this
industry and everybody knows this takes time. Things can make more
sense after rest and a fresh perspective. It seems like you have
plenty of time and you aren’t under some contractual obligation to
ship immediately. So relax and breathe. You’ll get it done eventually.

-Eric

Eric. I tried generating a new project in Blurrr by selecting BlurrGenProj.exe and
the create new project button. But when I type a project name and everything is selected the generate project button is still greyed out?

I simply downloaded and installed Visual studio. Android Studio was already installed.
So what could be the problem?

Thanks :slight_smile:

Let’s clarify the steps you made:

  1. Launch BlurrrGenProj.exe

  2. Click New Project Button

  3. In Project Name, type something like "MySDLProject"
    Template Type: Default SDL
    Language: C
    Project Directory: Do something easy like C:\TEMP

Press “Create Project”

  1. Use the defaults as is:
    Project Type: C
    Platform: Windows (Visual Studio 2015)
    Open Project: Checked

The Generate button should be enabled and you should be able to press it.

(Ignore Android until you get Windows working.)

-Eric

I was clumsy, I didn’t see the project directory field.

It works now , but I did get some errors:

CMake Error in CMakeLists.txt:
No CMAKE_C_COMPILER could be found.

CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.

Thanks :slight_smile:

Okay, I think that means you still need to install Visual Studio’s C/C++ support. In Visual Studio, choose File -> New -> Project -> C++ and you will be prompted to install the necessary components.

I think this video walks through it.

Once you have it installed, in BlurrrGenProj, hit the “Purge” button and then “Generate” to re-try.

I cannot make this code changed by Eric to work with NDK. Blurr appears in the source code, trying to find the path to resources. Why is that necessary when the resources path in these projects is always the same. Removed that, but now it likely crashes because it cannot load the resources.

I tried to build the example of my kiss_sdl widget toolkit with the exact same project, c++11 and everything, just copied the assets and source files from my toolkit’s android branch, changed the sources lists in Android.mk and Makefile, and it did run just fine. I don’t know what’s the difference, and why when running the justadot code, no window appears at all. I compiled and run the exact same code, modified by Eric, in Linux, and it did work, that is, window appears, and it also played some kind of sound, but i didn’t see anything else working there. I understand that Eric solved the problem why the window does not appear in justadot app on Android, but the exact same code doesn’t display any window when built with NDK tools, while another code works completely with the same exact configuration. I don’t know why is that and what is different in justadot code.

The only difference from the code modified by Eric, was that i used SDL_mixer, not ALmixer, and my toolkit’s example uses no sound, so maybe SDL_mixer with smpeg2 doesn’t work in Android and causes it to crash. Just a conjecture, because this is the only difference i see so far.

actsl , I have decided to use Blurrr , so thank you for the replies but you are really not helping anymore.

My code works perfectly fine in windows 7 with devc++/mingw , so it can’t be that bad.

I am a beginner in SDL and really still just at best an advanced beginner in C++ , and you’re just making me feel worse about my coding capabilities.

It looks to me now that NDK tools work perfectly, the problem is not in that.

With the same NDK configuration, my toolkit example did run perfectly, but it does not use SDL_mixer. The SDL_mixer playmus demo built but exited immediately when playing mp3 file. The justadot app modified by Eric did run in Linux and did show a window when all sound playing was removed (including the SDL_mixer header), but did not show a window in Android. I may test it further if anyone is still interested in building that app with NDK tools, otherwise not.

I had make SDL2, SDL2_image, SDL2_mixer, SDL2_ttf project files based Android Studio. You can download from Mirror of Simple DirectMedia Layer

The content is to add a directory called “android”, for example SDL2, it is https://github.com/freeors/SDL/tree/master/SDL2-2.0.5/android/jni

Eric. I can’t get Blurrgenproj.exe to run with android (opening an existing project with android).

the ndk path set in blurrrgenproj preferences is : c:user\name\downloads\androidndk\ndk\build

and in android studio under file , project structure the ndk path is:
c:user\name\downloads\androidndk\ndk

neither blurrr or android studio woudl accept any other path as legitimate.
Thanks :slight_smile: you’ve been very helpful :slight_smile:

So first, I really hope this means you got the Windows part working.

As for Android:
If you downloaded the NDK separately, then set Blurrr’s NDK path to
that. The correct directory should contain files like "ndk-build.cmd"
and folders like “toolchain”.

If you installed the NDK through Android Studio via going to the
Configure (on the launch screen) -> “SDK Manager” and then going to
the SDK Tools tab, and checking/installing “NDK”, Android likes to put
it inside the SDK directory.
So the SDK would be something like:
C:\Users<username>\AppData\Local\Android\sdk
And the NDK would be
C:\Users<username>\AppData\Local\Android\sdk\ndk-bundle

One note, Android recently changed the NDK slightly and broke Blurrr’s
little green checkmark for the NDK. You may still see the warning
badge instead. This will not prevent Blurrr from working though. Just
be very sure you are pointing at the right directory (e.g. the one
with ndk-build.cmd and toolchain).

One final thing I forgot, on Windows, I also need you to install
Strawberry Perl. It was a temporary workaround for Windows I’ve been
planning to remove, but haven’t been able to do so yet.
Main site:
http://strawberryperl.com
or Direct link:
http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-64bit.msi

Please install that and then Generate Project should create an Android
Studio project in your New Project’s BUILD/Android directory, e.g.
C:\TEMP\MySDLProject\BUILD\Android

In Android Studio, select Open an existing Android Studio project. And
go to that directory and open it.

At this point, you should be able to go to the Build and Run menus to
build and run the project.

-Eric