MVP???Android??ò???????????
???????????? ???????[ 2015/7/13 10:01:34 ] ???????????????
??????????????????????дUI?????????????????????????????????Presenter??????????????????????????????????UI???????????????????????Presenter??????
????public class Presenter {
????private IInfoModel infoModel;
????private IInfoView infoView;
????public Presenter(IInfoView infoView) {
????this.infoView = infoView;
????infoModel = new InfoModelImpl();
????}
????//??UI????
????public void saveInfo(InfoBean bean) {
????infoModel.setInfo(bean);
????}
????//??UI????
????public void getInfo() {
????//???????IInfoView?????????????????????????
????//??????????????
????infoView.setInfo(infoModel.getInfo());
????}
????}
????????????????View?????View??????????View???????????????Activity????UI View????
????????????View?????????
????public class MainActivity extends ActionBarActivity implements IInfoView?? View.OnClickListener{
????private EditText inputId?? inputName?? inputAddr;
????private Button saveBtn?? loadBtn;
????private TextView infoTxt;
????private Presenter presenter;
????@Override
????protected void onCreate(Bundle savedInstanceState) {
????super.onCreate(savedInstanceState);
????setContentView(R.layout.activity_main);
????initData();
????}
????private void initData() {
????presenter = new Presenter(this);
????inputId = (EditText) findViewById(R.id.id_input);
????inputName = (EditText) findViewById(R.id.name_input);
????inputAddr = (EditText) findViewById(R.id.addr_input);
????saveBtn = (Button) findViewById(R.id.input_confirm);
????loadBtn = (Button) findViewById(R.id.get_confirm);
????infoTxt = (TextView) findViewById(R.id.show);
????saveBtn.setOnClickListener(this);
????loadBtn.setOnClickListener(this);
????}
????@Override
????public void setInfo(InfoBean info) {
????StringBuilder builder = new StringBuilder("");
????builder.append(info.getId());
????builder.append(" ");
????builder.append(info.getName());
????builder.append(" ");
????builder.append(info.getAddress());
????infoTxt.setText(builder.toString());
????}
????@Override
????public InfoBean getInfo() {
????InfoBean info = new InfoBean();
????info.setId(Integer.parseInt(inputId.getText().toString()));
????info.setName(inputName.getText().toString());
????info.setAddress(inputAddr.getText().toString());
????return info;
????}
????@Override
????public void onClick(View v) {
????switch (v.getId()) {
????case R.id.input_confirm:
????presenter.saveInfo(getInfo());
????break;
????case R.id.get_confirm:
????presenter.getInfo();
????break;
????}
????}
????}
????????????п?????App??????????????????????н????
????????????????????????????
???????
???????????????????????View??Activity?????????????????????????????????????????????Presenter???????Presenter????Model??????????????????View??????????View????????????????????????????UI???????????
??????????????????????App???????????????????????????С??App?????????????????App??????????????????????????????????????????дtest???????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Android???????????????Щ???????????Android????????????????????????Щ??Android ??????????????????????????APP?????android???????????????Android App ?????????Android Unit Test ?????Android?????????Robolectric3.0????(?)Android??????????????Android Studio???????????Android????MySQL????????????????Android MVP???????Android ?????????ActiveAndroid??дAndroid??????????????????????Android????????Java??????????Android????????Java8Java / Android ????????????????Щ??
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????