title: Solving a simple string expression in java (android)
body: <p>I'm making a simple calculator app. I will get simple string expressions in the form of "1+2*3/4". no brackets or anything. Now i want to solve this expression when user presses = button. I found this really simple working piece of code for this purpose:</p>
  
  <pre><code>import javax.script.ScriptEngineManager;
  import javax.script.ScriptEngine;
  
  public class Test {
    public static void main(String[] args) throws Exception{
      ScriptEngineManager mgr = new ScriptEngineManager();
      ScriptEngine engine = mgr.getEngineByName("JavaScript");
      String foo = "40*4+8/2";
      System.out.println(engine.eval(foo));
      } 
  }
  </code></pre>
  
  <p>But the problem is that eclipse don't seem to resolve these imports as i probably need EE for this purpose, and i dont know how to get to that. Kindly tell me a simple algorithm or code that'd solve the string expressions or some way to enable those imports in the eclipse.</p>