Question and answer robot API development and production of chat APP

origin

I haven't written a project for a long time, so I just wanted to practice my hands. I just saw the interface of a question and answer robot, and thought that I had done a chat project before, so why not experiment. Of course, it is also a project that simply calls the interface, and there is no real algorithm to complete the question and answer. As an amateur project, the functions are not complete, and only a simple question and answer part is implemented. As for the chat interface, etc., I am too lazy to copy the previous project code, so I ignore it.

icon

Research

First of all, the interface of the question and answer robot I use is still a free interface open to aggregated data, the website is: https://www.juhe.cn/docs/api/id/112 , you can get more interfaces from this website Info, my project only uses simple calls.

In terms of project architecture, I still use the MVP model, which makes the Android project clear, with simple code structure and high reusability. Specifically, the Beam framework is used.

The information arrangement of the chat interface adopts Jude's EasyRecyclerView. Because this control is not based on the transformation of RecyclerView, I feel that it is not very useful in the use of this project. This project is relatively simple for list display, RecyclerView and ListView should be able to do the job.

In general, the project development was smooth sailing, and it was developed and played overnight. This afternoon, I used it to fix bugs, write documents, and summarize the project.

Experience

Inside the project, there is a little Kake to record it. The information returned by the robot interface is packaged into the Answer class by me. However, ChatBean is used when the List of the real project is displayed. Therefore, the two are different structures and cannot be confused.

In addition, in the MVP of the session list, the Fragment controls the List, the Presenter controls the request and response of the data, and the ViewHolder controls the specific display of the data, so the logic is relatively clear. You need to know which part of the control you want to control. Change it inside. Specifically, take a look at the three class codes in the robot package in this project.

App screenshot

Screenshot of the Q&A:

Enter image description here

Enter image description here

Enter image description here

application market

Download address: 
- Fir.im: https://fir.im/qarobot

Epilogue

This project is basically based on two apps, Zunle and WeChat Select. I think the development speed is very fast, and the structure of these two projects is also very good. I hope everyone can exchange and learn from each other.

Looking for fun: http://blog.csdn.net/fuxuemingzhu/article/details/50911245 
WeChat selection: http://blog.csdn.net/fuxuemingzhu/article/details/50933767

This question and answer robot project has been completely open source, the code is at: https://github.com/fuxuemingzhu/QARobot , welcome to Star and Fork.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326357521&siteId=291194637