MoppyClassic
MoppyClassic copied to clipboard
Android port
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:
- can I load the compiled .jar file in the file structure of the Android port
- If I can, can I include the "ui" folder (i don't think i could get away with this but it's worth asking for completions sake)
- if i can't use the .jar file, where do I put the individual files of the moppy project?
- and lastly, assuming that I work out the above tasks (and port over the serial communications etc etc.) and I move on to designing the UI, can I for example, look at a button on the original java version (for example the "connect" button at the bottom of the window, make a button on the android port, and just call it the same thing as the java version? or would I have to go into the back end and work out new ways of having the UI talk to the back end? (i'm sorry if that's a bit rambly)
please note that i'm using Android Studio and this'll be my first project with java that isn't "hello world"
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:
- 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.
- 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.
- You should probably use the .jar, that's generally how you'd import an external library like Moppy.
- 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 thedisconnect()
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 (likeapp.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.