> On Friday, April 1, 2016 8:41 AM, James Cancilla <[email protected]> > wrote:
> Are there any instructions for running Quarks on Android? I am trying to > use Quarks to collect and analyze phone GPS data. Any documentation or > starter code would be appreciated. Thanks for the nudge, I've been meaning to write something up. Here's a quick overview. First you have to build Quarks with Android enabled, see: https://github.com/apache/incubator-quarks/blob/master/DEVELOPMENT.md With ANDROID_SDK_PLATFORM set then 'ant release' will build Android jars under target/android. I created an Android application that read a couple of the phone sensors (e.g. air temp and pressure) displayed them to a text box and also sent them to IBM Watson IoT Platform as device events. I'm not an Android expert so I'll just list what I did, or what I can remember doing. 1) Using Android Studio I created a new project. 2) Under app/libs I added a quarks folder and copied the contents of target/android to that directory. 3) Code your application, there is some Android specific utilities to get Android sensors (not sure about GPS) as a stream and to have a stream processing execute on the main UI thread. 4) To build the application I did need to modify build.gradle to exclude files from the Quarks jars that have the same path, adding this: packagingOptions { exclude 'META-INF/license.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/notice.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/DEPENDENCIES' } Note this was only for a test application, I provide no advice on legality of just removing such legal notices and not having them in your Android application in some other form. I was pushing the application to my phone using a usb cable with the phone in development mode. I'll provide some sample code in a separate reply. HTH, Dan.
