1. DialogFlow Agent 생성 : (지금여기임) 2. 사용자 음성을 구분 할 Entitles 입력 3. 사용자 음성을 받은 뒤 처리 동작을 위한 Intent 입력 4. 기본동작 확인(여기까지면 기본동작은 함) 5. Response를 기본동작이 아닌 코드로 작성 가능한 Fulfillment 작성1 : Inline Edit 6. Response를 기본동작이 아닌 코드로 작성 가능한 Fulfillment 작성2 : Webhook
일단 안드로이드 API29 즉 안드로이드 10버전 부터는 저장소 접근 방식이 변경되어 이전 방식처럼 바로 접근은 불가함
파일 Read/Write
Android 9 이하 (API 28 이하)
Permission 획득 후 접근 가능 - WRITE_EXTERNAL_STORAGE - READ_EXTERNAL_STORAGE
Android 10 이상 (API 29 이상)
Scoped storage 정책 적용
Android 10 에서는 예외사항으로 속성값 적용 시 9버전처럼 사용가능(Target Build SDK가 29일 경우, 30일 경우는 해당 속성값 무시) -> <application .... // 아래부분 추가 android:requestLegacyExternalStorage="true" >
Private 영역은 권한 요청없이 생성, 삭제 가능 Public 영역은 MediaStore 함수를 이용하여 생성, 삭제 등 가능
public class ST_LIST_File {
// 사용 인자 선언
private boolean f_exist;
private final String filetype;
private final String orig_filename;
private final String date;
private final String time;
private final String mode;
private final String type;
private final String frame;
private final String size;
private final String makeTime;
// 내용 삽입을 위한 Public 클래스 선언
public ST_LIST_File(String filetype, String orig_filename, String date, String time, String mode, String type, String frame, String size, String makeTime, boolean f_exist){
this.filetype = filetype;
this.orig_filename = orig_filename;
this.date = date;
this.time = time;
this.mode = mode;
this.type = type;
this.frame = frame;
this.size = size;
this.makeTime = makeTime;
this.f_exist = f_exist;
}
// 값 호출
public String get_filetype(){
return this.filetype;
}
public String get_orig_filename(){
return this.orig_filename;
}
public String get_date(){
return this.date;
}
public String get_time(){
return this.time;
}
public String get_mode(){
return this.mode;
}
public String get_type(){
return this.type;
}
public String get_frame(){
return this.frame;
}
public String get_size(){
return this.size;
}
public String get_makeTime(){
return this.makeTime;
}
public boolean get_f_exist(){
return this.f_exist;
}
public void set_f_exist(boolean flag){
this.f_exist = flag;
}
}
반응형
클래스 명은 원하는데로 지정
해당 클래스로는 일단 1개 정보밖에 저장이 안됨...
그래서!!!
// 구조체 ArrayList 선언
ArrayList<ST_LIST_File> ST_TEST = new ArrayList<>();
위 처럼 ArrayList 를 사용하여 해당 구조체 클래스를 ArrayList로 선언!!
이제 데이터를 삽입해야 함
ArrayList 삽입하는 방식과 똑같음
SMALL
// 데이터 구조에 맞춰 선언
ST_LIST_File tmp = new ST_LIST_File(
"데이터1",
"데이터2",
"데이터3",
"데이터4",
"데이터5",
"데이터6",
"데이터7",
"데이터8",
"데이터9",
"데이터10");
// ArrayList 에 자료 삽입
ST_TEST.add(tmp);
이렇게 선언 후 데이터 삽입을 하면 저장은 완료 ㅎㅎ
사용은 어떻게???
for(int i = 0 ; i < ST_TEST.size() ; i++){
// 구조체 클래스에 선언한 호출함수로 해당 값을 호출
Log.d("Result", ST_TEST.get(i).get_date());
}