Custom Plug-in Using Android Studio
Your online instructions for preparing the API using eclipse did not match the dialogs I was seeing (at least not for MacOS). So, since I had to figure it out for myself anyway, I did so using my preferred Android Studio. Here are the steps I had to do:
Prepare Android Studio for JustInMind (JIM) SDK (See https://stackoverflow.com/a/35241990)
- Launch Android Studio
- Add new module for JIM plugin (`File` > `New` > `New Module…`)
- Create a folder called `libs` within that module
- Place the JIM SDK within `libs` folder
- Expand `Project` Tab/View
- Set view type as `Project` (as opposed to `Android`)
- Expand `libs/javafx` folder
- Right-click each of the JAR files
- Click `Add as Library…`
- Select the new module for Add to module:`
- Expand `libs/api_plugins` folder
- Right-click each of the JAR files
- Click `Add as Library…`
- Select the new module for Add to module:`
- Wait for Android Studio to resolve the imports in the example code (`com.justinmind.pcontrols.ControlUtils` did not resolve for me)
Configure JIM for debugging (same as your instructions; included for completeness)
- Edit `/Applications/Justinmind.app/Contents/Java/Justinmind.cfg`
- Place within `JVMOptions`: `-agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n`
- Launch JustInMind application
- Click on `Plug-ins` > `Install a plug-in...`
- Specify the location of the JAR built from this code (`build/libs/[module].jar`)
Update the plug-in after each JAR change
- Copy the output JAR from module to JIM application
- From: `[module]/build/libs/[module].jar`
- To: `/Applications/Justinmind.app/Contents/Java/user_plugins/[module].jar`
- Re-launch JIM application
Active debugging:
- Within Android Studio, `Run` > `Attach to Process...`
- Select the JustInMind process
- Watch for `Debug` > `Console` to print "Connected to the target VM, address: pid ####"
- Specify breakpoints
- Within JustInMind, click `Plug-ins` > `[Module]` (whatever you specified in `getName()` in your code)
- Now you can step through your code
Replies have been locked on this page!