2018년 6월 20일 수요일

웹뷰에서 복사 붙여넣기 방지 소스 WebView, OnLongClickListener


웹뷰에서 복사 붙여넣기 방지 소스 WebView, OnLongClickListener

import android. view.View.OnLongClickListener;

// 웹뷰의 복사, 붙여넣기 예방 소스
wvMaster.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
    Log.d("Debug","On Long Press Web View");
    return true;
}
});


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(); 

배열의 추가 ) 
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;
}

즐거운 시간 보내세요~


자바스크립트에서의 형변환 Number, String


자바스크립트에서의 형변환 Number, String 

문자열을 숫자형으로 변환 : Number()
parseInt() 도 숫자형으로 변환해줘요

숫자를 문자열로 변환 : String() 

have a nice day~


2018년 1월 31일 수요일

자바스크립트에서 오브젝트의 위치와 사이즈 구하기 (input object etc)


자바스크립트에서 오브젝트의 위치와 사이즈 구하기 (input object etc)

object
input
textarea etc

소스 )
//object의 위치와 사이즈 구하기
function getThisAbsPosition(object){
var position = new Object;
position.x = 0;
position.y = 0;

if( object ) {
position.x = object.offsetLeft;
position.y = object.offsetTop;

if( object.offsetParent ) {
var parentpos = getThisAbsPosition(object.offsetParent);
position.x += parentpos.x;
position.y += parentpos.y;
}
}

position.cx = object.offsetWidth;
position.cy = object.offsetHeight;

return position;
}

이용 )
//new version 위치
var object = document.all.jm_keyword;
var position = getThisAbsPosition(object);
//alert("width : " + position.cx);
//alert("height : " + position.cy);
document.all.ID_POP_JIDO_MENU_WRAP.style.left = (position.x-290)+"px";
document.all.ID_POP_JIDO_MENU_WRAP.style.top = (position.y+10)+"px";


2018년 1월 5일 금요일

c# RichTextBox password *****


c# RichTextBox password *****

class )
using System;
using System.Windows.Forms;

class RichPassword : RichTextBox
{
    protected override CreateParams CreateParams
    {
        get
        {
            // Turn on ES_PASSWORD
            var cp = base.CreateParams;
            cp.Style |= 0x20;
            return cp;
        }
    }
}

-------------------------------------------------------------------

//this.rtPw = new System.Windows.Forms.RichTextBox();
this.rtPw = new RichPassword();

...

this.rtPw.Location = new Point(650, 178);
this.rtPw.Width = 180;
this.rtPw.Height = 31; 



2018년 1월 4일 목요일

시샵에서 폼(다이알로그) Form을 중앙에 위치시키고 싶을 경우 CenterScreen


시샵에서 폼(다이알로그) Form을 중앙에 위치시키고 싶을 경우 CenterScreen

ex )

private void FormLogin_Load(object sender, EventArgs e)
{
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
}


2017년 12월 28일 목요일

php indexof -> strpos, 문자열이 있는지 체크해준다


php indexof -> strpos, 문자열이 있는지 체크해준다

ex)
$deviceInfo = "android";
$u_agent = $_SERVER['HTTP_USER_AGENT'];
//echo $u_agent."<br>";
$pos1 = strpos($u_agent, "Android");
$pos2 = strpos($u_agent, "android");
if($pos1==true || $pos2==true) {
    //ANDROID 
//echo "android";

$deviceInfo = "android";
} else {
    //IOS
//echo "ios";

$deviceInfo = "ios";
}

접속 브라우저가 안드로이드인지, 애플의 IOS인지를 분별해줘요 

have a nice day~ 


2017년 12월 19일 화요일

자바스크립트 float 처리 소스, parseFloat


자바스크립트 float 처리 소스

예제)
var percent_company = parseFloat(form.percent_company.value);
var percent_seller = parseFloat(form.percent_seller.value);
var percent_callcenter = parseFloat(form.percent_callcenter.value);
var percent_adv = parseFloat(form.percent_adv.value);
var percent_opt = parseFloat(form.percent_opt.value);
var percent_total = percent_company + percent_seller + percent_callcenter + percent_adv + percent_opt;
if(percent_total<100 || percent_total>100){
alert("수익분배의 총 합계가 100.0이 되어야 등록하실 수 있어요");
return;
}


2017년 11월 30일 목요일

구글애드워즈, 구글광고, 어플광고에서 다음내용이 나오는 경우 승인됨(제한적): 법적 요건: 러시아

구글애드워즈, 구글광고, 어플광고에서 다음내용이 나오는 경우 승인됨(제한적): 법적 요건: 러시아

현지 러시아법에 의해서 구글애드워즈에서 나타내는 메세지이다

광고 타겟팅하실 때 제한적인 국가외에 광고를 하시면 돼요,

구글의 내용에 의하면, 수정 후 1일 정도 후에 확인하라고 공지하고 있어요

즐거운 시간 보내세요

