Compare commits
17 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
2c61dcc722 | 3 years ago |
|
|
b10c4a49d5 | 3 years ago |
|
|
4f29076db2 | 3 years ago |
|
|
ede0962dba | 3 years ago |
|
|
2e5396ed3b | 3 years ago |
|
|
12559c44cb | 3 years ago |
|
|
067a57341b | 3 years ago |
|
|
62f1100738 | 3 years ago |
|
|
134b85efa5 | 3 years ago |
|
|
a587ade847 | 3 years ago |
|
|
9002f1d3dd | 3 years ago |
|
|
ac0a90d95a | 3 years ago |
|
|
236e009d2a | 3 years ago |
|
|
e6c092e971 | 3 years ago |
|
|
12b5c30308 | 3 years ago |
|
|
900334d9aa | 3 years ago |
|
|
121282ee95 | 3 years ago |
@ -1,21 +0,0 @@
|
||||
package com.baidu.ai.aip;
|
||||
|
||||
import com.baidu.ai.aip.ImgCombination;
|
||||
import com.example.ceshi.four;
|
||||
|
||||
public class ToIngredient{
|
||||
public static String name_odds="AAAAAAAAAAAA";
|
||||
public static void main(String[] args) {
|
||||
ImgCombination img=new ImgCombination();
|
||||
String str = img.imgCombination();
|
||||
String name=str.substring(str.indexOf("name")+7,str.indexOf("\"}"));
|
||||
String odds=str.substring(str.indexOf("score")+7,str.indexOf(","));
|
||||
name_odds="aaaa";//"有"+odds.substring(0,4)+"的概率是"+name;
|
||||
System.out.println("有"+odds.substring(0,4)+"的概率是"+name);
|
||||
}
|
||||
public String x(){
|
||||
name_odds="bbbb";
|
||||
return name_odds;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
package com.example.ceshi;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
public class collection extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.collview);
|
||||
}
|
||||
}
|
||||
@ -1,118 +0,0 @@
|
||||
package com.example.ceshi;
|
||||
|
||||
|
||||
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.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.baidu.ai.aip.ImgCombination;
|
||||
import com.baidu.ai.aip.ToIngredient;
|
||||
import com.baidu.ai.aip.Ingredient;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
|
||||
public class four extends AppCompatActivity {
|
||||
final int TAKE_PHOTO=1;
|
||||
ImageView iv_photo;
|
||||
Uri imageUri;
|
||||
TextView t1;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.fourview);
|
||||
|
||||
Button btn_1=findViewById(R.id.btn_takephoto);
|
||||
iv_photo=findViewById(R.id.img_photo);
|
||||
t1=findViewById(R.id.textView11);
|
||||
|
||||
|
||||
//ToIngredient ii= new ToIngredient();
|
||||
|
||||
ImgCombination img=new ImgCombination();
|
||||
//String str11 = img.imgCombination();
|
||||
Ingredient a=new Ingredient();
|
||||
// "{\"result_num\":5,\"result\":[{\"score\":0.6307158,\"name\":\"砀山酥梨\"},{\"score\":0.19453917,\"name\":\"砀山梨\"},{\"score\":0.06309598,\"name\":\"北丰梨\"},{\"score\":0.062131744,\"name\":\"雪梨\"},{\"score\":0.0255048,\"name\":\"梨\"}],\"log_id\":1582269295467236738}\n";
|
||||
//t1.setText("A"+str11+"B");
|
||||
t1.setText("###"+Ingredient.ingredient());
|
||||
|
||||
|
||||
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(four.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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// String str = ImgCombination.imgCombination();
|
||||
// String name=str.substring(str.indexOf("name")+7,str.indexOf("\"}"));
|
||||
// String odds=str.substring(str.indexOf("score")+7,str.indexOf(","));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected 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 bitmap= BitmapFactory.decodeStream(getContentResolver().openInputStream(imageUri));
|
||||
iv_photo.setImageBitmap(bitmap);
|
||||
|
||||
|
||||
//ToIngredient to_in=new ToIngredient();
|
||||
|
||||
ImgCombination img1=new ImgCombination();
|
||||
String str1 =img1.imgCombination();
|
||||
//// ToIngredient ii= new ToIngredient();
|
||||
// String aa=ii.x();
|
||||
//String name=str.substring(str.indexOf("name")+7,str.indexOf("\"}"));
|
||||
//TextView t1=()findViewById(R.id.textView11);
|
||||
//t1.setText(str1);
|
||||
}catch (FileNotFoundException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,100 +0,0 @@
|
||||
package com.example.ceshi;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;d
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class get extends Activity {
|
||||
// textview
|
||||
private TextView mTextView;
|
||||
// handler线程
|
||||
private Handler mHandler = new Handler() {
|
||||
public void handleMessage(android.os.Message msg) {
|
||||
mTextView.setText((String) msg.obj);
|
||||
};
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.get);
|
||||
// 绑定id
|
||||
mTextView = (TextView) findViewById(R.id.a);
|
||||
|
||||
}
|
||||
|
||||
// 联网
|
||||
private void getHttp() {
|
||||
InputStream stream = null;
|
||||
InputStreamReader re = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
// 找水源
|
||||
URL url = new URL("http://www.taobao.com");
|
||||
// 建立总闸
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
// 建立水道
|
||||
stream = conn.getInputStream();
|
||||
// 捕鱼
|
||||
// 小渔网
|
||||
re = new InputStreamReader(stream);
|
||||
// 大渔网
|
||||
reader = new BufferedReader(re);
|
||||
|
||||
// 捞鱼
|
||||
// 大水桶
|
||||
String len = "";
|
||||
// 小水桶
|
||||
String temp = "";
|
||||
while ((temp = reader.readLine()) != null) {
|
||||
len += temp;
|
||||
}
|
||||
// 更新UI
|
||||
Message sg = new Message();
|
||||
sg.obj = len;
|
||||
mHandler.sendMessage(sg);
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 晒网,关闭资源
|
||||
try {
|
||||
if (reader != null) {
|
||||
reader.close();
|
||||
}
|
||||
if (re != null) {
|
||||
re.close();
|
||||
}
|
||||
if (stream != null) {
|
||||
stream.close();
|
||||
}
|
||||
|
||||
} catch (Exception e2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮监听
|
||||
public void aaa(View v) {
|
||||
//新建一个线程
|
||||
new Thread() {
|
||||
public void run() {
|
||||
getHttp();
|
||||
};
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/web_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:layout_editor_absoluteX="61dp"
|
||||
tools:layout_editor_absoluteY="86dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_x="307dp"
|
||||
android:layout_y="666dp"
|
||||
android:background="@android:color/holo_orange_light"
|
||||
android:text="收藏" />
|
||||
</WebView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".first">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/five"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我的收藏"
|
||||
android:textSize="25dp"
|
||||
android:textColor="#663399"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" app:layout_constraintHorizontal_bias="0.497"
|
||||
app:layout_constraintVertical_bias="0.499"/>
|
||||
<SearchView
|
||||
android:layout_width="407dp"
|
||||
android:layout_height="100dp" tools:layout_editor_absoluteY="1dp" tools:layout_editor_absoluteX="1dp"
|
||||
tools:ignore="MissingConstraints"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -1,27 +0,0 @@
|
||||
<?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"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/a12"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="获取"
|
||||
android:onClick="aaa"
|
||||
/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_below="@id/a12"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/a"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="获取网址内容" />
|
||||
</ScrollView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 236 KiB |
|
After Width: | Height: | Size: 276 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 276 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 250 KiB |
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android API 33, extension level 3 Platform" project-jdk-type="Android SDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
@ -1,4 +1,4 @@
|
||||
package com.example.ceshi;
|
||||
package com.example.Fruits;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
|
After Width: | Height: | Size: 162 KiB |
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 29 KiB |
@ -1,4 +1,4 @@
|
||||
package com.baidu.ai.aip;
|
||||
package com.transfer;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.transfer;
|
||||
|
||||
public class ToIngredient{
|
||||
String name_odds;
|
||||
String str;
|
||||
public ToIngredient(String strin ) {
|
||||
str=strin;
|
||||
}
|
||||
|
||||
public String train(){
|
||||
int a1=str.indexOf("name");
|
||||
int a2=str.indexOf("\"}");
|
||||
int b1=str.indexOf("score");
|
||||
// String name=str.substring(str.indexOf("name"),str.indexOf("\"}"));
|
||||
// String odds=str.substring(str.indexOf("score")+7,str.indexOf(","));
|
||||
// name_odds="有"+odds.substring(0,4)+"的概率是"+name;
|
||||
String name=str.substring(a1+7,a2); //String.valueOf(str.charAt(7));
|
||||
String odds=str.substring(b1+7,a2);
|
||||
|
||||
name_odds="有"+odds.substring(0,4)+"的概率是"+name;
|
||||
return name_odds;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 649 B |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,121 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity=""
|
||||
android:orientation="vertical"
|
||||
tools:context=".CollectActivity">
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:background="@mipmap/ic_launcher"-->
|
||||
<!-- android:layout_width="100dp"-->
|
||||
<!-- android:layout_height="100dp">-->
|
||||
<!-- </ImageView>-->
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="标题"></EditText>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="69dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="内容"></EditText>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
<!-- <EditText-->
|
||||
<!-- android:id="@+id/password"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:hint="内容"></EditText>-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/buttonadd"-->
|
||||
<!-- android:layout_width="207dp"-->
|
||||
<!-- android:layout_height="50dp"-->
|
||||
|
||||
<!-- android:text="添加收藏"></Button>-->
|
||||
|
||||
|
||||
<!-- <EditText-->
|
||||
<!-- android:id="@+id/selectuser"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:hint="标题"></EditText>-->
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/buttondelete"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="50dp"-->
|
||||
|
||||
<!-- android:text="删除"></Button>-->
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonadd"
|
||||
android:layout_width="221dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:text="添加"></Button>
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttondelete"
|
||||
android:layout_width="213dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:text="删除"></Button>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonselect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
app:backgroundTint="#2ACD6B"
|
||||
android:text="查询"></Button>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<WebView
|
||||
android:id="@+id/web_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |