Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
John Sparrow
Courses Plus Student 3,628 PointsConverting string to math expression in android
Hey guys,
I wanna convert string to math expression like this: 20+20*50
But I can't import ScriptEngine in android studio.
How can I solve this?
2 Answers
Ken Alger
Treehouse TeacherJohn;
Take a look at this post over at stackoverflow. There are some great suggestions and code examples for Java in general but it should point you in the right direction.
Happy coding,
Ken
John Sparrow
Courses Plus Student 3,628 PointsI found the solution. There's a java class known as Interpreter. You can download this, And import Jar file into your project. http://www.beanshell.org/download.html
John Sparrow
Courses Plus Student 3,628 PointsJohn Sparrow
Courses Plus Student 3,628 PointsThanks for your answer. There isn't ScriptEngineManager class to use it in android.