구글 애드워즈
https://adwords.google.com


2017년 11월 27일 월요일

자바스크립트 new Date month+1


자바스크립트 new Date month+1

//new Data 0=1월, 11=12월
var startDate = new Date(dtStartYear, dtStartMonth-1, dtStartDay, dtStartHour, dtStartMinute, 00);
var endDate  = new Date(dtEndYear, dtEndMonth-1, dtEndDay, dtEndHour, dtEndMinute, 00);

have a nice day~


2017년 11월 16일 목요일

안드로이드 Random 난수 , 랜덤으로 숫자 출력 1~15


안드로이드 Random 난수 , 랜덤으로 숫자 출력 1~15

Random mRand;

mRand = new Random();

int nResult = getRandom(15, 1);
if(nResult==1){
ImgIntro.setImageResource(R.mipmap.intro_1);
}else if(nResult==2){
ImgIntro.setImageResource(R.mipmap.intro_2);
}else if(nResult==3){
ImgIntro.setImageResource(R.mipmap.intro_3);
}else if(nResult==4){
ImgIntro.setImageResource(R.mipmap.intro_4);
}else if(nResult==5){
ImgIntro.setImageResource(R.mipmap.intro_5);
}else if(nResult==6){
ImgIntro.setImageResource(R.mipmap.intro_6);
}else if(nResult==7){
ImgIntro.setImageResource(R.mipmap.intro_7);
}else if(nResult==8){
ImgIntro.setImageResource(R.mipmap.intro_8);
}else if(nResult==9){
ImgIntro.setImageResource(R.mipmap.intro_9);
}else if(nResult==10){
ImgIntro.setImageResource(R.mipmap.intro_10);
}else if(nResult==11){
ImgIntro.setImageResource(R.mipmap.intro_11);
}else if(nResult==12){
ImgIntro.setImageResource(R.mipmap.intro_12);
}else if(nResult==13){
ImgIntro.setImageResource(R.mipmap.intro_13);
}else if(nResult==14){
ImgIntro.setImageResource(R.mipmap.intro_14);
}else if(nResult==15){
ImgIntro.setImageResource(R.mipmap.intro_15);
}

-----

public int getRandom(int max, int offset) {
int nResult = mRand.nextInt(max) + offset;
return nResult;
}

랜덤으로 1~15의 숫자로 생성하여 그에 맞게 안드로이드 어플의 인트로 이미지를 변경해줘요,,,

즐거운 시간 보내세요~

android development tip : random function digit create


자바스크립트 숫자에서 3자리마다 콤마를 표기해주기, 정규식 함수


자바스크립트 숫자에서 3자리마다 콤마를 표기해주기, 정규식 함수

한국 원화표기할 대 콤마를 표기해주는데, 유용하게 사용되는 함수

//3자리마다 콤마 표기해주기
function comma(str) {
    str = String(str);
    return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
}

//카테고리 초기정보 셋팅
function initCartInfo(){
for(var i=1; i<=20; i++){
var lcUnitOrderMenu  = getCookie( "order_menu"+i+"_name");
var lcUnitOrderPrice = getCookie( "order_menu"+i+"_price");
var lcUnitOrderCnt   = getCookie( "order_menu"+i+"_cnt");
var lcUnitOnePrice = 0;
if(lcUnitOrderMenu!="" && lcUnitOrderPrice!=""){
eval("document.all.ID_CART_ITEM_NAME_"+i).value  = lcUnitOrderMenu;
eval("document.all.ID_CART_ITEM_NAME_TXT_"+i).innerText = lcUnitOrderMenu;
eval("document.all.ID_CART_ITEM_CNT_"+i).value   = lcUnitOrderCnt;
eval("document.all.ID_CART_ITEM_PRICE_"+i).value = lcUnitOrderPrice; //단가

lcUnitOnePrice = Number(lcUnitOrderPrice) * Number(lcUnitOrderCnt);
lcUnitOnePrice = comma(lcUnitOnePrice);
eval("document.all.ID_CART_ITEM_PRICE_TXT_"+i).innerText = lcUnitOnePrice; //단가*수량

eval("document.all.ID_CART_ITEM_TR_"+i).style.display = "";
}else{
eval("document.all.ID_CART_ITEM_TR_"+i).style.display = "none";
}
}
}

즐거운 시간 보내세요~

2017년 11월 5일 일요일

시샵에서 windows xp 환경에서도 돌아가게 플랫폼 대상 설정 x86


시샵에서 windows xp 환경에서도 돌아가게 플랫폼 대상 설정 x86



any cpu
x64 vista 이상 버전

x86 windows xp이하 버전들

이외 사항이 있을 수 있어요


시샵에서 시작아이콘의 이미지 설정 c#


시샵 (c#) 에서 시작아이콘의 이미지 설정

시샵 툴에서의 설정화면

윈도우 탐색기 폴더안에 .ico 파일이 있어요


c# 초보과정
하나씩 해보세요~