Alternative way to threads under Android

actor, android, coroutine, multithreading, parallel-processing

Solution

You should try actors from Java version of Akka: http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html

It allows easy growing of actor topology using best practices (no direct access to actors by Java reference, limiting failures to zones, limiting overload using scheduler zones etc.) - all of them are described in free copy of "Scala in Depth" book: http://typesafe.com/resources/scala-in-depth

Here is example (with demo http://vimeo.com/20303656) of dynamic behavior of actors using Akka FSM on Android: https://github.com/akka/akka/blob/master/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnBecome.scala

Also you can try lightweight actors from Functional Java: https://github.com/functionaljava/functionaljava/blob/master/core/src/main/java/fj/control/parallel/Actor.java

Most minimalistic version of an actor for JVM is here: https://github.com/plokhotnyuk/actors/blob/master/src/test/scala/com/github/gist/viktorklang/Actor.scala (its features described here: How to implement actor model without Akka? )

Problem

Android's Java and Oracle's Java are slightly different. Is it possible to use the following actors or coroutines - http://code.google.com/p/jetlang/ - http://incubator.apache.org/s4/ - http://www.malhar.net/sriram/kilim/ - http://code.google.com/p/coroutines/ also for Android in order to avoid to use threads and share more code between Android's Java and Oracle's Java? Are there other frameworks available for both Java versions. Thank you in advance.

Original source

Related problems