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