title: android - speech recognition for Arabic language
body: <p>I am developing a speech recognition system, I have made one with English language and it worked very well.</p>
  
  <p>But what i am having problem with is that I need to develop the app to recognize Arabic language.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>private static final int RESULT_SPEECH = 1;
  
  Button b1 ;
  ListView lv;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      lv = (ListView) findViewById(R.id.listView1);
      b1 = (Button) findViewById(R.id.button1);
  
      b1.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent voicerecogize = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
              voicerecogize.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "ar-eg");
              startActivityForResult(voicerecogize, RESULT_SPEECH);
  
          }
      });
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if(requestCode == RESULT_SPEECH &amp;&amp; requestCode == RESULT_OK);
      {
    ArrayList&lt;String &gt; results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
    lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , results));
      }
  
      super.onActivityResult(requestCode, resultCode, data);
  }
  </code></pre>