2018년 5월 27일 일요일
안드로이드 스튜디오에서 import R 에러 발생시의 방법
안드로이드 스튜디오에서 import R 에러 발생시의 방법
안드로이드 스튜디오
File > Invalidate Caches / Restart ...
정상 가동되는 것을 보실 수 있어요
2018년 5월 19일 토요일
안드로이드 fcm com.google.firebase.messaging.default_notification_icon error
안드로이드 fcm com.google.firebase.messaging.default_notification_icon error
firebase sdk 버전이 낮을 경우 에러 발생
어플이 닫혀있을 경우 ( 홈버튼이나 잠금화면의 경우 )
default 아이콘이 나와야 하는데, 나오지 않는 경우에 다음과 같이 해결하세요~
에러발생
com.google.firebase:firebase-messaging:11.8.0
에러해결
implementation 'com.google.firebase:firebase-messaging:12.0.1'즐거운 시간 보내세요~
2018년 4월 20일 금요일
php 분 차이 구하기 ( 두 날짜의 시 분 초 차이 구하기 ) date, strtotime
php 분 차이 구하기 ( 두 날짜의 시 분 초 차이 구하기 ) date, strtotime
//$dbDate = "2018-03-21 19:23:00"; //데이타베이스의 datetime형식의 값
$dbDate = fnFormatDate($lcEtDate, "-")." ".fnFormatHms($lcEtHms, ":");
$todayTime=date("Y-m-d H:i:s"); // 현재시간 23시 35임
$someTime=strtotime($todayTime)-strtotime("$dbDate GMT"); // 현재시간에서 작성된 시간을 뺌
$passHour = date("H", $someTime);
$passMinutes = date("i", $someTime);
$passResultMinutes = ((int)$passHour*60) + (int)$passMinutes;
//$passResultMinutes = $passHour."시간".$passMinutes."분";
//echo date('H시 i분 s초 지났습니다.', $someTime);
즐거운 시간 보내세요~
2018년 4월 16일 월요일
php 다차원 배열 예제, array_push
php 다차원 배열 예제, array_push
예제 )
$arrayTotal = array();
while($row1 = mysql_fetch_array($rs1)){
$arUnit = array(
'name' => $row1[name],
'hp' => $row1[hp],
'latitude' => $row1[latitude],
'longitude' => $row1[longitude]);
array_push($arrayTotal, $arUnit);
예제 )
$arrayTotal = array();
while($row1 = mysql_fetch_array($rs1)){
$arUnit = array(
'name' => $row1[name],
'hp' => $row1[hp],
'latitude' => $row1[latitude],
'longitude' => $row1[longitude]);
array_push($arrayTotal, $arUnit);
}
배열의 선언 부분 )
$arrayTotal = array();
배열의 추가 )
array_push($arrayTotal, $arUnit);
즐거운 시간 보내세요~
2018년 4월 10일 화요일
php date를 timestamp로 변경하는 소스, strtotime
php date를 timestamp로 변경하는 소스, strtotime
$lcTodayDate = fnTodayDate("-");
$lcTodayTimestamp = strtotime($lcTodayDate);
$lcYesterday = fnDateAdd('w', -1, $lcTodayTimestamp);
2018년 4월 9일 월요일
안드로이드 서비스에서 UI에 해당하는 Toast message 출력하기
안드로이드 서비스에서 UI에 해당하는 Toast message 출력하기
서비스 )
public class MsSvcBedalDhBackgroundSvc extends Service {
...
}
시스템 쓰레드 )
Runnable mRun = new Runnable() {
public void run() {
try{
while( bThreadGo ){
Log.i(TAG, ">mRun : 이거를 계속 탄다.");
iLoopValue++;
Thread.sleep(iThreadInterval);
if(iLoopValue>100000)iLoopValue=0;
positionSaveProc();
} //end while
}catch(Exception e){
e.printStackTrace();
}
}
};
UI 쓰레드의 호출 )
/*
* 변경된 위치를 저장해준다.
*/
public synchronized void positionSaveProc(){
Log.i(TAG, ">positionSaveProc : loop call start ");
String sUnitBatchExecYn = getSharePreferenceStringValue("batch_exec_yn");
//로그인을 했기 때문에 가동해준다
if(sUnitBatchExecYn.equals("Y")){
//UI Thread
Message msg = new Message();
msg.what = 0;
msg.obj = null;
handler.sendMessage(msg);
}
}
2018년 3월 22일 목요일
자바스크립트 몇일 더한 날짜 가져오기 setDate new Date함수 이용
자바스크립트 몇일 더한 날짜 가져오기 setDate new Date함수 이용
함수 )
/*
몇일 더한 날짜 가져오기
@parmPM : 0(오늘), 1(내일)
@return : 20180101
*/
function getPMDate( parmPM ){
var today = new Date();
//today.setDate(today.getDate() + 25); //25일 더하여 값을 보내줘요
today.setDate(today.getDate() + parmPM); //parmPM일 더하여 setting
var year = Number(today.getFullYear());
var month = Number(today.getMonth() + 1);
var day = Number(today.getDate());
var vl = String(year);
vl = vl + indexFnDigitTwoApply(month);
vl = vl + indexFnDigitTwoApply(day);
return vl;
}
즐거운 시간 보내세요~
함수 )
/*
몇일 더한 날짜 가져오기
@parmPM : 0(오늘), 1(내일)
@return : 20180101
*/
function getPMDate( parmPM ){
var today = new Date();
//today.setDate(today.getDate() + 25); //25일 더하여 값을 보내줘요
today.setDate(today.getDate() + parmPM); //parmPM일 더하여 setting
var year = Number(today.getFullYear());
var month = Number(today.getMonth() + 1);
var day = Number(today.getDate());
var vl = String(year);
vl = vl + indexFnDigitTwoApply(month);
vl = vl + indexFnDigitTwoApply(day);
return vl;
}
즐거운 시간 보내세요~
피드 구독하기:
글 (Atom)