SDL icon indicating copy to clipboard operation
SDL copied to clipboard

The android readme is really confusing

Open kallehed opened this issue 3 years ago • 13 comments

I just spent a couple days porting my game to Android, and specifically this part of the README-android.md confused me incredibly:

For more complex projects, follow these instructions:

  1. Copy the android-project directory wherever you want to keep your projects and rename it to the name of your project.
  2. Move or symlink this SDL directory into the "/app/jni" directory
  3. Edit "/app/jni/src/Android.mk" to include your source files

First it mentions an "android-project directory" which I thought was my OWN project. I think it would be more clear to say '1. Copy the directory "android-project" directory at "SDL/android-project" wherever you want to keep your project.' Also, maybe the README could mention the purpose of the director? As I now understand it; the directory contains the basic glue code between Android's Java frontend, and the C/C++ SDL 'backend' we as developers write. It would have been useful to know that.

The second confusing part was

  1. Move or symlink this SDL directory into the "/app/jni" directory

Basically, I didn't know what a 'symlink' was. Maybe the word could be a hyperlink to the wikipedia page for symlink? Like: Symlink Also... ehhh in the markdown code for that line, there is the word "project" before the "/app/jni" part, between two less than/greater than signs. But it seems markdown removes that part of the text?? So what you see is only "/app/jni" WHICH MAKES IT EVEN MORE CONFUSING

It's possible I'm stupid, but I would say this README could be greatly improved to make a bunch of peoples lives easier. Banged my head against this readme for multiple days, which wasn't really much fun. So say if I should make a pull request or something.

kallehed avatar Mar 25 '23 13:03 kallehed

That part always tripped me up as well, so it's not just you. I think symlink is a linux thing? A lot of the devs assume we should all have a linux background, which is the problem.

The android-project is a very good template to start from, so maybe it needs to be clarified that it's a template project.

I ignore the symlink part and just add a line into project-level Android.mk to point to where my SDL source code is, so it looks like this:

include $(call all-subdir-makefiles)
include ../../SDL/Android.mk

AntTheAlchemist avatar Mar 25 '23 14:03 AntTheAlchemist

^ my SDL directory sits side-by-side with my project directories, so back 2 directories and into the SDL source code is what's needed for the relative path.

AntTheAlchemist avatar Mar 25 '23 14:03 AntTheAlchemist

Yeah exactly. It would be cool if the readme could mention this method as well

kallehed avatar Mar 25 '23 14:03 kallehed

Yeah exactly. It would be cool if the readme could mention this method as well

Go ahead and edit the readme to make it easier to read and add alternative to a symlink, it will be merged. Or paste the revised edit here. A lot of people have struggled with this, so it'll be appreciated.

AntTheAlchemist avatar Mar 25 '23 15:03 AntTheAlchemist

Did you tried to run androidbuild.sh as mentioned in that README? It takes all work for you. In general, symlink is something like shortcut in windows

dustdfg avatar Mar 25 '23 15:03 dustdfg

Did you tried to run androidbuild.sh as mentioned in that README?

How do you run a .sh file? My Windows 10 PC doesn't recognise it.

AntTheAlchemist avatar Mar 25 '23 15:03 AntTheAlchemist

How do you run a .sh file? My Windows 10 PC doesn't recognise it.

It is not for windows

dustdfg avatar Mar 25 '23 15:03 dustdfg

It is not for windows

And that is the OP's problem. Not everyone uses Linux.

AntTheAlchemist avatar Mar 25 '23 15:03 AntTheAlchemist

Did you tried to run androidbuild.sh as mentioned in that README? It takes all work for you. In general, symlink is something like shortcut in windows

Yes I did try androidbuild.sh at the time I started, but I think it failed for some unclear reason? Anyway, I currently understand basically everything now, no need to help me anymore 😅. This issue is mainly about me wanting to fix the documentation to be more clear.

kallehed avatar Mar 25 '23 15:03 kallehed

Yes, feel free to create a PR with the documentation cleaned up to make more sense for you.

Thanks!

slouken avatar Mar 25 '23 18:03 slouken

Yes, made a pull request on my changes

kallehed avatar Mar 25 '23 19:03 kallehed

You can run shell scripts in Windows with git bash. Which almost everyone has installed, since you need it for Git on Windows.

  • Not sure if that will work in this case, just sharing.

Starbuck5 avatar Mar 26 '23 03:03 Starbuck5

hey,just for info,using android studio for it is very much easy(based on lazyfoo sdl2 tutorial)(its outdated but it also works for newer sdk,ndk versions and some small debugging as mentioned in the tutorial)

cool-dev-guy avatar May 04 '23 08:05 cool-dev-guy

We merged your documentation improvements, thanks!

slouken avatar May 21 '24 18:05 slouken