title: How to save file on external SDCARD on android MotorolaARTIX2 device?
body: <p>I would like to save a file on external SdCard.I have implemented an application for save a file on external sdcard.But my Android MotorolaARTIX2 device contains internal sdcard.When i am trying to save file on external sdcard it always saving to internal sdcard in my device.</p>
  
  <p>I have implemented my application as follows:</p>
  
  <pre><code>     try {
          File root = Environment.getExternalStorageDirectory();
          if (root.canWrite()){
              File file = new File(root, "myfile.txt");
              FileWriter gpxwriter = new FileWriter(file);
              BufferedWriter out = new BufferedWriter(gpxwriter);
              out.write("Hello world");
              out.close();
          }
      } catch (IOException e) {
          Log.e("Exception", "Could not write file " + e.getMessage());
      }
  </code></pre>
  
  <p>From the above code my application always saving myfile.txt file on internal sdcard but not external sdcard-ext.And my application is support all devices with same code.</p>
  
  <p>How can i save myfile.txt on sdcard-ext(external) not on sdcard(internal) in my device?</p>
  
  <p>please any body help me....</p>