Calculating total from SQLite data in android
<p>I am coding a simple android application that accepts input of numeric data and stores it in an SQLite database, how do I calculate the total and display it to the user. </p>

<p>Here is the code for the input</p>

<pre><code>String title = expenseTitle.getText().toString();
        String amount = expenseAmount.getText().toString();
        Date date = new Date( datePicker.getYear() - 1900, datePicker.getMonth(),  datePicker.getDayOfMonth());
        String dateString = date.toString();

        Database myDb = new Database(getApplicationContext());
        SQLiteDatabase expenseDB = myDb.getWritableDatabase();

        ContentValues contentValues = new ContentValues();
        contentValues.put(Database.EXPENSE_TITLE, title);
        contentValues.put(Database.EXPENSE_AMOUNT, amount);
        contentValues.put(Database.EXPENSE_DATE, dateString);
        expenseDB.insert(Database.TABLE_NAME, null, contentValues);
</code></pre>
