title: Store String Key-value pair
body: <p>I am developing an android app, the main work of app is there is a scanner and i have to scan again &amp; again and store result in key value pair.</p>
  
  <pre><code>  [
     {
      "0" : "816444014066",
      "1" : "747083010945",
      "2" : "816444010969"
    }
   ]
  </code></pre>
  
  <p>and by API i have to send all the scan result by array.
  I am getting scan result by another activity by startActivityForResult.User will scan again and again and by onActivityResult user will get result.i have to store all the result in key value pair and finally there is a button by tap on button by POST request i have to send all the scan result by array like above code.</p>
  
  <p>Can i use here HashMap or i have to use Shared Preferences for storing result.</p>
  
  <pre><code>// Call Back method  to get the Message form other Activity
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          // check if the request code is same as what is passed  here it is 2
          if (requestCode == 2 &amp;&amp; data!=null) {
              String message = data.getStringExtra(SCAN_RESULT);
              // textView1.setText(message);
              if(message!= null){
                  Log.e("SCAN_RESULT", "" + message);
  
                  //Adding code will be here
  
  
                }
          }
      }
  </code></pre>