我想知道有没有办法在Android中用相机 Identifier Gr.Members Gr_ID
0 [ , i] 1
1 a [a, c, g, h, l] 2
2 b [b, d, f, j] 3
3 c [a, c, g, h, l] 2
4 d [b, d, f, j] 3
5 e [e, k] 4
6 f [b, d, f, j] 3
7 g [a, c, g, h, l] 2
8 h [a, c, g, h, l] 2
9 i [ , i] 1
10 j [b, d, f, j] 3
11 k [e, k] 4
12 l [a, c, g, h, l] 2
拍照并将照片保存为JPEG,然后将照片路径插入变量中,然后插入cURL命令?
到目前为止,相机拍摄照片却将照片保存到画廊,但我不知道如何拍照。
MainActivity.java
intent
和XML:
package project.com;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
final String EXTRA_MESSAGE = "fyp.com.pastec_currency_recognition";
final int REQUEST_IMAGE_CAPTURE = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
// Called when the user taps the Camera Button
public void cameraAccess(View view) {
//This function invokes an intent to capture a photo
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null){
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
startActivity(takePictureIntent);
}
}
}
我知道有很多教程可以拍摄照片并保存图像,但是我发现没有任何教程可以让你获得照片的路径并将其存储在一个变量中以便在Java中使用转换了cURL命令。