textToSpeech = new TextToSpeech(getApplicationContext(), status -> { if (status != TextToSpeech.ERROR) { textToSpeech.setLanguage(Locale.KOREAN); } });
private void texttoSpeak() { String text = speakText.getText().toString(); if ("".equals(text)) { text = "Please enter some text to speak."; Toast.makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show(); return; }
public class UploadResult { private String result;
public String getResult() { return result; }
}
public class RetrofitURL { public static final String IPADDRESS = "http://www.abc.com/androidSample/upload/";
public static final String URL_ImageUpload = "upload.php"; }
public class APIRequest { static Retrofit retrofit = null;
public static Retrofit getClient() { if (retrofit==null) { retrofit = new Retrofit.Builder() .baseUrl(RetrofitURL.IPADDRESS) .client(createOkHttpClient()) .addConverterFactory(GsonConverterFactory.create()) .build(); } return retrofit; }
public static OkHttpClient createOkHttpClient() { // 네트워크 통신 로그(서버로 보내는 파라미터 및 받는 파라미터) 보기 OkHttpClient.Builder builder = new OkHttpClient.Builder(); HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); builder.addInterceptor(interceptor); return builder.build(); } }
#Step 13 – Apache SSL 설정 파일(ssl.conf) 수정 vi /etc/httpd/conf.d/ssl.conf # shift + g 눌러서 파일의 맨 아래로 이동한다. # 설정파일의 맨 끝 </VirtualHost> 앞에 아래 내용 추가 SuexecUserGroup apache apache
#Step 15 – httpd.conf 파일 수정 vi /etc/httpd/conf/httpd.conf ServerName localhost <IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
<Directory "/var/www/html"> Options +FollowSymLinks -Indexes AllowOverride All Require all granted <LimitExcept GET POST> Order deny,allow Deny from all </LimitExcept> </Directory>
# Step 17 – Configure PHP-FPM vi /etc/php.ini cgi.fix_pathinfo=0 short_open_tag = On post_max_size = 60M ; // 8M 으로 되어 있었음. memory_limit = 128M upload_max_filesize = 50M ; // 기본 2M 으로 되어 있었음 allow_url_fopen = On ;PHP Excel Libray 설치가 안되는 현상이 있어서 On으로 변경함. date.timezone ="Asia/Seoul"
;PHP 버전정보 노출 방지 expose_php=Off
;PHP에서 세션은 일단 생성 된 뒤에, 가비지 콜렉터 관리로직에 의해 소멸된다. session.gc_probability = 1 session.gc_divisor = 1 ;이값이 100이면 1/100 즉 1%의 확률로 가비지콜렉션이 실행된다. ;1이면 정확하게 유효기간이 넘은 데이타가 삭제될 것이다. session.gc_maxlifetime = 3600
1. ID/PW 인증 - 로그인한 정보에 오늘 날짜 SMS 인증 기록 유무를 가져온다. - 오늘날짜 인증기록이 없으면 SMS 인증으로 분기한다. - SMS 인증 기록이 있으면, PIN 번호 인증을 한다. 2. SMS OTP 인증 (1일 1회 인증 원칙) - SMS 인증 API를 통해 휴대폰으로 인증번호 발송 - 인증번호 6자리를 입력하고 검증(verify) API 로 전송 - 검증(verify) API 로부터 success return을 받으면 - 서버에 사용자 인증 시각 정보를 기록한다. - 전일 인증 기록이 있을 경우 당일 인증 요청이 없는 것으로 간주하고 사용자 인증 정보를 update 한다. - error를 받으면 에러 상황에 맞는 것을 Popup으로 보여주고 로그인 종료처리한다.
<?php // 파일을 직접 실행하는 비정상적 동작을 방지 하기 위한 목적 if(isset($_POST) && $_SERVER['REQUEST_METHOD'] == "POST"){ @extract($_POST); // $_POST['loginID'] 라고 쓰지 않고, $loginID 라고 써도 인식되게 함 if(isset($userID) && !empty($userID) && isset($password) && !empty($password)) { require_once 'phpclass/dbconnect.php'; require_once 'phpclass/loginClass.php'; $c = new LoginClass();
String photoURL = Value.PhotoADDRESS + PrefsHelper.read("profileImg","") + ".jpg"; // 사진 이미지가 존재하지 않을 수도 있으므로 존재 여부를 체크하여 존재하면 ImageView 에 표시한다. PhotoURLExists task = new PhotoURLExists(); try { if(task.execute(photoURL).get()==true){ Glide.with(mContext).load(photoURL).override(170, 200).into(img_profile); } } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); }