Need help writing RetroArch Android controller

Hi Guys,

I’m trying to write an onscreen controller for retroarch in java for Android, using the retroarch frontend source code. I understand that there is already inbuilt support for onscreen overlays, but the code for that is written in C, which I’m not very familiar with. I’ll really appreciate a little help in doing this either by calling native methods through JNI, or by any other means possible. To clarify my requirement further, consider I’ve written an xml layout for android that has buttons for left, right, up, down and so on. I just need to link these button onclick events to the retroarch native code which controls the input in the actual game. I really hope someone can point me in the right direction.

Thanks!

Why? The onscreen controls work fine, and c Is faster than java. Jni / ndk interaction requires knowledge of C and java.

Of you just want to customize the looks of the onscreen controls. Look at the overlay repo.

I understand that c is faster than Java, but I specifically need to write this in Java. I don’t have to use the overlay, I have to port the controls. For example, the on screen controls are in a separate android app on another phone, and the game is running on an Android stick on the telivision. Input will be sent over a websocket connection. Can anyone help me with this please?

With what purpose?? Need?? This seems you want to make a product so you can get to sell it. And while I don’t think that bad per-se I think you should do your own homework in that case.

Btw I’m no the only overlay thinks this is about that.

Also google just announced and api to do this with Android TV and Android smartphones.

We already have product in the market that streams media. I’m just looking into the feasibility of bringing NES games to it. Libretro is open source and free, so I don’t understand what the problem is. I’ve been working on this for a week, and while I do have a working solution, it has a lot of performance issues. I was hoping someone who’s familiar with the code can point me in the right direction. If you guys can’t/don’t want to help me, it’s not an issue.

See that’s the problem, you are expecting help from volunteers that work in this project in their spare time, and your intention is to make money front that help.

I’m just trying to bring RetroArch on devices users already own. I’m not selling any RetroArch software after modifying it. Also I’m not asking for anyone to write code for me, the maximum I need is which method of which class in the source code I can use to do what I stated above. That’s all I need to know. If you feel that’s too much to ask, or it’s wrong, I apologise and I’ll give up and not use this software.

As I said before, you can do whatever you want if you abide to the license terms. Heck as far as I understand whatever you’re doing is a separate application, so it wouldn’t even matter. It’s not too much to ask, but as I said it will be difficult for you to find any help here. There have been several instances of projects ripping of the work of the devs here.

I’m not sure there’s any really performant way to make it happen, anyway. RetroArch does everything in C except for the initial menu stuff because the Java stuff is so slow any time we’ve had to interact with it. I’m not sure if there’s something weird going on between java and C on android that’s exacerbating java’s inherent crumminess or what.

One way I figured out was to use Android keyboard for input. Sadly, in the code on github (master branch) I simply can’t get the android soft keyboard to work with RetroArch. On the play store version it works perfectly. Even the custom key binds don’t work. Am I missing something here?

There was a big input refactor between 1.0.0.2 and the current code, and I think a lot of that keyboard stuff may have gotten lost in the shuffle. You could use an old snapshot of the code, though, if you need that functionality.

Will try that out. Thanks!