Small red dinosaur age groups - sprint DAY3

Small red dinosaur age groups - sprint DAY3

1. Today's task

  • Sheng Guorong: complete interface design, to optimize the effect of view, the shopping cart and payment interface accomplish
  • Liu Yingjie: About Design interface design, and the corresponding optimized and problem-solving retreat connection card
  • Zhao Pei Ning: to continue to study the server, and connect the camera to achieve the function of the program.
  • Hu Park: jumps to a different interface to complete the study according to the length of the string, and associated improvement. Solve problems such as back card.
  • Zou Jiawei: Write sprint blog, and connect the login screen to the main program.

    ## 2. Today burndown

Question 3. Today each crew encountered

  • 20,182,301 Zhao Pei Ning: About Avatar from problem definition, how to call and how to select a picture album shots.

  • Solution: Web search, find the code key points

    (1): 7.0 camera after obtaining uri

    (2): uri get when cutting

    Concrete realization of ideas for:

1. Start by creating a photo file in its own app, use FileProvider share to the camera app.

2. Call the camera app to take pictures, pictures are stored in a file FileProvider provided inside.

3. Load photo files after the completion of photographs, you can also be required to load thumbnails.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/pop_root_ly"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:orientation="vertical">
    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardCornerRadius="5dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <TextView
                android:id="@+id/pop_pic"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:gravity="center"
                android:text="@string/pic"
                android:textColor="@color/black"
                android:textSize="18sp" />
            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="?android:attr/listDivider"
                android:padding="2dp" />
            <TextView
                android:id="@+id/pop_camera"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:gravity="center"
                android:text="@string/camera"
                android:textColor="@color/black"
                android:textSize="18sp" />
        </LinearLayout>
    </android.support.v7.widget.CardView>
    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/pop_cancel"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:gravity="center"
            android:text="取消"
            android:textColor="@color/black"
            android:textSize="18sp" />
    </android.support.v7.widget.CardView>
</LinearLayout>

Reference blog: Android avatar selection (pictures, album cut), pit containing 7.0

Reference blog: call the camera function method Android development tutorial Detailed

Reference blog: Android implementation calls the camera, select the local picture function

  • 20,182,316 Hu Park: In the specific implementation app, found only will read the string entered by the user into the Java is not enough, because it can not achieve long term storage of information, and can not be appropriate, the Composite various considerations, we decided to store information in the phone's sd card.

  • Solution: Baidu blog search and reference, we understand first of all need to get into sd card sd card privileges, and learning problems to a character stream, because there may be Chinese in them, so certain variable types may not fully qualified for the need.

    First, go to the sd card privileges, the code as follows:
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    Second: access character stream sd card.

//保存文件到sd卡
    public void saveToFile(String content) {
        BufferedWriter out = null;

        //获取SD卡状态
        String state = Environment.getExternalStorageState();
        //判断SD卡是否就绪
        if (!state.equals(Environment.MEDIA_MOUNTED)) {
            Toast.makeText(this, "请检查SD卡", Toast.LENGTH_SHORT).show();
            return;
        }
        //取得SD卡根目录
        File file = Environment.getExternalStorageDirectory();
        try {
            Log.e(TAG, "======SD卡根目录:" + file.getCanonicalPath());
            if(file.exists()){
                LOG.e(TAG, "file.getCanonicalPath() == " + file.getCanonicalPath());
            }
            /*
            输出流的构造参数1:可以是File对象  也可以是文件路径
            输出流的构造参数2:默认为False=>覆盖内容; true=>追加内容
             */
            out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file.getCanonicalPath() + "/readMsg.txt",true)));
            out.newLine();
            out.write(content);
            Toast.makeText(this, "保存成功", Toast.LENGTH_SHORT).show();

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

4. Project Progress

The study of the interface has been optimized further adjustment is app look more beautiful, but during the Andrews test of time, and everyone there was a common problem, a program card back, which is the focus of this collective learning problems we solved . When the exam week approaching, our next task will be reduced to meet part of the exam.

5. Organization of work tomorrow

  • Sheng Guorong: optimized interface and making orders.
  • Liu Yingjie: interface design wallet
  • Zhao Pei Ning: Continue to adjust camera functions, access to research their photos, feature changes
  • Hu Park: continue to address the issue of withdrawal card procedures
  • Zou Jiawei: Writing sprint blog.

6. Each team member contribution to the project

student ID Contribution
20182301 5
20182315 5
20182316 5
20182326 5
20182333 5

7. Team Photo

Guess you like

Origin www.cnblogs.com/zjwbk/p/12146737.html