关闭

【科大讯飞Face】

219人阅读 评论(0) 收藏 举报

http://www.xfyun.cn/services/face?type=face

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.duanjiwei.xunfeiapp.MainActivity">

    <TextView
        android:id="@+id/txt_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="5dp"
        android:gravity="center_horizontal"
        android:layout_alignParentTop="true"
        android:text="讯飞人脸识别示例"
        android:textSize="30sp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="vertical">

        <Button
            android:id="@+id/btn_online_demo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_centerInParent="true"
            android:text="在线人脸示例"
            android:textSize="20sp"/>

        <Button
            android:id="@+id/btn_offline_demo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_centerInParent="true"
            android:text="离线人脸示例"
            android:textSize="20sp"/>

        <Button
            android:id="@+id/btn_video_demo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_centerInParent="true"
            android:text="视频检测示例"
            android:textSize="20sp"/>

    </LinearLayout>
</RelativeLayout>


package com.example.duanjiwei.xunfeiapp;

import android.app.Activity;
import android.os.Bundle;

import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity implements OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.btn_online_demo).setOnClickListener(MainActivity.this);
        findViewById(R.id.btn_offline_demo).setOnClickListener(MainActivity.this);
        findViewById(R.id.btn_video_demo).setOnClickListener(MainActivity.this);

        //Setting.setShowLog(true);
    }

    @Override
    public void onClick(View v) {
        Intent intent = null;
        switch (v.getId()) {
            case R.id.btn_online_demo:
                intent = new Intent(MainActivity.this, Activityoffline.class);
                startActivity(intent);
                break;
            case R.id.btn_offline_demo:
                intent = new Intent(MainActivity.this, Activityoffline.class);
                startActivity(intent);
                break;
            case R.id.btn_video_demo:
                intent = new Intent(MainActivity.this, Activityoffline.class);
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:352987次
    • 积分:5477
    • 等级:
    • 排名:第5048名
    • 原创:201篇
    • 转载:77篇
    • 译文:0篇
    • 评论:224条
    文章分类
    最新评论