Android Open Source - AndroidCouponAssistant Statistics Activity






From Project

Back to project page AndroidCouponAssistant.

License

The source code is released under:

MIT License

If you think the Android project AndroidCouponAssistant listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.corylucasjeffery.couponassistant.activities;
// w w  w .  ja  v a 2  s .  c o m
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.corylucasjeffery.couponassistant.PhpWrapper;
import com.corylucasjeffery.couponassistant.R;
import com.corylucasjeffery.couponassistant.Statistics;

public class StatisticsActivity extends Activity {

    private Context context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.v("STAT", "onCreate");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_statistics);
        Log.v("STAT", "finish onCreate");
        context = this;

        PhpWrapper db = new PhpWrapper();
        //setup the list display
        Statistics stats = db.getStatistics(this);

        TextView boughtText = (TextView) findViewById(R.id.list_statistics_bought);
        boughtText.setText("Unique Items Bought: " + stats.getBought());
        TextView totalText = (TextView) findViewById(R.id.list_statistics_total);
        totalText.setText("Total Coupons Submitted: " + stats.getTotal());
        TextView dayText = (TextView) findViewById(R.id.list_statistics_day);
        dayText.setText("Submitted Today: " + stats.getDay());
        TextView weekText = (TextView) findViewById(R.id.list_statistics_week);
        weekText.setText("Submitted this Week: " + stats.getWeek());
        TextView monthText = (TextView) findViewById(R.id.list_statistics_month);
        monthText.setText("Submitted this Month: " + stats.getMonth());
        TextView yearText = (TextView) findViewById(R.id.list_statistics_year);
        yearText.setText("Submitted this Year: " + stats.getYear());


    }



    public void onBackPressed() {
        super.onBackPressed();
        Intent intent = new Intent(context, MainActivity.class);
        startActivity(intent);
    }

    public void onStop() {
        super.onStop();
        finish();
    }

    public void onDestroy() {
        super.onDestroy();
        finish();
    }

}




Java Source Code List

com.corylucasjeffery.couponassistant.BMPtoBlob.java
com.corylucasjeffery.couponassistant.BarcodeGenerator.java
com.corylucasjeffery.couponassistant.BlobtoBMP.java
com.corylucasjeffery.couponassistant.CameraPreview.java
com.corylucasjeffery.couponassistant.CouponAdapter.java
com.corylucasjeffery.couponassistant.Coupon.java
com.corylucasjeffery.couponassistant.DateChooserDialog.java
com.corylucasjeffery.couponassistant.DbGetCoupons.java
com.corylucasjeffery.couponassistant.DbPurchaseItem.java
com.corylucasjeffery.couponassistant.DbSubmitCoupon.java
com.corylucasjeffery.couponassistant.DbSubmitItem.java
com.corylucasjeffery.couponassistant.DbUserRegister.java
com.corylucasjeffery.couponassistant.DbUserStats.java
com.corylucasjeffery.couponassistant.GlobalCart.java
com.corylucasjeffery.couponassistant.Item.java
com.corylucasjeffery.couponassistant.ManualEntryDialog.java
com.corylucasjeffery.couponassistant.ParseUPC.java
com.corylucasjeffery.couponassistant.PhpWrapper.java
com.corylucasjeffery.couponassistant.ProgressBarHelper.java
com.corylucasjeffery.couponassistant.Statistics.java
com.corylucasjeffery.couponassistant.UserInfo.java
com.corylucasjeffery.couponassistant.ValueCodeDict.java
com.corylucasjeffery.couponassistant.activities.AndroidBarcodeView.java
com.corylucasjeffery.couponassistant.activities.CheckoutActivity.java
com.corylucasjeffery.couponassistant.activities.LoginActivity.java
com.corylucasjeffery.couponassistant.activities.MainActivity.java
com.corylucasjeffery.couponassistant.activities.SettingsActivity.java
com.corylucasjeffery.couponassistant.activities.ShowCouponsActivity.java
com.corylucasjeffery.couponassistant.activities.StatisticsActivity.java
com.google.zxing.integration.android.IntentIntegrator.java
com.google.zxing.integration.android.IntentResult.java