diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index aa724b7..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/caches
-/.idea/libraries
-/.idea/modules.xml
-/.idea/workspace.xml
-/.idea/navEditor.xml
-/.idea/assetWizardSettings.xml
-.DS_Store
-/build
-/captures
-.externalNativeBuild
-.cxx
-local.properties
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 359bb53..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# 默认忽略的文件
-/shelf/
-/workspace.xml
diff --git a/.idea/.name b/.idea/.name
deleted file mode 100644
index 486bb56..0000000
--- a/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-fruit
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index fb7f4a8..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
deleted file mode 100644
index 642fd57..0000000
--- a/.idea/deploymentTargetDropDown.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index cfc986a..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index bdd9278..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
deleted file mode 100644
index 42afabf..0000000
--- a/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
deleted file mode 100644
index 157dc62..0000000
--- a/app/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-plugins {
- id 'com.android.application'
-}
-
-android {
- compileSdk 33
-
- defaultConfig {
- applicationId "com.example.ceshi"
- minSdk 23
- targetSdk 33
- versionCode 1
- versionName "1.0"
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-}
-
-dependencies {
-
- implementation 'androidx.appcompat:appcompat:1.4.1'
- implementation 'com.google.android.material:material:1.5.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
- implementation files('D:\\FruitsProject\\app\\src\\main\\res\\aip-java-sdk-4.16.9.jar')
- implementation files('D:\\FruitsProject\\app\\src\\main\\res\\json-20160810.jar')
- implementation files('D:\\FruitsProject\\app\\src\\main\\res\\slf4j-api-1.7.25.jar')
- implementation files('D:\\FruitsProject\\app\\src\\main\\res\\slf4j-simple-1.7.25.jar')
- implementation files('D:\\FruitsProject\\app\\src\\main\\res\\gson-2.8.6.jar')
- implementation 'com.android.car.ui:car-ui-lib:2.0.0'
- testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
-}
\ No newline at end of file
diff --git a/app/lib/gson-2.8.6.jar b/app/lib/gson-2.8.6.jar
deleted file mode 100644
index 4765c4a..0000000
Binary files a/app/lib/gson-2.8.6.jar and /dev/null differ
diff --git a/app/lib/java-sdk-4.15.7.jar b/app/lib/java-sdk-4.15.7.jar
deleted file mode 100644
index 81230b9..0000000
Binary files a/app/lib/java-sdk-4.15.7.jar and /dev/null differ
diff --git a/app/lib/json.jar b/app/lib/json.jar
deleted file mode 100644
index 2c0bf83..0000000
Binary files a/app/lib/json.jar and /dev/null differ
diff --git a/app/lib/json.zip b/app/lib/json.zip
deleted file mode 100644
index bb45401..0000000
Binary files a/app/lib/json.zip and /dev/null differ
diff --git a/app/lib/lib.zip b/app/lib/lib.zip
deleted file mode 100644
index 24604a5..0000000
Binary files a/app/lib/lib.zip and /dev/null differ
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
deleted file mode 100644
index 481bb43..0000000
--- a/app/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/release/app-release.apk b/app/release/app-release.apk
deleted file mode 100644
index 4c7f185..0000000
Binary files a/app/release/app-release.apk and /dev/null differ
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
deleted file mode 100644
index 9b578b9..0000000
--- a/app/release/output-metadata.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "version": 3,
- "artifactType": {
- "type": "APK",
- "kind": "Directory"
- },
- "applicationId": "com.example.ceshi",
- "variantName": "release",
- "elements": [
- {
- "type": "SINGLE",
- "filters": [],
- "attributes": [],
- "versionCode": 1,
- "versionName": "1.0",
- "outputFile": "app-release.apk"
- }
- ],
- "elementType": "File"
-}
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/example/Fruits/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/Fruits/ExampleInstrumentedTest.java
deleted file mode 100644
index 8155859..0000000
--- a/app/src/androidTest/java/com/example/Fruits/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.example.Fruits;
-
-import android.content.Context;
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see Testing documentation
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
- @Test
- public void useAppContext() {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
- assertEquals("com.example.ceshi", appContext.getPackageName());
- }
-}
\ No newline at end of file
diff --git a/app/src/debug/ic_launcher-playstore.png b/app/src/debug/ic_launcher-playstore.png
deleted file mode 100644
index 17fe257..0000000
Binary files a/app/src/debug/ic_launcher-playstore.png and /dev/null differ
diff --git a/app/src/debug/res/drawable/ic_launcher_background.xml b/app/src/debug/res/drawable/ic_launcher_background.xml
deleted file mode 100644
index ca3826a..0000000
--- a/app/src/debug/res/drawable/ic_launcher_background.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index c4a603d..0000000
--- a/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index c4a603d..0000000
--- a/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/debug/res/mipmap-hdpi/ic_launcher.png b/app/src/debug/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index 11b3a6e..0000000
Binary files a/app/src/debug/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/debug/res/mipmap-hdpi/ic_launcher_foreground.png
deleted file mode 100644
index 669b954..0000000
Binary files a/app/src/debug/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png b/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index fafcf32..0000000
Binary files a/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-mdpi/ic_launcher.png b/app/src/debug/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 5f5e86c..0000000
Binary files a/app/src/debug/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/debug/res/mipmap-mdpi/ic_launcher_foreground.png
deleted file mode 100644
index 3581b3c..0000000
Binary files a/app/src/debug/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png b/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png
deleted file mode 100644
index 72268d1..0000000
Binary files a/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xhdpi/ic_launcher.png b/app/src/debug/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index fbc9db8..0000000
Binary files a/app/src/debug/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/debug/res/mipmap-xhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 2e4f6c3..0000000
Binary files a/app/src/debug/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png
deleted file mode 100644
index 6c8b374..0000000
Binary files a/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png b/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 2de1feb..0000000
Binary files a/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/debug/res/mipmap-xxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 340beab..0000000
Binary files a/app/src/debug/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png
deleted file mode 100644
index a35880d..0000000
Binary files a/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 46d7ed9..0000000
Binary files a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 3a5ec29..0000000
Binary files a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted file mode 100644
index 480bebe..0000000
Binary files a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 1fc32f3..0000000
--- a/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/java/com/baidu/ai/aip/utils/Base64Util.java b/app/src/main/java/com/baidu/ai/aip/utils/Base64Util.java
deleted file mode 100644
index 9772165..0000000
--- a/app/src/main/java/com/baidu/ai/aip/utils/Base64Util.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.baidu.ai.aip.utils;
-
-/**
- * Base64 工具类
- */
-public class Base64Util {
- private static final char last2byte = (char) Integer.parseInt("00000011", 2);
- private static final char last4byte = (char) Integer.parseInt("00001111", 2);
- private static final char last6byte = (char) Integer.parseInt("00111111", 2);
- private static final char lead6byte = (char) Integer.parseInt("11111100", 2);
- private static final char lead4byte = (char) Integer.parseInt("11110000", 2);
- private static final char lead2byte = (char) Integer.parseInt("11000000", 2);
- private static final char[] encodeTable = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
-
- public Base64Util() {
- }
-
- public static String encode(byte[] from) {
- StringBuilder to = new StringBuilder((int) ((double) from.length * 1.34D) + 3);
- int num = 0;
- char currentByte = 0;
-
- int i;
- for (i = 0; i < from.length; ++i) {
- for (num %= 8; num < 8; num += 6) {
- switch (num) {
- case 0:
- currentByte = (char) (from[i] & lead6byte);
- currentByte = (char) (currentByte >>> 2);
- case 1:
- case 3:
- case 5:
- default:
- break;
- case 2:
- currentByte = (char) (from[i] & last6byte);
- break;
- case 4:
- currentByte = (char) (from[i] & last4byte);
- currentByte = (char) (currentByte << 2);
- if (i + 1 < from.length) {
- currentByte = (char) (currentByte | (from[i + 1] & lead2byte) >>> 6);
- }
- break;
- case 6:
- currentByte = (char) (from[i] & last2byte);
- currentByte = (char) (currentByte << 4);
- if (i + 1 < from.length) {
- currentByte = (char) (currentByte | (from[i + 1] & lead4byte) >>> 4);
- }
- }
-
- to.append(encodeTable[currentByte]);
- }
- }
-
- if (to.length() % 4 != 0) {
- for (i = 4 - to.length() % 4; i > 0; --i) {
- to.append("=");
- }
- }
-
- return to.toString();
- }
-}
diff --git a/app/src/main/java/com/baidu/ai/aip/utils/FileUtil.java b/app/src/main/java/com/baidu/ai/aip/utils/FileUtil.java
deleted file mode 100644
index 540f45c..0000000
--- a/app/src/main/java/com/baidu/ai/aip/utils/FileUtil.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.baidu.ai.aip.utils;
-
-import java.io.*;
-
-/**
- * 文件读取工具类
- */
-public class FileUtil {
-
- /**
- * 读取文件内容,作为字符串返回
- */
- public static String readFileAsString(String filePath) throws IOException {
- File file = new File(filePath);
- if (!file.exists()) {
- throw new FileNotFoundException(filePath);
- }
-
- if (file.length() > 1024 * 1024 * 1024) {
- throw new IOException("File is too large");
- }
-
- StringBuilder sb = new StringBuilder((int) (file.length()));
- // 创建字节输入流
- FileInputStream fis = new FileInputStream(filePath);
- // 创建一个长度为10240的Buffer
- byte[] bbuf = new byte[10240];
- // 用于保存实际读取的字节数
- int hasRead = 0;
- while ( (hasRead = fis.read(bbuf)) > 0 ) {
- sb.append(new String(bbuf, 0, hasRead));
- }
- fis.close();
- return sb.toString();
- }
-
- /**
- * 根据文件路径读取byte[] 数组
- */
- public static byte[] readFileByBytes(String filePath) throws IOException {
- File file = new File(filePath);
- if (!file.exists()) {
- throw new FileNotFoundException(filePath);
- } else {
- ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
- BufferedInputStream in = null;
-
- try {
- in = new BufferedInputStream(new FileInputStream(file));
- short bufSize = 1024;
- byte[] buffer = new byte[bufSize];
- int len1;
- while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
- bos.write(buffer, 0, len1);
- }
-
- byte[] var7 = bos.toByteArray();
- return var7;
- } finally {
- try {
- if (in != null) {
- in.close();
- }
- } catch (IOException var14) {
- var14.printStackTrace();
- }
-
- bos.close();
- }
- }
- }
-}
diff --git a/app/src/main/java/com/baidu/ai/aip/utils/GsonUtils.java b/app/src/main/java/com/baidu/ai/aip/utils/GsonUtils.java
deleted file mode 100644
index 541462c..0000000
--- a/app/src/main/java/com/baidu/ai/aip/utils/GsonUtils.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.ai.aip.utils;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonParseException;
-
-import java.lang.reflect.Type;
-
-/**
- * Json工具类.
- */
-public class GsonUtils {
- private static Gson gson = new GsonBuilder().create();
-
- public static String toJson(Object value) {
- return gson.toJson(value);
- }
-
- public static T fromJson(String json, Class classOfT) throws JsonParseException {
- return gson.fromJson(json, classOfT);
- }
-
- public static T fromJson(String json, Type typeOfT) throws JsonParseException {
- return (T) gson.fromJson(json, typeOfT);
- }
-}
diff --git a/app/src/main/java/com/baidu/ai/aip/utils/HttpUtil.java b/app/src/main/java/com/baidu/ai/aip/utils/HttpUtil.java
deleted file mode 100644
index ad8d5eb..0000000
--- a/app/src/main/java/com/baidu/ai/aip/utils/HttpUtil.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.baidu.ai.aip.utils;
-
-import java.io.BufferedReader;
-import java.io.DataOutputStream;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-/**
- * http 工具类
- */
-public class HttpUtil {
-
- public static String post(String requestUrl, String accessToken, String params)
- throws Exception {
- String contentType = "application/x-www-form-urlencoded";
- return HttpUtil.post(requestUrl, accessToken, contentType, params);
- }
-
- public static String post(String requestUrl, String accessToken, String contentType, String params)
- throws Exception {
- String encoding = "UTF-8";
- if (requestUrl.contains("nlp")) {
- encoding = "GBK";
- }
- return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
- }
-
- public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
- throws Exception {
- String url = requestUrl + "?access_token=" + accessToken;
- return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
- }
-
- public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
- throws Exception {
- URL url = new URL(generalUrl);
- // 打开和URL之间的连接
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setRequestMethod("POST");
- // 设置通用的请求属性
- connection.setRequestProperty("Content-Type", contentType);
- connection.setRequestProperty("Connection", "Keep-Alive");
- connection.setUseCaches(false);
- connection.setDoOutput(true);
- connection.setDoInput(true);
-
- // 得到请求的输出流对象
- DataOutputStream out = new DataOutputStream(connection.getOutputStream());
- out.write(params.getBytes(encoding));
- out.flush();
- out.close();
-
- // 建立实际的连接
- connection.connect();
- // 获取所有响应头字段
- Map> headers = connection.getHeaderFields();
- // 遍历所有的响应头字段
- for (String key : headers.keySet()) {
- //System.err.println(key + "--->" + headers.get(key));
- }
- // 定义 BufferedReader输入流来读取URL的响应
- BufferedReader in = null;
- in = new BufferedReader(
- new InputStreamReader(connection.getInputStream(), encoding));
- String result = "";
- String getLine;
- while ((getLine = in.readLine()) != null) {
- result += getLine;
- }
- in.close();
- //System.err.println("result:" + result);
- return result;
- }
-}
diff --git a/app/src/main/java/com/example/Fruits/CollectActivity.java b/app/src/main/java/com/example/Fruits/CollectActivity.java
deleted file mode 100644
index c48a1fd..0000000
--- a/app/src/main/java/com/example/Fruits/CollectActivity.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package com.example.Fruits;
-
-import android.content.Context;
-import android.database.Cursor;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteOpenHelper;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-import android.widget.Toast;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import android.os.Bundle;
-
-/**
- * 建立sqlite数据库,进行用户名和密码的存储
- */
-public class CollectActivity extends AppCompatActivity implements View.OnClickListener{
-
- //编辑框,输入
- EditText username;
- EditText password;
- //EditText selectuser;
-
- //结果文本框
- TextView result;
-
- //3个按钮
- Button buttonadd;
- Button buttondelete;
- Button buttonselect;
-
- //帮助建立sqlite数据库
- SQLiteOpenHelper mysqlhelper;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.collect_activity);
-
- init();
- buttonadd.setOnClickListener(this);
- buttondelete.setOnClickListener(this);
- buttonselect.setOnClickListener(this);
- }
-
- public void init(){
- username = findViewById(R.id.username);
- password = findViewById(R.id.password);
- //selectuser = findViewById(R.id.selectuser);
-
- result = findViewById(R.id.result);
-
- buttonadd = findViewById(R.id.buttonadd);
- buttondelete = findViewById(R.id.buttondelete);
- buttonselect = findViewById(R.id.buttonselect);
-// mysqlhelper = new MyDBHelper(MainActivity.this, "MyDatabase.db", null, 666);
-// //SQLiteDatabase db = mysqlhelper.getWritableDatabase();
- }
-
- @Override
- public void onClick(View v) {
-
- mysqlhelper = new MyDBHelper(CollectActivity.this, "MyDatabase.db", null, 666);
- SQLiteDatabase db;
- String username1 = null;
- String password1 = null;
- Log.v("start","按钮事件:");
- switch(v.getId()){
- case R.id.buttonadd:
- db = mysqlhelper.getWritableDatabase();
- username1 = username.getText().toString();
- password1 = password.getText().toString();
- if(username1==null&&username1==""&&username1==" "){
- Toast.makeText(CollectActivity.this,"用户名不能为空",Toast.LENGTH_LONG).show();
- Log.v("start","添加失败");
- }else if(password1==null){
- Toast.makeText(CollectActivity.this,"密码不能为空",Toast.LENGTH_LONG).show();
-
- }else {
- db.execSQL("insert into user(username,password) values(?,?)", new Object[]{username1, password1});
- Toast.makeText(CollectActivity.this,"添加成功",Toast.LENGTH_LONG).show();
- //result.setText("查询结果为:");
- //result.append("标题"+username1+"内容"+password1);
- }
- db.close();
- break;
-
- case R.id.buttondelete:
- db = mysqlhelper.getWritableDatabase();
- String usernamed = username.getText().toString();
-
- db.execSQL("delete from user where username=?",new Object[]{usernamed});
- db.close();
- Toast.makeText(CollectActivity.this,"删除成功",Toast.LENGTH_LONG).show();
- break;
- case R.id.buttonselect:
- result.setText("查询结果为:");
- db = mysqlhelper.getWritableDatabase();
-
- Cursor cursor = db.rawQuery("select * from user ",null );
- while (cursor.moveToNext()){
- result.append("\n" +"________________________________________________________________________"+"\n"+
- "标题:" + cursor.getString(1) +"\n" +
- "内容:" + cursor.getString(2));
- }
- cursor.close();
- db.close();
- Toast.makeText(CollectActivity.this,"查询成功",Toast.LENGTH_LONG).show();
- Log.v("start","查询成功");
- break;
- }
- }
-
- /**
- * sqlite数据库创建帮助类
- */
- public class MyDBHelper extends SQLiteOpenHelper{
-
- public MyDBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
- super(context, name, factory, version);
- }
-
- @Override
- public void onCreate(SQLiteDatabase db) {
- db.execSQL("CREATE TABLE user(" +
- "user_id INTEGER PRIMARY KEY AUTOINCREMENT," +
- "username VARCHAR(2000),"+
- "password VARCHAR(20000)"+
- ")");
- }
-
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
-
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/Fruits/MainActivity.java b/app/src/main/java/com/example/Fruits/MainActivity.java
deleted file mode 100644
index ef0baae..0000000
--- a/app/src/main/java/com/example/Fruits/MainActivity.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.example.Fruits;
-
-import android.content.Intent;
-import android.view.View;
-import android.widget.Button;
-import androidx.appcompat.app.AppCompatActivity;
-import android.os.Bundle;
-
-public class MainActivity extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main_activity);
-
- //获取按钮
- Button button = findViewById(R.id.button);
-// Button button2 = findViewById(R.id.button2);
- Button button3 = findViewById(R.id.button3);
- Button button4 = findViewById(R.id.button4);
- //按钮进行监听
- button.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- //监听按钮,如果点击,就跳转
- Intent intent = new Intent();
- //前一个(MainActivity.this)是目前页面,后面一个是要跳转的下一个页面
- intent.setClass(MainActivity.this, WordSearchActivity.class);
- startActivity(intent);
- }
- });
- button3.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- //监听按钮,如果点击,就跳转
- Intent intent = new Intent();
- //前一个(MainActivity.this)是目前页面,后面一个是要跳转的下一个页面
- intent.setClass(MainActivity.this, PictureSearchActivity.class);
- startActivity(intent);
- }
- });
- button4.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- //监听按钮,如果点击,就跳转
- Intent intent = new Intent();
- //前一个(MainActivity.this)是目前页面,后面一个是要跳转的下一个页面
- intent.setClass(MainActivity.this, CollectActivity.class);
- startActivity(intent);
- }
- });
- }
-}
diff --git a/app/src/main/java/com/example/Fruits/PictureSearchActivity.java b/app/src/main/java/com/example/Fruits/PictureSearchActivity.java
deleted file mode 100644
index 96d1cbf..0000000
--- a/app/src/main/java/com/example/Fruits/PictureSearchActivity.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package com.example.Fruits;
-
-
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.StrictMode;
-import android.provider.MediaStore;
-import android.view.View;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.core.content.FileProvider;
-
-import com.transfer.Ingredient;
-import com.transfer.ToIngredient;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Random;
-
-
-public class PictureSearchActivity extends AppCompatActivity {
-
- Bitmap bitmap;
- final int TAKE_PHOTO=1;
- Button btn_1;
- ImageView iv_photo;
- Uri imageUri;
- TextView t1;
- String a="111";
- @Override
- protected void onCreate(Bundle savedInstanceState){
-
- // Android在4.0之前的版本支持在主线程中访问网络,但是在4.0以后对这部分程序进行了优化,也就是说访问网络的代码不能写在主线程中了。
- //主线程中进行网络请求异常, Android4.0 版本开始后就强制程序不能在主线程中访问网络, 要把访问网络放在独立的子线程中.
- //在 Activity 的 onCreate() 方法中添加, 忽略这些强制策略.
- StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
- StrictMode.setThreadPolicy(policy);
-
-
- super.onCreate(savedInstanceState);
- setContentView(R.layout.picture_search_activity);
-
- btn_1=findViewById(R.id.btn_takephoto);
- iv_photo=findViewById(R.id.img_photo);
- t1=findViewById(R.id.textView11);
-
-
- btn_1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- File output=new File(getExternalCacheDir(),"output_image.jpg");
- try {
- if (output.exists()){
- output.delete();
- }
- output.createNewFile();
- }catch (IOException e){
- e.printStackTrace();
- }
- if (Build.VERSION.SDK_INT>=24){
- //图片的保存路径
- imageUri= FileProvider.getUriForFile(PictureSearchActivity.this,"com.example.takephoto.fileprovider",output);
- }
- else { imageUri=Uri.fromFile(output);
- }
- //跳转界面到系统自带的拍照界面
- Intent intent=new Intent("android.media.action.IMAGE_CAPTURE");
- intent.putExtra(MediaStore.EXTRA_OUTPUT,imageUri);
- startActivityForResult(intent,TAKE_PHOTO);
- }
- });
-
-
- }
-
- public void saveImageToGallery(Context context, Bitmap bitmap) {
- //检查有没有存储权限
- if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
- Toast.makeText(this, "请至权限中心打开应用权限", Toast.LENGTH_SHORT).show();
- } else {
- // 新建目录appDir,并把图片存到其下
- File appDir = new File(context.getExternalFilesDir(null).getPath() + "BarcodeBitmap");
- if (!appDir.exists()) {
- appDir.mkdir();
- }
-
- Random random = new Random();
- //生成随机数的个数
- int random1 = 0;
- for (int i = 0; i < 6; i++) {
- random1 = random.nextInt(1000000);
- }
-
- String fileName = String.format("%s.jpg", String.valueOf(random1));
- a = context.getExternalFilesDir(null).getPath() + "BarcodeBitmap/" + fileName;
-
- File file = new File(appDir, fileName);
- try {
- FileOutputStream fos = new FileOutputStream(file);
- bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
- fos.flush();
- fos.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
-// // 把file里面的图片插入到系统相册中
-// try {
-// MediaStore.Images.Media.insertImage(context.getContentResolver(),
-// file.getAbsolutePath(), fileName, null);
-// } catch (FileNotFoundException e) {
-// e.printStackTrace();
-// }
-//
-// Toast.makeText(this, fileName, Toast.LENGTH_LONG);
-//
-// // 通知相册更新
-// context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(file)));
- }
- }
-
- @Override
- public void onActivityResult(int requestCode,int resultCode,Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- switch (requestCode){
- case TAKE_PHOTO:
- if (resultCode==RESULT_OK){
- // 使用try让程序运行在内报错
- try {
- //将图片保存
- bitmap= BitmapFactory.decodeStream(getContentResolver().openInputStream(imageUri));
- iv_photo.setImageBitmap(bitmap);
- saveImageToGallery(PictureSearchActivity.this,bitmap);
-
- Ingredient qw=new Ingredient(a);
- String str=qw.ingredient();
- ToIngredient s= new ToIngredient(str);
-
- t1.setText("识别结果:"+"\n"+s.train());//"图片保存位置:"+"\n"+a+"\n"+
-
- }catch (FileNotFoundException e){
- e.printStackTrace();
- }
- }
- break;
- default:break;
- }
-
- }
-
-
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/Fruits/WebViewActivity.java b/app/src/main/java/com/example/Fruits/WebViewActivity.java
deleted file mode 100644
index d9a49a6..0000000
--- a/app/src/main/java/com/example/Fruits/WebViewActivity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.example.Fruits;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-public class WebViewActivity extends AppCompatActivity {
- private WebView mWebView;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.web_view_activity);
- mWebView = (WebView) findViewById(R.id.web_view);
- Intent intent = getIntent();
- String url = null;//"https://baike.baidu.com/item/"+intent.getStringExtra("url"); //"https://baidu.com/";//
- //try {
- url = "https://baike.baidu.com/item/"+intent.getStringExtra("url")+"?&ie=utf-8&oe=UTF-8&wd=";//+ URLEncoder.encode("西瓜","UTF-8");
- //} catch (UnsupportedEncodingException e) {
- // e.printStackTrace();
- // }
- mWebView.loadUrl(url);
- mWebView.getSettings().setJavaScriptEnabled(true);
- mWebView.setWebViewClient(new WebViewClient(){
- });
- }
- @Override
- public void onBackPressed() {
- if (mWebView != null && mWebView.canGoBack()){
- mWebView.goBack();
- }else {
- super.onBackPressed();
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/Fruits/WordSearchActivity.java b/app/src/main/java/com/example/Fruits/WordSearchActivity.java
deleted file mode 100644
index e11322f..0000000
--- a/app/src/main/java/com/example/Fruits/WordSearchActivity.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.example.Fruits;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-public class WordSearchActivity extends AppCompatActivity {
- private EditText mEditUrl;
- private Button mBtnOpen;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.word_search_activity);
-
- mEditUrl = (EditText) findViewById(R.id.edit_url);
- mBtnOpen = (Button) findViewById(R.id.btn_open);
- mBtnOpen.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent intent = new Intent(WordSearchActivity.this, WebViewActivity.class);
- String url = mEditUrl.getText().toString();
- intent.putExtra("url", url);
- startActivity(intent);
- }
- });
- }
-
-}
-
diff --git a/app/src/main/java/com/transfer/AuthService.java b/app/src/main/java/com/transfer/AuthService.java
deleted file mode 100644
index 32738a5..0000000
--- a/app/src/main/java/com/transfer/AuthService.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.transfer;
-
-import org.json.JSONObject;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 获取token类
- */
-public class AuthService {
-
- /**
- * 获取权限token
- * @return 返回示例:
- * {
- * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
- * "expires_in": 2592000
- * }
- */
- public static String getAuth() {
- // 官网获取的 API Key 更新为你注册的
-// String clientId = "百度云应用的AK";
- String clientId = "6H2WBMm7uYGYD2dKqH46EMrM";
- // 官网获取的 Secret Key 更新为你注册的
-// String clientSecret = "百度云应用的SK";
- String clientSecret = "BoSgG8lqIcHfprxnNa2saHiwI5x3o1vP";
- System.out.println(getAuth(clientId, clientSecret));
- return getAuth(clientId, clientSecret);
- }
-
- /**
- * 获取API访问token
- * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
- * @param ak - 百度云官网获取的 API Key
- * @param sk - 百度云官网获取的 Securet Key
- * @return assess_token 示例:
- * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
- */
- public static String getAuth(String ak, String sk) {
- // 获取token地址
- String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
- String getAccessTokenUrl = authHost
- // 1. grant_type为固定参数
- + "grant_type=client_credentials"
- // 2. 官网获取的 API Key
- + "&client_id=" + ak
- // 3. 官网获取的 Secret Key
- + "&client_secret=" + sk;
- try {
- URL realUrl = new URL(getAccessTokenUrl);
- // 打开和URL之间的连接
- HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
- connection.setRequestMethod("GET");
- connection.connect();
- // 获取所有响应头字段
- Map> map = connection.getHeaderFields();
- // 遍历所有的响应头字段
- for (String key : map.keySet()) {
- System.err.println(key + "--->" + map.get(key));
- }
- // 定义 BufferedReader输入流来读取URL的响应
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String result = "";
- String line;
- while ((line = in.readLine()) != null) {
- result += line;
- }
- /**
- * 返回结果示例
- */
- System.err.println("result:" + result);
- JSONObject jsonObject = new JSONObject(result);
- String access_token = jsonObject.getString("access_token");
- return access_token;
- } catch (Exception e) {
- System.err.printf("获取token失败!");
- e.printStackTrace(System.err);
- }
- return null;
- }
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/transfer/ImgCombination.java b/app/src/main/java/com/transfer/ImgCombination.java
deleted file mode 100644
index 12c7e9a..0000000
--- a/app/src/main/java/com/transfer/ImgCombination.java
+++ /dev/null
@@ -1,57 +0,0 @@
-
-package com.transfer;
-
-import com.baidu.ai.aip.utils.HttpUtil;
-import com.baidu.ai.aip.utils.GsonUtils;
-
-import java.util.*;
-
-/**
- * 图像识别组合API
- */
-public class ImgCombination {
-
- /**
- * 重要提示代码中所需工具类
- * FileUtil,Base64Util,HttpUtil,GsonUtils请从
- * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
- * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
- * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
- * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
- * 下载
- */
- public String imgCombinatio(){
- return "QEEEEEE";
- }
- public String imgCombination() {
- // 请求url
- String url = "https://aip.baidubce.com/api/v1/solution/direct/imagerecognition/combination";
- try {
- Map map = new HashMap<>();
- map.put("imgUrl", "https://pic1.zhimg.com/80/v2-31242331d504e03c96015dcc09101c90_1440w.webp");
- List