Skip to main content
added 89 characters in body
Source Link

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

Update2:

I edited the code:

private OnClickListener ButtonClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    xlText.getText();
    xuText.getText();
    
    String firstString=xlText.getText().toString();
    String secondString=xuText.getText().toString();
    double xl = Double.parseDouble(firstString);
    double xu = Double.parseDouble(secondString);
    
double f=2*xl+1;
double f2=2*xu+1;
String xlstring = String.valueOf(f);
String xustring = String.valueOf(f2);

    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

This is working. In this code, I get the values of xl and xu then I inserted it in the function I made(2*x+1). But what I need is a code that also gets the function from the user. That's why I used mxparser.

This is the output Update3:

I started debugging it and this shows(Source not Found). Don't know what it means. any idea? :(

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

Update2:

I edited the code:

private OnClickListener ButtonClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    xlText.getText();
    xuText.getText();
    
    String firstString=xlText.getText().toString();
    String secondString=xuText.getText().toString();
    double xl = Double.parseDouble(firstString);
    double xu = Double.parseDouble(secondString);
    
double f=2*xl+1;
double f2=2*xu+1;
String xlstring = String.valueOf(f);
String xustring = String.valueOf(f2);

    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

This is working. In this code, I get the values of xl and xu then I inserted it in the function I made(2*x+1). But what I need is a code that also gets the function from the user. That's why I used mxparser.

This is the output

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

Update2:

I edited the code:

private OnClickListener ButtonClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    xlText.getText();
    xuText.getText();
    
    String firstString=xlText.getText().toString();
    String secondString=xuText.getText().toString();
    double xl = Double.parseDouble(firstString);
    double xu = Double.parseDouble(secondString);
    
double f=2*xl+1;
double f2=2*xu+1;
String xlstring = String.valueOf(f);
String xustring = String.valueOf(f2);

    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

This is working. In this code, I get the values of xl and xu then I inserted it in the function I made(2*x+1). But what I need is a code that also gets the function from the user. That's why I used mxparser.

Update3:

I started debugging it and this shows(Source not Found). Don't know what it means. any idea? :(

added 832 characters in body
Source Link

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD) This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

Update2:

I edited the code:

private OnClickListener ButtonClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    xlText.getText();
    xuText.getText();
    
    String firstString=xlText.getText().toString();
    String secondString=xuText.getText().toString();
    double xl = Double.parseDouble(firstString);
    double xu = Double.parseDouble(secondString);
    
double f=2*xl+1;
double f2=2*xu+1;
String xlstring = String.valueOf(f);
String xustring = String.valueOf(f2);

    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

This is working. In this code, I get the values of xl and xu then I inserted it in the function I made(2*x+1). But what I need is a code that also gets the function from the user. That's why I used mxparser.

This is the output

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

Update2:

I edited the code:

private OnClickListener ButtonClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    xlText.getText();
    xuText.getText();
    
    String firstString=xlText.getText().toString();
    String secondString=xuText.getText().toString();
    double xl = Double.parseDouble(firstString);
    double xu = Double.parseDouble(secondString);
    
double f=2*xl+1;
double f2=2*xu+1;
String xlstring = String.valueOf(f);
String xustring = String.valueOf(f2);

    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

This is working. In this code, I get the values of xl and xu then I inserted it in the function I made(2*x+1). But what I need is a code that also gets the function from the user. That's why I used mxparser.

This is the output

added 1 character in body
Source Link

I have a problem with my Android Program. I'm using mxparsermxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

private OnClickListener multiplyClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    Function f = new Function("f(x) = "+funcText.getText());
    Expression xlexp = new Expression("f("+xlText.getText()+")",f);
    Expression xuexp = new Expression("f("+xuText.getText()+")",f);
    double c = xlexp.calculate();
    double d = xuexp.calculate();
    String xlstring=Double.toString(c);
    String xustring= Double.toString(d);
    
    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

These are my inputs

I updated this using what @LutzL told me. xD Still not working butThis is the Error Message (I think xD)

Thank you!! PS: I still need help LutzL for keeping up with me :(D

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

private OnClickListener multiplyClicked= new OnClickListener()
{
@Override
public void onClick(View v)
{
    Function f = new Function("f(x) = "+funcText.getText());
    Expression xlexp = new Expression("f("+xlText.getText()+")",f);
    Expression xuexp = new Expression("f("+xuText.getText()+")",f);
    double c = xlexp.calculate();
    double d = xuexp.calculate();
    String xlstring=Double.toString(c);
    String xustring= Double.toString(d);
    
    fxlText.setText(xlstring);
    fxuText.setText(xustring);

}

};

I updated this using what @LutzL told me. xD Still not working but Thank you!! PS: I still need help :(

I have a problem with my Android Program. I'm using mxparser as my Math Parser. I added it to my Lib. No errors are showing after I typed my program using this but the program gets an error when i click a certain button when running. I tried debugging it many times and I'm sure the error comes from the parser. Any Ideas?

  private OnClickListener ButtonClicked= new OnClickListener()
    {
    @Override
    public void onClick(View v)
    {
        Function f = new Function("f(x) = "+funcText.getText().toString());
        Expression xlexp = new Expression("f("+xlText.getText().toString()+")",f);
        Expression xuexp = new Expression("f("+xuText.getText().toString()+")",f);
        double c = xlexp.calculate();
        double d = xuexp.calculate();
        String xlString = String.valueOf(c);
        String xuString = String.valueOf(d);
        fxlText.setText(xlString);
        fxuText.setText(xuString);

    }

    };
   

Update:

These are my inputs

This is the Error Message (I think xD)

Thank you LutzL for keeping up with me :D

added 1 character in body
Source Link
Loading
added 652 characters in body
Source Link
Loading
Source Link
Loading