Sammy1Am / MoppyClassic

Moppy has been replaced with Moppy 2.0!
569 stars 190 forks source link

Android port #152

Open Lynnden42 opened 7 years ago

Lynnden42 commented 7 years ago

Right, i'm just gonna start this and close the other one as, we did work out how to compile it. (I say "we worked it out" but @solidsnake745 just said "yeah, just do this and it's compiled") We'll just worry about the port here, wherever i'll need help (which at this point is getting off the ground) i'll post questions to work out. my questions are as follows:

please note that i'm using Android Studio and this'll be my first project with java that isn't "hello world"

Sammy1Am commented 7 years ago

Thanks for opening a new issue; it'll make it easier for others to find this info. I'll try to address these, but I don't have any Android development experience so hopefully Google or someone else here on Github can help with that:

  1. Yes you should be able to load the .jar into your Android port. You'd just want to make sure it was included in the classpath for your project. I don't know where in the file structure .jar libraries go for Android projects, but it should be possible to load it.
  2. I think in theory you can get away with including the "ui" folder; it would be best obviously if you removed it, but I don't think it will cause any harm by just being there.
  3. You should probably use the .jar, that's generally how you'd import an external library like Moppy.
  4. You will need to rebuild the UI, including figuring out how to get it to talk to the backend. What you'd want to do is look at a button in the current UI and see what code it's actually executing. The "Connect" button for example, either calls the connect() method or the disconnect() method. Each of those methods perform a few things to the UI (which you'd have to rewrite to perform the equivalent in your UI), but they also tell certain backend components to do things (like app.rm.connecting()).

You'd probably be better off just building your UI from scratch, and instantiating your own instance of the MoppySequencer class. There is (unfortunately-- because I didn't do a great job abstracting some concerns here) a lot of logic tied up inside some of the UI components though, which is probably bad and will make it hard to follow what you need to do. MoppySequencer has all the controls you really care about like loadFile() and startSequencer(). A lot of the additional logic and stuff that makes the UI pieces complex isn't really necessary to just get things started.