title: Android add digits together of a number
body: <p>In my android code.. I need to add the digits of a number together and check whether the value is equal to numbers 13,14,16 and 19.. So the app is about numerology where when user enter his first name.. each letter has a value between 1-9 so all these values are taken and the values are added together... and will check if the value is 13,14,16 or 19.. I am giving my code below... but the code is giving a single digit ..only ..</p>
  
  <p>mainactivity</p>
  
  <pre><code>long kar1 = 0;
  kar1 = getKar1(et1.getText().toString();
  
  private long getKar1(String text) {
          // TODO Auto-generated method stub
           long kar1 = 0;
              char[] karmi1 = new char[text.length()];
                     karmi1 = text.toCharArray();               
                     for(int i=0; i&lt;text.length(); i++)
                     {
                         kar1 += value1( karmi1[i] );
  
                     }
  
                     while ((kar1!= 13)||(kar1!=14)||(kar1!=16)||(kar1!=19))
                     {
                         kar1 = findSum(kar1);
                     }
  
                  return kar1;
  
      }
  
  
  
  
  
  
  
  private int value1(char a) 
  
      {
          // TODO Auto-generated method stub
          switch(a)
          {
             case 'A':return 1;    
             case 'B':return 2;
             case 'C':return 3;
             case 'D':return 4;
             case 'E':return 5;
             case 'F':return 6;
             case 'G':return 7;
             case 'H':return 8;
             case 'I':return 9;
             case 'J':return 1;
             case 'K':return 2;
             case 'L':return 3;
             case 'M':return 4;
             case 'N':return 5;
             case 'O':return 6;
             case 'P':return 7;
             case 'Q':return 8;
             case 'R':return 9;
             case 'S':return 1;          
             case 'T':return 2;
             case 'U':return 3;
             case 'V':return 4;
             case 'W':return 5;
             case 'X':return 6;
             case 'Y':return 7;
             case 'Z':return 8;
             default: return 0;   
          }   
      }
  
  
  
  
  private long findSum(long n) 
  
      {
          // TODO Auto-generated method stub
  
          int kar1 = 0;
          while (n != 0)
          {
           kar1 += n % 10;
           n = n / 10;
          }          
  
          return kar1;
      }
  </code></pre>