[Android course design] briefly analyze the course design


Finally, I finished the exam and was able to find some time to write a blog (although I was still worried about my computer performance). I really have nothing to say. The front is nonsense. Enter the text

1. Introduction to course design

The Android course I did is a forum system, which has built a background server, so it realizes the function of real-time updating and obtaining the information of all users. Forum functions include publishing, reply, like and collection. View the content published by yourself, reply to the information of your post, and modify your personal information. The implementation of these functions has made great efforts in the background CRUD, and realized the feeling that the back-end programmers always add, delete, modify and check.

2. Summary of open source controls used in the course design

2.1 dependency packages used

//    It's all fancy fonts
    def htextview_version = "0.1.6"
    compile "com.hanks:htextview-base:$htextview_version"        // base library

    compile "com.hanks:htextview-fade:$htextview_version"        // optional
    compile "com.hanks:htextview-line:$htextview_version"        // optional
    compile "com.hanks:htextview-rainbow:$htextview_version"     // optional
    compile "com.hanks:htextview-typer:$htextview_version"       // optional

    compile "com.hanks:htextview-scale:$htextview_version"       // optional
    compile "com.hanks:htextview-evaporate:$htextview_version"   // optional
    compile "com.hanks:htextview-fall:$htextview_version"        // optional
//    Novice guidance
    //noinspection GradleCompatible
    compileOnly 'com.android.support:appcompat-v7:25.3.1'
    implementation 'com.github.huburt-Hu:NewbieGuide:v2.4.0'
    //    Implementation of selector
    compile 'com.contrarywind:Android-PickerView:4.1.9'
    //    Picture sanding implementation
    implementation 'jp.wasabeef:glide-transformations:2.0.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'


// Note: after subcontracting, there will be no default Header and Footer, which need to be added manually! Or the original three methods! Pull up load, pull down refresh
    implementation  'com.scwang.smart:refresh-layout-kernel:2.0.3'      //Core must rely on
    implementation  'com.scwang.smart:refresh-header-classics:2.0.3'    //Classic refresh header
    implementation  'com.scwang.smart:refresh-header-radar:2.0.3'       //Radar refresh head
    implementation  'com.scwang.smart:refresh-header-falsify:2.0.3'     //Virtual refresh header
    implementation  'com.scwang.smart:refresh-header-material:2.0.3'    //Google refresh header
    implementation  'com.scwang.smart:refresh-header-two-level:2.0.3'   //Secondary refresh header
    implementation  'com.scwang.smart:refresh-footer-ball:2.0.3'        //Spherical pulse loading
    implementation  'com.scwang.smart:refresh-footer-classics:2.0.3'    //Classic loading


    //Click pop-up selection
    compile 'com.diegodobelo.expandingview:expanding-view:0.9.4'

    //BottomBarLayout lightweight bottom navigation bar
    compile 'com.github.chaychan:BottomBarLayout:2.0.2' //The latest version is recommended
    //Gson framework
    implementation 'com.google.code.gson:gson:2.8.6'

    //xutils framework
    implementation 'org.xutils:xutils:3.9.0'

//    Network picture
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'

//    Rotation chart
    implementation 'io.github.youth5201314:banner:2.2.1'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'

2.2 Github address of each open source control

Font animation HTextView: https://github.com/hanks-zyh/HTextView
Novice guide: https://github.com/huburt-Hu/NewbieGuide
Selector: https://github.com/Bigkoo/Android-PickerView
Picture Frosting: https://github.com/wasabeef/glide-transformations
Refresh load: https://github.com/scwang90/SmartRefreshLayout
A nice click pop-up menu (with animation): https://github.com/diegodobelo/AndroidExpandingViewLibrary
Lightweight bottom navigation bar: https://github.com/chaychan/BottomBarLayout
Gson framework: https://github.com/google/gson
xutils framework: https://github.com/wyouflf/xUtils3
Network pictures: https://github.com/bumptech/glide
Rotation chart: https://github.com/youth5201314/banner
The above is the github address of all open source controls used in my project for your reference.
Basically, these UI design frameworks use animation, so the results are very good.

3. Technology used in course design

3.1 anzhuo end

Andrews end uses the native AS development, plus the use of some open source controls. In addition, there is nothing special.

3.2 back end

The back-end is built using the Springboot+Mybaits+MySQL database. Because I learned a lot of framework knowledge when preparing for the service outsourcing competition in the winter vacation, I feel easier to use now, and both frameworks are very mature architectures. I won't elaborate on how to use it here. You can study by yourself.

