Using MOA with Android

120 views
Skip to first unread message

Michał Ratoń

unread,
Jan 9, 2016, 8:06:27 AM1/9/16
to MOA users
Hello,

I have to develop Android application which will learn user phone profiles (work, home, night, etc.) basing on usage of phone sensors. For learning algorithm I have to use Hoeffding Adaptive Tree. Since it's implemented in MOA, it seems to be perfect option to use it as learning framework. How can one adapt MOA to be suitable for usage as a part of Android application?

Michal Raton

Albert Bifet

unread,
Jan 12, 2016, 8:19:59 PM1/12/16
to MOA users
You can use MOA classifiers directly from Android as they are in Java. Take a look at Tutorial 2 on how to use the MOA API.

Cheers, Albert

--
You received this message because you are subscribed to the Google Groups "MOA users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moa-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michał Ratoń

unread,
Jan 15, 2016, 8:52:27 AM1/15/16
to MOA users, abi...@waikato.ac.nz
Thanks for reply. I am trying to execute example from Tutorial 2 on blank Android project. I've imported MOA by adding it as Library Maven Depedency in Android Studio (version: nz.ac.waikato.cms.moa:moa:2014.04). However, code cannot be complied and executed - I get the following error:

:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Ljava_cup/runtime/Symbol;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
 
Am I importing MOA into project in the wrong way? I've uploaded the source code of this sample project on Github: https://github.com/mtraton/NewMOATest

I would be extremely helpful for help.
 

Albert Bifet

unread,
Jan 18, 2016, 2:08:53 AM1/18/16
to Michał Ratoń, MOA users
It may be a problem due to that two files have the same name due to an overlap in your dependencies

http://stackoverflow.com/questions/29628067/com-android-dex-dexexception-multiple-dex-files-define-landroid-support-annotat

Cheers, Albert

Michał Ratoń

unread,
Jan 18, 2016, 3:52:40 AM1/18/16
to MOA users, michal...@gmail.com, abi...@waikato.ac.nz
I think Gradle is causing problem - it cannot process library imported from Maven Repository due to fact, that you use two jar (java-cup, java-cup-runtime) that both define class Symbol.java. 

I'm trying to fix it using the solution you found on StackOverflow, but I think that's a different case - that user was importing library as different project, I'm importing it just as library dependency. Should I import it other way?

Sorry for causing you problems, but I think maybe other users would want to use MOA on Android and this thread will help them.

Albert Bifet

unread,
Jan 18, 2016, 4:08:40 AM1/18/16
to Michał Ratoń, MOA users
That's fine! Thanks!

Albert

Michał Ratoń

unread,
Feb 24, 2016, 2:01:51 PM2/24/16
to MOA users, michal...@gmail.com, abi...@waikato.ac.nz
We've managed to run MOA on Android - if someone want to try it, check repository with MOA adjusted to use on Android devices - https://github.com/mtraton/Android-Massive-Online-Analysis

Manuel (DraXus)

unread,
Mar 7, 2016, 8:50:49 AM3/7/16
to moa-...@googlegroups.com, michal...@gmail.com
Nice! Thanks for sharing this. Did you have any problem running any algorithm that depends on Weka? Or everything is working alright?

Regards,
Manuel

--
You received this message because you are subscribed to the Google Groups "MOA users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moa-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michał Ratoń

unread,
Mar 10, 2016, 4:45:53 AM3/10/16
to MOA users, michal...@gmail.com
We have only tested learning with HoeffdingAdaptiveTree from MOA.

SHJAFF

unread,
Jul 28, 2021, 9:24:20 AM7/28/21
to MOA users
Hi Michał Ratoń,
Thanks for sharing the information. I was searching for how to use MOA for Android-based mobile systems. I found this thread and I have installed Maven but  the tips on how to use the package on GitHub in the provided link  https://github.com/mtraton/Android-Massive-Online-Analysis is not very clear to me. Is there any other sources on how to use that package ? or if you do not mind share your experience here. 

Thanks in advance
Reply all
Reply to author
Forward
0 new messages