Partage
  • Partager sur Facebook
  • Partager sur Twitter

[Android] Calcul algébrique dans un String

    24 juin 2012 à 21:26:14

    Bonjour,

    Je programme sous Android est je suis en train de créer une calculatrice (Je débute).
    A chaque fois que j'appuis sur un Button (ex : Le chiffre 1), le EditText (non modifable) affiche 1.
    Maintenant lorsque j'entre un calcul algébrique (4+1),
    Je récupère ce calcul (je récupère donc une chaîne de caractères), je ne vois pas comment la calculer.

    J'ai bien une idée c'est de mettre chacun des caractère dans un tableau mais je ne sais pas comment m'y prendre.

    Merci d'avoir lut,

    Cordialement,
    • Partager sur Facebook
    • Partager sur Twitter
      24 juin 2012 à 21:45:12

      ben si tu as un string ex String t="mdr";
      char[] t1;

      t1 = t.toCharArray();

      dans t1[0] tu as m dans t1[1] tu as d ...
      • Partager sur Facebook
      • Partager sur Twitter
        25 juin 2012 à 0:32:29

        Désolé mais mon app plante voici mon morxeau de code
        calculA = scalc.toCharArray();
        		    float f1 = Float.valueOf(calculA[0]);
        			float f2 = Float.valueOf(calculA[1]);
        			float f3 = f1 + f2;
        			barre.setText(String.valueOf(f3));
        

        Je ne vois pas l'erreur mais un programmeur plus avancé devrai la trouver.
        Merci de votre et aide.
        • Partager sur Facebook
        • Partager sur Twitter
          25 juin 2012 à 0:40:54

          Tu utilises des float que tu convertis en char, mais il est fort probable que ton float soit plus grand qu'un caractère (à moins que tu ne te limites au chiffres de 0 à 9).

          Dans ton cas, si tu as 42 et 13, il te le convertira en :
          calculA[0] = 4;
          calculA[1] = 2;
          calculA[2] = 1;
          calculA[3] = 3;
          • Partager sur Facebook
          • Partager sur Twitter

          cd514331234507.564a1d2324e4e.gifCTO Co-fondateur @ My Talent Manager : boostez votre carrière d'artiste | https://mytalentmanager.fr

            25 juin 2012 à 1:08:23

            bon tu récupères les chars et tu les stacks jusqu'a ce que tu tombe sur un opérateur tu as ton 1er nombre ensuite tu récupère le deuxième jusqu'au prochain opérateur ou rien.

            ex : 444444+0+88.99

            tu récup 4 parce que c'est != de + - * / .... tu arrives sur + tu as ton premier nombre tu continues 0 != de +-*/ tu arrives sur + tu as ton 2ème nombre 8 tu stacks .... le dernier 9 tu stack tu arrive à la fin tu fais nbr1+nbr2+nbr3
            • Partager sur Facebook
            • Partager sur Twitter
              25 juin 2012 à 12:06:20

              Bonjour,

              Je suppose que tu as créé ton topic dans le forum Java. Tu apprendras donc qu'il existe un forum "Mobile" avec certaines règles à suivre, surtout concernant le titre.

              Je l'ai donc modifié pour cette fois, merci de faire attention à l'avenir concernant ces deux points.

              Pour ton problème, as-tu déjà essayé d'adapter la calculatrice du tutoriel Java pour ton application Android ?
              • Partager sur Facebook
              • Partager sur Twitter
              Si vous voulez me retrouver, rendez-vous sur ZesteDeSavoir.
                25 juin 2012 à 13:10:05

                Merci pour vos idée

                Mais à chaque fois que je teste une solution mon app plante alors j'ai voulut testé un code pour vérifié que ce n'est pas mon code qui fait planté mais bien la fonction toCharArray, voici le code en question (aucune erreur de compilation)
                J'ai fait ce code uniquement dans le but de testé, il consite à : lorsque l'utilisateur appuis sur le bouton égal seul le premier chiffre tapé s'affiche( ex 123 retourne 1 )
                calculA = scalc.toCharArray();
                scalc = String.valueOf(calculA[0]); 
                barre.setText(scalc);
                


                D'avance

                Edit : PS : Ca ne marche pas non plu
                • Partager sur Facebook
                • Partager sur Twitter
                  29 juin 2012 à 23:45:46

                  Bonsoir,

                  Nous ne pouvons pas tout faire: si tu ne postes pas l'erreur en question, nous sommes incapables de t'aider.

                  Regarde le LogCat, c'est l'équivalent de la console et cela t'apportera plein d'informations sur les causes du crash de ton appli.
                  • Partager sur Facebook
                  • Partager sur Twitter
                    30 juin 2012 à 0:13:09

                    Désole pour le manque d'informations.
                    Voici le LogCat et d'après ce que j'ai comprit c'est le main qui pose problème.

                    06-29 23:06:02.324: D/AndroidRuntime(366): Shutting down VM
                    06-29 23:06:02.324: W/dalvikvm(366): threadid=1: thread exiting with uncaught exception (group=0x40015560)
                    06-29 23:06:02.345: E/AndroidRuntime(366): FATAL EXCEPTION: main
                    06-29 23:06:02.345: E/AndroidRuntime(366): java.lang.NullPointerException
                    06-29 23:06:02.345: E/AndroidRuntime(366): at com.calculatrice.by.cemal.CalculatriceActivity$14.onClick(CalculatriceActivity.java:103)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at android.view.View.performClick(View.java:2485)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at android.view.View$PerformClick.run(View.java:9080)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at android.os.Handler.handleCallback(Handler.java:587)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at android.os.Handler.dispatchMessage(Handler.java:92)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at android.os.Looper.loop(Looper.java:130)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at android.app.ActivityThread.main(ActivityThread.java:3683)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at java.lang.reflect.Method.invokeNative(Native Method)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at java.lang.reflect.Method.invoke(Method.java:507)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
                    06-29 23:06:02.345: E/AndroidRuntime(366): at dalvik.system.NativeStart.main(Native Method)

                    Voici le src Java :

                    package com.calculatrice.by.cemal;
                    
                    import android.app.Activity;
                    import android.os.Bundle;
                    import android.widget.EditText;
                    import android.view.View.OnClickListener;
                    import android.view.KeyEvent;
                    import android.widget.Button;
                    import android.view.View;
                    
                    
                    
                    public class CalculatriceActivity extends Activity {
                        EditText barre = null;
                        Button b1 = null, b2 = null, b3 = null, b4 = null;
                        Button b5 = null, b6 = null, b7 = null, b8 = null;
                        Button b9 = null, b0 = null, bx = null, be = null;
                        Button bplus = null, bmoins = null, bc = null;
                        String scalc = null;
                        char[] calculA;
                        
                        private OnClickListener b1E = new View.OnClickListener() {
                            public void onClick(View v) {
                     	   barre.setText(barre.getText().toString() + String.valueOf("1"));
                    	}
                        };
                    
                        private OnClickListener b2E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("2"));
                    	}
                        };
                    
                        private OnClickListener b3E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("3"));
                    	}
                        };
                    
                        private OnClickListener b4E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("4"));
                    	}
                        };
                    
                        private OnClickListener b5E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("5"));
                    	}
                        };
                    
                        private OnClickListener b6E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("6"));
                    	}
                        };
                    
                        private OnClickListener b7E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("7"));
                    	}
                        };
                    
                        private OnClickListener b8E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("8"));
                    	}
                        };
                    
                        private OnClickListener b9E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("9"));
                    	}
                        };
                    
                        private OnClickListener b0E = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("0"));
                    	}
                        };
                    
                        private OnClickListener bplusE = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("+"));
                    	}
                        };
                    
                        private OnClickListener bmoinsE = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("-"));
                    	}
                        };
                    
                        private OnClickListener bxE = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText(barre.getText().toString() + String.valueOf("*"));
                    	}
                        };
                    
                        private OnClickListener beE = new View.OnClickListener() {
                            public void onClick(View v) {
                            	
                            	calculA = scalc.toCharArray();
                            	scalc = String.valueOf(calculA[0]); 
                            	barre.setText(scalc);
                            	
                    	}
                        };
                    
                        private OnClickListener bcE = new View.OnClickListener() {
                            public void onClick(View v) {
                            	barre.setText("");
                    	}
                        };
                    
                        
                        
                        @Override
                        public void onCreate(Bundle savedInstanceState) {
                            super.onCreate(savedInstanceState);
                            setContentView(R.layout.main);
                            
                            barre = (EditText)findViewById(R.id.barre);
                            b1 = (Button)findViewById(R.id.b1);
                            b2 = (Button)findViewById(R.id.b2);
                            b3 = (Button)findViewById(R.id.b3);
                            b4 = (Button)findViewById(R.id.b4);
                            b5 = (Button)findViewById(R.id.b5);
                            b6 = (Button)findViewById(R.id.b6);
                            b7 = (Button)findViewById(R.id.b7);
                            b8 = (Button)findViewById(R.id.b8);
                            b9 = (Button)findViewById(R.id.b9);
                            b0 = (Button)findViewById(R.id.b0);
                            bx = (Button)findViewById(R.id.bx);
                            be = (Button)findViewById(R.id.be);
                            bc = (Button)findViewById(R.id.bc);
                            bmoins = (Button)findViewById(R.id.bmoins);
                            bplus = (Button)findViewById(R.id.bplus);
                            
                            barre.setKeyListener(null);
                            
                            b1.setOnClickListener(b1E);
                            b2.setOnClickListener(b2E);
                            b3.setOnClickListener(b3E);
                            b4.setOnClickListener(b4E);
                            b5.setOnClickListener(b5E);
                            b6.setOnClickListener(b6E);
                            b7.setOnClickListener(b7E);
                            b8.setOnClickListener(b8E);
                            b9.setOnClickListener(b9E);
                            b0.setOnClickListener(b0E);
                            bmoins.setOnClickListener(bmoinsE);
                            bplus.setOnClickListener(bplusE);
                            be.setOnClickListener(beE);
                            bx.setOnClickListener(bxE);
                            bc.setOnClickListener(bcE);
                        }
                    }
                    


                    Le code XML:
                    <?xml version="1.0" encoding="utf-8"?>
                    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent" >
                    
                        <EditText
                              android:id="@+id/barre"
                    	      android:layout_width="fill_parent" 
                    	      android:layout_height="wrap_content" 
                        /> 
                        <Button  
                    		  android:id="@+id/b7"
                    		  android:layout_width="135px" 
                    	      android:layout_height="135px" 
                    	      android:text="7" 
                    	      android:layout_below="@id/barre"
                    	    />
                        <Button  
                    	   	  android:id="@+id/b8"
                    	   	  android:layout_width="135px" 
                    	   	  android:layout_height="135px" 
                    	      android:text="8" 
                    	      android:layout_toRightOf="@id/b7"
                    	   	  android:layout_below="@id/barre"
                    	    />
                       	<Button  
                    		   android:id="@+id/b9"
                    		   android:layout_width="135px" 
                    		   android:layout_height="135px" 
                    		   android:text="9" 
                    		   android:layout_toRightOf="@id/b8"
                    	       android:layout_below="@id/barre"
                    	    />
                       	<Button
                       	  	   android:id="@+id/bx"
                       	 	   android:layout_width="135px" 
                       	 	   android:layout_height="135px" 
                       	 	   android:text="X" 
                       	 	   android:textSize="18dp"
                       	 	   android:textStyle="bold"
                       	 	   android:layout_alignParentRight="true"
                       	 	   android:layout_below="@id/barre"
                       	    />
                       	  <Button  
                    	  	  android:id="@+id/b4"
                    	  	  android:layout_width="135px" 
                    	   	  android:layout_height="135px" 
                    	  	  android:text="4" 
                    	    android:layout_below="@id/b7"
                    	    />
                       	   <Button  
                    	  	    android:id="@+id/b5"
                    	  	    android:layout_width="135px" 
                    	  	    android:layout_height="135px" 
                    		    android:text="5" 
                    		    android:layout_below="@id/b7"
                    		    android:layout_toRightOf="@id/b4"
                    	    />
                       	   
                       	   <Button  
                    	 	    android:id="@+id/b6"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="6" 
                    		    android:layout_below="@id/b7"
                    		    android:layout_toRightOf="@id/b5"
                    	    />
                       	   
                        	 <Button  
                    	 	    android:id="@+id/bmoins"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="-" 
                    		    android:textSize="18dp"
                       	 	    android:textStyle="bold"
                    		    android:layout_below="@id/b7"
                    		    android:layout_alignParentRight="true"
                    	    />  	   
                       	   
                        	 
                       	   	<Button  
                    	  	    android:id="@+id/b1"
                    	  	    android:layout_width="135px" 
                    	   	    android:layout_height="135px" 
                    	  	    android:text="1" 
                    	        android:layout_below="@id/b4"
                    	    />
                       	   <Button  
                    	  	    android:id="@+id/b2"
                    	  	    android:layout_width="135px" 
                    	  	    android:layout_height="135px" 
                    		    android:text="2" 
                    		    android:layout_below="@id/b4"
                    		    android:layout_toRightOf="@id/b1"
                    	    />
                       	   
                       	   <Button  
                    	 	    android:id="@+id/b3"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="3" 
                    		    android:layout_below="@id/b4"
                    		    android:layout_toRightOf="@id/b2"
                    	    />
                       	   
                       	    <Button  
                    	 	    android:id="@+id/bplus"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="+" 
                    		    android:textSize="18dp"
                       	 	    android:textStyle="bold"
                    		    android:layout_below="@id/b4"
                    		    android:layout_alignParentRight="true"
                    	    />
                       	    
                       	    <Button  
                    	 	    android:id="@+id/bc"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="C" 
                    		    android:textSize="18dp"
                       	 	    android:textStyle="bold"
                       	 	    android:textColor="#FF0000"
                    		    android:layout_below="@id/b1"
                    	    />
                       	    
                       	    <Button  
                    	 	    android:id="@+id/b0"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="0" 
                    		    android:layout_below="@id/b1"
                    		    android:layout_toRightOf="@id/bc"
                    	    />
                       	    
                       	     <Button  
                    	 	    android:id="@+id/be"
                    	 	    android:layout_width="135px" 
                    		    android:layout_height="135px" 
                    		    android:text="=" 
                    		    android:textSize="18dp"
                       	 	    android:textStyle="bold"
                    		    android:layout_below="@id/b1"
                    		    android:layout_toRightOf="@id/b0"
                    	    />
                        
                    </RelativeLayout>
                    


                    Je sais je n'ai pas utilisé de value.xml. Je recommencerai plus :'(


                    Cordialement
                    • Partager sur Facebook
                    • Partager sur Twitter
                      30 juin 2012 à 0:35:57

                      C'est simple, tu as une NullPointerException à la ligne 103:
                      calculA = scalc.toCharArray();
                      

                      C'est sans doute scalc qui est égal à null.
                      • Partager sur Facebook
                      • Partager sur Twitter
                        30 juin 2012 à 7:26:10

                        Bonjour,
                        Alors cette fois pa de plantage mais sa ne fait rien

                        barre1 = barre.getText(); // on recuperre la barrr de calcul
                        			scalc = String.valueOf(barre1);// c'est une variable de type editable donc on la passe en String
                        			calculA = scalc.toCharArray();// on range chaque caractère dans un tableau
                        			scalc2 = String.valueOf(calculA[0]);//on prend le 1er nombre saisi
                        			barre.setText(scalc); //on l'affiche
                        


                        Cordialement
                        • Partager sur Facebook
                        • Partager sur Twitter
                        Anonyme
                          2 juillet 2012 à 16:00:37

                          Personnellement, j'aurais tendance à faire quelque chose comme ça:
                          String calcul = "1400 + 15";
                          
                          String[] operators = new String[] { "+", "-", "*", "/" };
                          int operatorPosition = -1;
                          for (String op : operators)
                          {
                          	operatorPosition = calcul.indexOf(op);
                          	if (operatorPosition != -1) break;
                          }
                          
                          if (operatorPosition == -1)
                          {
                          	throw new Exeption("No operating symbol found!");
                          	return;
                          }
                          
                          String partLeft = calcul.substring(0, operatorPosition - 1).trim();
                          float numberLeft = Float.parseFloat(partLeft);
                          String partRight = calcul.substring(operatorPosition, calcul.length).trim();
                          float numberRight = Float.parseFloat(partRight);
                          
                          if (op.equals("+"))
                          {
                          	return (numberLeft + numberRight);
                          }
                          else if (op.equals("-"))
                          {
                          	return (numberLeft + numberRight);
                          }
                          else if (op.equals("*"))
                          {
                          	return (numberLeft * numberRight);
                          }
                          else if (op.equals("/"))
                          {
                          	if (numberRight == 0.0) throw new Exeption("Divide by 0!");
                          	return (numberLeft / numberRight);
                          }
                          else
                          {
                          	throw new Exeption("Bad operator!");
                          }
                          


                          Qui du coup fonctionne pour à peu près toutes les opérations et quelque soit la taille des nombres.
                          • Partager sur Facebook
                          • Partager sur Twitter
                            2 juillet 2012 à 16:13:36

                            @Geeky: pour la division, ajoute un test afin d'éviter de diviser par 0. ;)
                            • Partager sur Facebook
                            • Partager sur Twitter
                            Anonyme
                              2 juillet 2012 à 16:30:03

                              Citation : Fumble

                              @Geeky: pour la division, ajoute un test afin d'éviter de diviser par 0. ;)



                              Oui tu as parfaitement raison. Mon code est loin d'être parfait, j'ai fais ça bien trop rapidement pour qu'il le soit de toutes façons.
                              • Partager sur Facebook
                              • Partager sur Twitter
                                3 juillet 2012 à 21:06:05

                                Merci d'avoir répondu mais j'ai toujours l'application qui plante.
                                Voici mon logCat:
                                07-03 19:03:39.093: D/AndroidRuntime(416): Shutting down VM
                                07-03 19:03:39.113: W/dalvikvm(416): threadid=1: thread exiting with uncaught exception (group=0x40015560)
                                07-03 19:03:39.133: E/AndroidRuntime(416): FATAL EXCEPTION: main
                                07-03 19:03:39.133: E/AndroidRuntime(416): java.lang.NullPointerException
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at com.calculatrice.by.cemal.CalculatriceActivity.calculf(CalculatriceActivity.java:27)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at com.calculatrice.by.cemal.CalculatriceActivity$14.onClick(CalculatriceActivity.java:146)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at android.view.View.performClick(View.java:2485)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at android.view.View$PerformClick.run(View.java:9080)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at android.os.Handler.handleCallback(Handler.java:587)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at android.os.Handler.dispatchMessage(Handler.java:92)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at android.os.Looper.loop(Looper.java:130)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at android.app.ActivityThread.main(ActivityThread.java:3683)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at java.lang.reflect.Method.invokeNative(Native Method)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at java.lang.reflect.Method.invoke(Method.java:507)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
                                07-03 19:03:39.133: E/AndroidRuntime(416):         at dalvik.system.NativeStart.main(Native Method)


                                et mon code :
                                String[] operators = new String[] { "+", "-", "*", "/" };
                                    int operatorPosition = -1;
                                    String calcul;
                                    // la fonction calculer
                                    float calculf() {
                                    	String op;
                                
                                    	op = operators[1];
                                    		operatorPosition = calcul.indexOf(op);
                                        op = operators[2];
                                    		operatorPosition = calcul.indexOf(op);
                                        op = operators[3];
                                    		operatorPosition = calcul.indexOf(op);
                                        op = operators[4];
                                    		operatorPosition = calcul.indexOf(op);
                                    	
                                    	Editable barre1 = barre.getText(); // on recuperre la barrr de calcul
                                		calcul = String.valueOf(barre1);// c'est une variable de type editable donc on la passe en String
                                		
                                
                                		String partLeft = calcul.substring(0, operatorPosition - 1).trim();
                                		float numberLeft = Float.parseFloat(partLeft);
                                		String partRight = calcul.substring(operatorPosition, calcul.length()).trim();
                                		float numberRight = Float.parseFloat(partRight);
                                		
                                		
                                		if (op.equals("+"))
                                		{
                                			return (numberLeft + numberRight);
                                		}
                                		else if (op.equals("-"))
                                		{
                                			return (numberLeft + numberRight);
                                		}
                                		else if (op.equals("*"))
                                		{
                                			return (numberLeft * numberRight);
                                		}
                                		else if (op.equals("/"))
                                		{
                                			return (numberLeft / numberRight);
                                		}
                                		return 0;
                                
                                    }
                                

                                //l'évenement bouton
                                    private OnClickListener beE = new View.OnClickListener() {
                                        public void onClick(View v) {
                                        	calculf();
                                			
                                	}
                                    };
                                


                                Cordialement
                                • Partager sur Facebook
                                • Partager sur Twitter
                                  3 juillet 2012 à 21:14:20

                                  Il faut apprendre à lire aussi:
                                  07-03 19:03:39.133: E/AndroidRuntime(416): java.lang.NullPointerException
                                  07-03 19:03:39.133: E/AndroidRuntime(416):         at com.calculatrice.by.cemal.CalculatriceActivity.calculf(CalculatriceActivity.java:27)
                                  07-03 19:03:39.133: E/AndroidRuntime(416):         at com.calculatrice.by.cemal.CalculatriceActivity$14.onClick(CalculatriceActivity.java:146)

                                  C'est assez clair je pense.
                                  • Partager sur Facebook
                                  • Partager sur Twitter

                                  [Android] Calcul algébrique dans un String

                                  × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                                  × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                                  • Editeur
                                  • Markdown