3.3 about front and rear desk interaction

The front-end and back-end interaction mainly uses xUtils framework to send requests on the Android end. The background is developed with Springboot annotation, which is easy to build.
A small Demo from the project
Android terminal code

x.Ext.init(getApplication());
            RequestParams requestParams = new RequestParams("http://10.135.143.172:8090/addPostInformation?");
            requestParams.addQueryStringParameter("title_discuss", title_discuss);
            requestParams.addQueryStringParameter("name", name);
            requestParams.addQueryStringParameter("time", time);
            requestParams.addQueryStringParameter("name_floor", name_floor);
            requestParams.addQueryStringParameter("information", information);
            requestParams.addQueryStringParameter("time_floor", time_floor);
            requestParams.addQueryStringParameter("account_floor",account_floor);
//            Delete this sentence from all requests sent to base64 to simplify the request
//            requestParams.addQueryStringParameter("base64_floor", base64_floor);
            requestParams.addQueryStringParameter("account",account);
            x.http().post(requestParams, new Callback.CommonCallback<String>() {
                @Override
                public void onSuccess(String result) {
                    if (result.equals("1"))
                        Toast.makeText(Discuss_post_information.this, "Comment success", Toast.LENGTH_SHORT).show();
                }

                @Override
                public void onError(Throwable ex, boolean isOnCallback) {
                    Toast.makeText(Discuss_post_information.this, "An unexpected error occurred in the network. Please wait", Toast.LENGTH_SHORT).show();
                }

                @Override
                public void onCancelled(CancelledException cex) {
                }

                @Override
                public void onFinished() {

                }
            });

Background code

//    Increase the number of reply floors in this post and update the number of comments in this building at the same time
    @PostMapping("/addPostInformation")
    public int addPostInformation(String title_discuss, String name, String time,String name_floor,String information,String time_floor,String account_floor,String account){
//        Get the id of the post first
        int id_floor = contentMapper.queryContent_id(title_discuss,account,time);
        contentMapper.update_comments(id_floor);
        PostInformation postInformation=new PostInformation();
        postInformation.setName_floor(name_floor);
        postInformation.setInformation(information);
        postInformation.setTime_floor(time_floor);
        postInformation.setBase64_floor(userMapper.query(account_floor));
        postInformation.setContent_id(id_floor);
        postInformation.setAccount(account);
        postInformation.setAccount_floor(account_floor);
        postInformationMapper.addPostInformation(postInformation);
//        id of the current reply
        int floor = postInformationMapper.queryfloor(name_floor, id_floor, time_floor);
        commentsReceivedMapper.addCommentsReceived(new CommentsReceived(account,id_floor,floor));
        return 1;
    }

As described above, the request is sent, the data is received and processed
I should blog about the use of several frameworks during the summer vacation. In fact, I can only use the framework now. I forget about the principle of the framework and the bottom layer. Prepare for a good tutorial this summer vacation.

4. Final effect display

The final score was 98 points. I felt that some things were not done very well emmm. Come on next time

5. Utilities

5.1 class notes

Here are all my notes of Android class. You can refer to them for learning, criticism and correction
Android Lecture 1 Notes (common controls and linear layout)
Notes of Android Lecture 2 (constraint layout)
Android Lecture 3 Notes (simple operation of Activity)
Notes on Android Lecture 4 (jump and value transfer between activities)
Android Lecture 5 notes (list RecyclerView)
Android Lecture 6 notes (Introduction to Fragment)
Android Lecture 7 Notes (circular pictures, network pictures, pull-down refresh, pull-up load)
Android Lecture 8 notes-1 (network programming) Android Lecture 8 notes-2 (JSON)
Android Lecture 9 notes (xUtils framework, Gson framework)
Android Lecture 10 notes (WebView, shared preferences)
Android Lecture 11 notes (SqLite database, Room framework)
Android lecture 12 notes (video, audio playback, open source controls)
Android lecture 13 notes (Introduction to animation, open source controls, application packaging)
Android Lecture 14 notes (broadcast, baidu map)

5.2 open source controls

Common open source controls

5.3 utilities

Platform for constructing json data
Polymerization bed
Bob backend cloud

Keywords: Android Design Pattern

Added by PromaneX on Sun, 23 Jan 2022 10:05:06 +0200