This is an example project repository showing how to use the Java wrapper for the libplctag PLC communication library.
This is ongoing work, as we learn about Android and its build system, so expect frequent updates. We welcome any patches or pull requests for this project!
This is a direct copy of the great work done by @GitHubDragonFly with some minor tweaks to use the core C library and the build configuration. Without @GitHubDragonFly, this example and libplctag on Android would not exist!
You will need an Internet connection.
- Install Android Studio
- Install the Android SDK if it is not installed by Android Studio
- Install the Android NDK.
- Install git source control tools for your platform.
- Check out this repository:
git clone https://github.com/libplctag/libplctag4android
- Start up Android Studio and point it at the location where you checked out this repository.
- Wait until Android Studio has finished scanning the project. There will be an error about the NDK.
- Go to the File -> Project Structure menu entry.
- In the pop-up window, select "SDK Location" in the left side of the window.
- In the right side of the Window, modify the Android NDK Location to point to where you installed the NDK.
Once all this is done, you should be able to build the APK for the project. Note that you will likely see a warning about not finding or being able to resolve JNA. That's OK and it will resolve when you try to build the first time.
There are two ways to ask for help or contact us.
If you have questions or comments about the this example project, the libplctag library, its use, or about one of the wrapper libraries, please join the Google group libplctag!
The forum is open to all, but is by request only to keep the spammers down. The traffic is fairly light with usually a small number of emails per month. It is our primary means for users to ask questions and for discussions to happen. Announcements about releases happen on the forum.
If you find bugs or other problems, please file them on GitHub's issue tracker for this project.
Especially with this project, we would love to get pull requests and patches!
- An Internet connection is necessary for all builds, not just the first one. We will be working on eliminating this requirement after all the dependencies are loaded as a future update to the build system.
- The org.libplctag.Tag Java file is a copy of the one in libplctag4j. One of the urgent TODO items is to find a way to either pull the source from the libplctag4j GitHub repository or use a minimal JAR from the releases of that project.
- The tag strings are hard coded in the Java code. Ideally there would be a way within the app to edit them or at least to pull them from a properties file in the project.
- Unlike the core library and some of the wrappers, this project does not have GitHub Action CI integration. That will be an ongoing task.