团队第二阶段冲刺02
一、前言
1、昨天完成了:
添加文献智能分析功能:我们将引入自然语言处理技术,实现文献的智能化分析和处理,如文献关键词提取、主题分析、情感分析等。
2、今天完成了:
改进文献检索算法:我们将优化检索算法,提高检索的准确性和速度,并支持多种检索方式,如关键词检索、主题检索、作者检索等。
3、遇到的困难:
检索的功能还不够完善,还需要继续改进
二、冲刺进度
-
1.任务量:10天
目前已经花费的时间:1天
还剩余的时间:9天
三、逻辑代码
public class MainActivity extends AppCompatActivity { private Button buttonCode, buttonLogin; private EditText editTextPhoneNum, editTextCode; private String phoneNum, code; private EventHandler eh; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); buttonCode = findViewById(R.id.buttonCode); buttonLogin = findViewById(R.id.buttonLogin); editTextCode = findViewById(R.id.editTextCode); editTextPhoneNum = findViewById(R.id.editTextPhoneNum); eh = new EventHandler() { @Override public void afterEvent(int event, int result, Object data) { if (result == SMSSDK.RESULT_COMPLETE) { //回调完成 if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) { //提交验证码成功 runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(MainActivity.this, "登录成功", Toast.LENGTH_SHORT).show(); } }); } else if (event == SMSSDK.EVENT_GET_VOICE_VERIFICATION_CODE) { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(MainActivity.this, "语音验证发送", Toast.LENGTH_SHORT).show(); } }); } else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) { //获取验证码成功 runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(MainActivity.this, "验证码已发送", Toast.LENGTH_SHORT).show(); } }); } else if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) { Log.i("test", "test"); } } else { ((Throwable) data).printStackTrace(); Throwable throwable = (Throwable) data; throwable.printStackTrace(); Log.i("1234", throwable.toString()); try { JSONObject obj = new JSONObject(Objects.requireNonNull(throwable.getMessage())); final String des = obj.optString("detail"); if (!TextUtils.isEmpty(des)) { runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(MainActivity.this, des, Toast.LENGTH_SHORT).show(); } }); } } catch (JSONException e) { e.printStackTrace(); } } } }; //注册一个事件回调监听,用于处理SMSSDK接口请求的结果 SMSSDK.registerEventHandler(eh); buttonCode.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { phoneNum = editTextPhoneNum.getText().toString(); if (!phoneNum.isEmpty()) { //利用正则表达式获取检验手机号 if (Utils.checkTel(phoneNum)) { //获取验证码 SMSSDK.getVerificationCode("86", phoneNum); } else { Toast.makeText(getApplicationContext(), "请输入有效的手机号", Toast.LENGTH_LONG).show(); } } else { Toast.makeText(getApplicationContext(), "请输入手机号", Toast.LENGTH_LONG).show(); return; } phoneNum = editTextPhoneNum.getText().toString(); } }); buttonLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { code = editTextCode.getText().toString(); if (!code.isEmpty()) { //提交验证码 SMSSDK.submitVerificationCode("86", phoneNum, code); } else { Toast.makeText(getApplicationContext(), "请输入验证码", Toast.LENGTH_LONG).show(); } } }); } //使用完EventHandler需注销,否则可能出现内存泄漏 @Override protected void onDestroy() { super.onDestroy(); SMSSDK.unregisterEventHandler(eh); } }