I have users entering numbers into an EditText fields, but what I would like them to be able to enter is 100+32+10 into the fields as well. I expect simple expressions only, common four functions. In fact, just addition would cut it too.
For just addition, I guess it wouldn’t be that hard to split up the string and do it myself I suppose, but I’m curious to know if there is a library which can do what I want much more cleanly.
Any suggestions?
There are a ton of Java expression libraries.
I’ve used JEXL on Android with no issues, but there are plenty of other options.
A full-on EL might be more than you need; essentially everybody in the world has written simple expression parsers that might be adequate for your needs, or roll a quick one yourself.