This is a question I’ve asked myself since I began programming again and again.
My goal:
- draw a function graph based on a string like “sin(x-1)*2.5” FAST.
- fast means fast enough to be fun
- it must run on Android
What I tried:
- using my own very simple parser (slow and primitive)
- using the JavaScript parser (slow but flexible)
- using the Janino runtime compiler (fast and flexible, perfect, but only for normal Java)
I’ve googled extensively (queries like “android function graph how to”), but not found a solution,
although there are numerous applications managing to do this.
I will not accept “write your own parser/compiler” 🙂
SO: How do I do this?
Thank you very much in advance,
Till Höppner
Thanks to the help of harism and John Boker,
I achieved my goal quite easily.
My conclusions:
DO NOT put .CLASS libraries in your Android project, because these have .DEX files
Use either the dx tool, on those libraries, or use the source code of them
expr runs fastest in my app
Thank you, harism and John Boker
EDIT: This is nonsense, I don’t know why I thought this…