The only way I found to get the exp4j classes to be built and included in the apk...
[debian/openrocket] / android / src / net / sf / openrocket / android / simservice / SimulationService.java
index d241cb68a3f85200baf8059c9faef95e2d1ee53f..9a1dd49116a3e08960e81a433537ef7cb5144bf9 100644 (file)
@@ -1,10 +1,15 @@
 package net.sf.openrocket.android.simservice;\r
 \r
+import java.util.List;\r
+\r
 import net.sf.openrocket.R;\r
 import net.sf.openrocket.android.CurrentRocketHolder;\r
 import net.sf.openrocket.android.util.AndroidLogWrapper;\r
 import net.sf.openrocket.document.Simulation;\r
+import net.sf.openrocket.simulation.customexpression.CustomExpression;\r
+import net.sf.openrocket.simulation.customexpression.CustomExpressionSimulationListener;\r
 import net.sf.openrocket.simulation.exception.SimulationException;\r
+import net.sf.openrocket.simulation.listeners.SimulationListener;\r
 import android.app.IntentService;\r
 import android.app.Notification;\r
 import android.app.PendingIntent;\r
@@ -39,8 +44,12 @@ public class SimulationService extends IntentService {
                SimulationTask t = (SimulationTask) intent.getSerializableExtra("net.sf.openrocket.simulationtask");\r
                try {\r
                        Simulation sim = CurrentRocketHolder.getCurrentRocket().getRocketDocument().getSimulation(t.simulationId);\r
+\r
+                       List<CustomExpression> exprs = CurrentRocketHolder.getCurrentRocket().getRocketDocument().getCustomExpressions();\r
+                       SimulationListener exprListener = new CustomExpressionSimulationListener(exprs);\r
+\r
                        AndroidLogWrapper.d(SimulationService.class, "simulating " + t.simulationId );\r
-                       sim.simulate();\r
+                       sim.simulate(exprListener);\r
                        CurrentRocketHolder.getCurrentRocket().unlockSimulation(this, t.simulationId);\r
                }\r
                catch (SimulationException simex) {\r