赞
踩
EmoGenius Crew —— Sprint Essay 1
Which course does this assignment belong to | 2301-MUSE Community |
---|---|
Assignment Requirement | Teamwork——Alpha Sprint |
Team name | EmoGenius Crew |
The goal of this assignment | Sprint Essay 1. |
Topical Collection Essay | EmoGenius Crew - Alpha SprintTopical Collection of Essays |
When planning the emotional diary module and emotional forum module, the thinking is somewhat unclear
Android front-end development and front - and back-end communication.
I’m really good, I’m really good, I’m really, really, really good.
Agreed and determined the technology selection and database design, determined the use of http protocol, Spring framework and MySQL database. Implement the account password login function in the account related interface.
Part of the code display:
package com.example.project_ee297.DAO; import com.example.project_ee297.Model.User; import org.apache.ibatis.annotations.*; @Mapper public interface UserDAO { @Insert("INSERT INTO user (username, password,nickName,age,gender,headPortraitBase64Code,userIdiograph) VALUES (#{username}, #{password}, #{nickName}, #{age}, #{gender}, #{headPortraitBase64Code},#{userIdiograph})") int add(User user); @Update("UPDATE user SET password = #{password}, nickName = #{nickName} ,userIdiograph=#{userIdiograph}, age =#{age}, gender=#{gender} WHERE id = #{id}") int update(User user); @Update("UPDATE user SET headPortraitBase64Code = #{headPortraitBase64Code} WHERE id = #{id}") int updateImg(User user); @Select("SELECT * FROM user WHERE id = #{id}") User getById(Integer id); @Select("SELECT * FROM user WHERE username = #{username}") User getByUsername(String username); }
Dock with the front end, use the Jakarta. Servlet. HTTP. This bag method, the HttpSession user always can not be assigned in the session, and then failed to judge whether the user to modify the information to the logged in user.
The login requirements of the account password in the account related interface are completed.
In the task promotion within the database and server group, it is necessary to determine the technology selection and database design in order to better promote the task.
The technical selection and database design were discussed and determined, and the use of http protocol, Spring framework and MySQL database was determined. The code of the account password login part in the account related interface is tested, debugged, modified and standardized.
When writing the database, the request from the front end cannot be accepted normally.
Debug and dock user login code, and write all database and server-related documents.
During the debugging process, it was found that the data types when sending the request and receiving the request did not match, and the unified data type was unified as string, and then the problem was solved.
Complete the UI design code of the main interface of the diary, and realize the bold and underline functions of the rich text editor.
The diary history interface is not yet coded, and the rich text editor display is often buggy, requiring a computer reboot. The rich text editor is a separate module and has not been merged.
Continue to complete the remaining UI deployment, improve the rich text editor image addition and other functions.
remain patient
Download and install Android Studio, learn the basic syntax of page design in Android Studio, and complete the preliminary design of the main page (upload the code activity_home.xml).
Virtual machines run slowly, and attempts to write code often have errors, which is not easy to achieve the expected design effect.
The Android Studio sample code works correctly and learn the basics related to the project.
When you encounter difficulties, you should try multiple solutions. The aesthetic and ease-of-use of design goals require a lot of effort.
Just studying, no results.
Improved the forum’s like function, and added click events for each component.
public void addmsg(List<String> userAccountList1, List<String> contentList1, List<String> createdAtList1){ for(int i=0;i<userAccountList1.size();i++){ NotebookBean notebookBean = new NotebookBean(); notebookBean.setContent(contentList1.get(i)); String temp=createdAtList1.get(i); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); try { if(!temp.equals("null")){ // 将字符串解析为 Date 对象 Date date = sdf.parse(temp); // 获取毫秒表示的时间 long millis = date.getTime(); notebookBean.setEditTime(millis); } else{ notebookBean.setEditTime(System.currentTimeMillis()); } } catch (ParseException e) { throw new RuntimeException(e); } NotebookBean.setNumber(userAccountList1.size()); notebookBean.setUsername(userAccountList1.get(i)); mDBManager.insertNotebook(notebookBean); setResult(RESULT_OK); } } private void getNotebookList() { mNotebookList.clear(); mNotebookList.addAll(mDBManager.selectNotebookList()); mAdapter.notifyDataSetChanged(); } @Override protected void onDestroy() { super.onDestroy(); Log.i("FourmMainAC","destroy suc"); // 在销毁 Activity 时调用 mDBManager.deleteAllNotebooks() mDBManager.deleteAllNotebooks(); } private void initView() { recyclerView = findViewById(R.id.recycler_view); btnAdd = findViewById(R.id.btn_add); btnAdd.setOnClickListener(this); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE && resultCode == RESULT_OK){ Log.i("rest","res"); getNotebookList(); } } private void initRecyclerView() { mNotebookList = new ArrayList<>(); mAdapter = new NotebookAdapter(mNotebookList); mAdapter.setOnDeleteButtonClickListener(this); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(mAdapter); } @Override public void onClick(View view) { if (view.getId() == R.id.btn_add) { Intent intent = new Intent(FourmmainActivity.this, AddNotebookActivity.class); intent.putExtra("isAdd", true); startActivityForResult(intent, REQUEST_CODE); } }
Communication with the server is still a problem
Set up http communication and implement the comment function as soon as possible
Communication needs to continue to be refined and researched
Download and install Android Studio, configure the SDK running environment, open the VM running program, learn the relevant code of UI interface design and layout, and upload some materials to the resource library of Android Studio.
I am not familiar enough with the code related to UI design layout
Continue to learn the relevant code of UI interface design layout, upload more relevant materials, and start to layout the interface.
You need to be able to work with the code you’re working with, and you can use chatgpt for some of it, but you still need to understand what each piece of code does to avoid problems such as backend incompatibility.
Android Studio was configured, the SDK was downloaded, and the project was successfully imported. I had a meeting to discuss the next work and learned some code related to UI design.
I am still not familiar with the use of code required for UI design
Learn the code of UI design and start to contact layout interface
UI design requires familiarity with the layout of the interface, and you must study hard to keep up.
Download and install Android Studio, learn page design in Android Studio, and learn the relevant code of UI interface design layout.
I am not familiar enough with the relevant code of the design layout, so I have not achieved the expected design effect.
Learn the relevant code of UI interface design layout and the correct operation of sample code.
It is also necessary to continue to improve and study, try more solutions when encountering difficulties, understand the purpose of each code, and try various collocation schemes according to the needs of the project to maintain the aesthetics and feasibility of the project.
Just studying, no results.
The “like” and “comment” interface of the forum is improved, and a new “comment” interface is realized.
The Like button tends to crash and disappear after adding background
Continue to improve the interface and set up http communication
Continue to study the communication to ensure that the comment interface is perfectly implemented
Rich text editor partial implementation:
public class MainActivity extends AppCompatActivity { private final int OPEN_ALBUM_REQUESTCODE = 1; //请求码 private RichEditText richEditText; private Button btn_bold, btn_underline, btn_italic, btn_image; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); richEditText = findViewById(R.id.richEditText); btn_bold = findViewById(R.id.btn_bold); btn_underline = findViewById(R.id.btn_underline); btn_italic = findViewById(R.id.btn_italic); btn_image = findViewById(R.id.btn_image); initBold(); initItalic(); initUnderline(); btn_image.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {// 没有权限。 if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, Manifest.permission.READ_CONTACTS)) { // 用户拒绝过这个权限了,应该提示用户,为什么需要这个权限。 } else { // 申请授权。 ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 2); } } else { openAlbum(); } } else { openAlbum(); } } }); } /** * 粗体 */ private void initBold() { StyleBtnVm styleBtnVm = new StyleBtnVm.Builder() .setType(RichTypeEnum.BOLD) .setClickedView(btn_bold) .build(); richEditText.initStyleButton(styleBtnVm); } /** * 斜体 */ private void initItalic() { StyleBtnVm styleBtnVm = new StyleBtnVm.Builder() .setType(RichTypeEnum.ITALIC) .setClickedView(btn_italic) .build(); richEditText.initStyleButton(styleBtnVm); } /** * 下划线 */ private void initUnderline() { StyleBtnVm styleBtnVm = new StyleBtnVm.Builder() .setType(RichTypeEnum.UNDERLINE) .setClickedView(btn_underline) .build(); richEditText.initStyleButton(styleBtnVm); }
The UI diary interface is still incomplete, the layout may need to be adjusted, and some contents of the rich text editor implementation are not perfect and need to be improved.
Continue to complete the deployment of the ui diary page and refine the content of the rich text editor
Also need to improve the content, improve the layout
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。