Android spinner data from database
<p>Here is my code where spinner is getting data from a predefined string. I would like to replace the values with values fetched from database(mysql). There are many tutorials online but nothing suits my need. I dont want to change my original code too much. </p>

<pre><code>EditText client;
Spinner spnr;

TextView alert;
Button recharge;
Button cancel;
String[] packages = {
        "W25",
        "W50",
        "W100",
        "W150",
        "M75",
        "M120",
        "M200",
        "M240",
};


/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_recharge);

    cancel = (Button) findViewById(R.id.btcancel);
    cancel.setOnClickListener(new View.OnClickListener() {
        public void onClick(View arg0) {

            Intent login = new Intent(getApplicationContext(), MainActivity.class);

            startActivity(login);
            finish();
        }

    });


    client = (EditText) findViewById(R.id.client);
    //plan = (EditText) findViewById(R.id.plan);
    alert = (TextView) findViewById(R.id.alertrecharge);
    recharge = (Button) findViewById(R.id.btrecharge);
    spnr = (Spinner)findViewById(R.id.spinner);
    SpinnerWithPadding = (Spinner)findViewById(R.id.spinner);
    ArrayAdapter&lt;String&gt; spinnerArrayAdapter = new ArrayAdapter&lt;String&gt;(
            this,R.layout.simple_spinner_item,packages );

    spinnerArrayAdapter.setDropDownViewResource(R.layout.simple_spinner_item);

    SpinnerWithPadding.setAdapter(spinnerArrayAdapter);

    recharge.setOnClickListener(new View.OnClickListener() {

        public void onClick(View view) {

            if ((!client.getText().toString().equals(""))) {
                NetAsync(view);
            } else if ((!client.getText().toString().equals(""))) {
                Toast.makeText(getApplicationContext(),
                        "Plan field empty", Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(getApplicationContext(),
                        "Phone number field empty", Toast.LENGTH_SHORT).show();
            }
        }
    });
}
</code></pre>