OneZero第二周第三次站立会议(2016.3.30)

会议时间:2016年3月30日  13:00~13:20

会议成员:冉华,张敏,王巍,夏一鸣。

会议目的:汇报前一天工作,全体成员评论,确定会后修改内容或分配下一步任务。

会议内容:

1.前端,完成功能点为“将获取信息转化为中端所需格式”,“发送获取的信息给中端”。以下是代码部分

 package com.onezero.account;

 import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date; import com.onezero.account.controller.Account;
import com.onezero.account.controller.AccountManager;
import com.onezero.account.controller.AccountManagerImpl; import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast; public class add extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add_main);
// 显示当前时间
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy年MM月dd日 HH:mm:ss");
Date curDate = new Date(System.currentTimeMillis());// 获取当前时间
String str = formatter.format(curDate); TextView mTime = (TextView) findViewById(R.id.mytime);
mTime.setText(str); // 实现事件类型选择,点击并改变显示。
final TextView accounttype = (TextView) findViewById(R.id.accounttype);
// 一般
Button button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button1 = (Button) findViewById(R.id.button1);
accounttype.setText(button1.getText()); }
});
// 餐饮
Button button2 = (Button) findViewById(R.id.button2);
button2.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button2 = (Button) findViewById(R.id.button2);
accounttype.setText(button2.getText()); }
}); // 购物
Button button3 = (Button) findViewById(R.id.button3);
button3.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button3 = (Button) findViewById(R.id.button3);
accounttype.setText(button3.getText()); }
});
// 交通
Button button4 = (Button) findViewById(R.id.button4);
button4.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button4 = (Button) findViewById(R.id.button4);
accounttype.setText(button4.getText()); }
});
// 娱乐
Button button5 = (Button) findViewById(R.id.button5);
button5.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button5 = (Button) findViewById(R.id.button5);
accounttype.setText(button5.getText()); }
}); // 医疗
Button button6 = (Button) findViewById(R.id.button6);
button6.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button6 = (Button) findViewById(R.id.button6);
accounttype.setText(button6.getText()); }
}); Button button7 = (Button) findViewById(R.id.button7);
button7.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
OK(); }
}); } public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.add, menu);
return true;
} @Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml. // 获取“录入”的返回键,并执行返回。
int id = item.getItemId();
if (id == R.id.action_add_back) { onBackPressed();
} return super.onOptionsItemSelected(item);
} // OK按钮
public void OK() { TextView mytime = (TextView) findViewById(R.id.mytime);
String text1 = mytime.getText().toString(); TextView accounttype = (TextView) findViewById(R.id.accounttype);
String text2 = accounttype.getText().toString(); EditText editText1 = (EditText) findViewById(R.id.editText1);
String text3 = editText1.getText().toString(); EditText editText2 = (EditText) findViewById(R.id.editText2);
String text4 = editText2.getText().toString(); if (text3.equals("")) { Log.e("$%^", "toast");
Toast toast = Toast.makeText(add.this, "请输入金额。",
Toast.LENGTH_SHORT);
toast.show();
} else if(text3.equals(".")||text3.substring(0, 1).equals("0")){ Toast toast = Toast.makeText(add.this, "输入有误,请重新输入。",
Toast.LENGTH_SHORT);
toast.show(); } else{ AccountManager accountManager = new AccountManagerImpl();
Account account = new Account();
account.setAccountId(1); try {
account.setAccountDate(new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss").parse(text1));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} account.setAccountType(text2);
account.setAccountSum(text3);
accountManager.addAcount(account); onBackPressed();
} } }

add.java

2.中端,完成功能点为“接收前端发送的数据”,“发送数据给后端”,“提供查询接口”。以下是代码部分

 package com.onezero.account;

 import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date; import com.onezero.account.controller.Account;
import com.onezero.account.controller.AccountManager;
import com.onezero.account.controller.AccountManagerImpl; import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast; public class add extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add_main);
// 显示当前时间
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyy年MM月dd日 HH:mm:ss");
Date curDate = new Date(System.currentTimeMillis());// 获取当前时间
String str = formatter.format(curDate); TextView mTime = (TextView) findViewById(R.id.mytime);
mTime.setText(str); // 实现事件类型选择,点击并改变显示。
final TextView accounttype = (TextView) findViewById(R.id.accounttype);
// 一般
Button button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button1 = (Button) findViewById(R.id.button1);
accounttype.setText(button1.getText()); }
});
// 餐饮
Button button2 = (Button) findViewById(R.id.button2);
button2.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button2 = (Button) findViewById(R.id.button2);
accounttype.setText(button2.getText()); }
}); // 购物
Button button3 = (Button) findViewById(R.id.button3);
button3.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button3 = (Button) findViewById(R.id.button3);
accounttype.setText(button3.getText()); }
});
// 交通
Button button4 = (Button) findViewById(R.id.button4);
button4.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button4 = (Button) findViewById(R.id.button4);
accounttype.setText(button4.getText()); }
});
// 娱乐
Button button5 = (Button) findViewById(R.id.button5);
button5.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button5 = (Button) findViewById(R.id.button5);
accounttype.setText(button5.getText()); }
}); // 医疗
Button button6 = (Button) findViewById(R.id.button6);
button6.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Button button6 = (Button) findViewById(R.id.button6);
accounttype.setText(button6.getText()); }
}); Button button7 = (Button) findViewById(R.id.button7);
button7.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
OK(); }
}); } public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.add, menu);
return true;
} @Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml. // 获取“录入”的返回键,并执行返回。
int id = item.getItemId();
if (id == R.id.action_add_back) { onBackPressed();
} return super.onOptionsItemSelected(item);
} // OK按钮
public void OK() { TextView mytime = (TextView) findViewById(R.id.mytime);
String text1 = mytime.getText().toString(); TextView accounttype = (TextView) findViewById(R.id.accounttype);
String text2 = accounttype.getText().toString(); EditText editText1 = (EditText) findViewById(R.id.editText1);
String text3 = editText1.getText().toString(); EditText editText2 = (EditText) findViewById(R.id.editText2);
String text4 = editText2.getText().toString(); if (text3.equals("")) { Log.e("$%^", "toast");
Toast toast = Toast.makeText(add.this, "请输入金额。",
Toast.LENGTH_SHORT);
toast.show();
} else if(text3.equals(".")||text3.substring(0, 1).equals("0")){ Toast toast = Toast.makeText(add.this, "输入有误,请重新输入。",
Toast.LENGTH_SHORT);
toast.show(); } else{ AccountManager accountManager = new AccountManagerImpl();
Account account = new Account();
account.setAccountId(1); try {
account.setAccountDate(new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss").parse(text1));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} account.setAccountType(text2);
account.setAccountSum(text3);
accountManager.addAcount(account); onBackPressed();
} } }

Account.java

 package com.onezero.account.controller;

 import java.util.List; 

 public interface AccountManager {

     /**
* 添加账本信息
*
* @param account 帐本信息
* @return true 添加成功 false:添加失败
*
*TODO: 需要确认添加失败是否抛出异常,给用户友好提示
*/
boolean addAcount(Account account); /**
* 查询全部账本信息,返回信息按时间降序排序
*
* @return 全部账本信息
*/
List<Account> queryAcount();
}

AccountManager.java

 package com.onezero.account.controller;

 import java.util.Date;
import java.util.List;
import java.util.ArrayList;
public class AccountManagerImpl implements AccountManager{ /**
* 添加账本信息
*
* @param account 帐本信息
* @return true 添加成功 false:添加失败
*
*TODO: 需要确认添加失败是否抛出异常,给用户友好提示
*/
public boolean addAcount(Account account){
// TODO:调用数据库层
return true;
} /**
* 查询全部账本信息,返回信息按时间降序排序
*
* @return 全部账本信息
*/
public List<Account> queryAcount(){
List<Account> accountList = new ArrayList<Account>(); // TODO: 调用数据库层 (暂时写假的)
Account account = new Account();
account.setAccountId(1);
account.setAccountDate(new Date());
account.setAccountType("transportation");
account.setAccountSum("50"); accountList.add(account);
return accountList;
}
}

AccountManagerImpl.java

3.后端,完成功能点为“将获取的数据插入数据库”。

会议体会:昨天布置的任务大家都顺利完成,继续努力。以下是本周的燃尽图,我对昨天的燃尽图进行了修改。

OneZero第二周第三次站立会议(2016.3.30)

以上是OneZero第二周第三次站立会议。

上一篇:【转】Android应用程序窗口(Activity)窗口对象(Window)创建指南


下一篇:EZ 2018 03 30 NOIP2018 模拟赛(六)