Android's Book of accounts

Source: Internet
Author: User

Colabox Notepad from the register revenue and expenses jump to the billing page using SQL input, the structure of the table is:

Db.execsql ("CREATE TABLE Bills ("+"_id INTEGER primary key AutoIncrement,"//ID+"acctitemid Integer,"//type of account+"fee Integer,"//Fees+"userid Integer,"//User+"sdate TEXT,"//Date+"stime TEXT,"//Time+"desc TEXT"    //Notes+");");
Main class Colabox:
Package Com.cola.ui;import Android.app.activity;import android.content.intent;import android.os.bundle;import Android.os.handler;import Android.os.message;import Android.util.log;import Android.view.keyevent;import Android.widget.imageview;import Android.widget.TextView; Public classColabox extends Activity {PrivateHandler Mhandler =NewHandler ();    ImageView ImageView;    TextView TextView; intAlpha =255; intb =0;  Public voidonCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);        Setcontentview (R.layout.main); ImageView= (ImageView) This. Findviewbyid (R.ID.IMAGEVIEW01); TextView= (TextView) This. Findviewbyid (R.ID.TEXTVIEW01); LOG.V ("Colabox","colabox start ...");        Imageview.setalpha (Alpha); NewThread (NewRunnable () { Public voidrun () {Initapp ();  while(b <2) {                    Try {                        if(b = =0) {Thread.Sleep ( +); b=1; } Else{Thread.Sleep ( -);                    } Updateapp (); } Catch(interruptedexception e) {e.printstacktrace ();        }}}). Start (); Mhandler=NewHandler () {@Override Public voidhandlemessage (Message msg) {super.handlemessage (msg);                Imageview.setalpha (Alpha);            Imageview.invalidate ();    }        }; }     Public voidUpdateapp () {Alpha-=5; if(Alpha <=0) {b=2; Intentinch=NewIntent ( This, Com.cola.ui.Frm_Addbills.class); StartActivity (inch);  This. Finish ();    } mhandler.sendmessage (Mhandler.obtainmessage ()); }         Public voidInitapp () {billdbhelper billdb=NewBilldbhelper ( This); Billdb.                     Firststart ();                          Billdb.close (); }     PublicBoolean OnKeyDown (intKeyCode, KeyEventEvent) {LOG.V ("Cola","keycode="+keycode); Switch(keycode) { CaseKEYEVENT.KEYCODE_BACK:LOG.V ("Colabox","Colabox End ..."); return true; }        return false; }}

Operating effect:

Android's Book of accounts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.