본문 바로가기

IT Note269

728x90
Ionic 5 # [Android] Can not add task ': processDebugGoogleServices'as a task with that name already exists 개발환경 : ionic, android FCM 가이드를 따라 추가한 뒤 뜨는 에러 Can not add task ': processDebugGoogleServices'as a task with that name already exists 플러그인이 중복되어 나오는 에러였다. build.gradle 파일의 apply from 중 중복된 fcm 플러그인 소스를 주석처리하여 해결하였다. 참고 사이트 : https://cpoint-lab.co.jp/article/201808/5080/ 【Android】「Cannot add task ‘:processDebugGoogleServices’ as a task with that name already exists.」エラーの対処法 本日遭遇したエラーの対処法です。 状況はという.. 2020. 1. 16.
Java #JSONArray 와 JSONObject로 JSON 생성하기 import org.json.simple.JSONArray; import org.json.simple.JSONObject; ... JSONArray jsonArray = new JSONArray(); JSONObject jsonObject = new JSONObject(); jsonObject.put("key1", "value1"); jsonObject.put("key2", "value1"); jsonArray.add(jsonObject); String jsonString = jsonArray.toJSONString(); //jsonString //=> [{"key1":"value1"}, {"key2":"value2"}] 2020. 1. 14.
ionic 5 #staticInjectorError(AppModule)[UniqueDeviceID] ionic 의 unique-device-id 를 사용하고자 한 ts 파일에 import 하니 나온 에러.. staticInjectorError(AppModule)[UniqueDeviceID] app.module.ts 의 providers 에 추가하여 해결하였다. import { UniqueDeviceID } from '@ionic-native/unique-device-id/ngx'; @NgModule({ ... providers: [ ... UniqueDeviceID ], bootstrap: [AppComponent] }) export class AppModule {} https://ionicframework.com/docs/native/unique-device-id 2020. 1. 14.
Java #원하는 길이의 랜덤숫자 생성 import java.util.concurrent.ThreadLocalRandom; public class HelloWorld{ public static void main(String []args){ System.out.println(getRandomLong(22)); //원하는 길이의 랜덤 숫자 반환 } /** * @description 원하는 길이의 랜덤 숫자 반환 * @param len 반환 받을 숫자의 길이 * @return result 결과 값 */ public static String getRandomLong(int len) { ThreadLocalRandom random = ThreadLocalRandom.current(); String result = ""; for(int i=0; i 2020. 1. 2.
Angular 8 #does not exist on type 'GlobalEventHandlers' in angular 에러 does not exist on type 'GlobalEventHandlers' in angular does not exist on type 'GlobalEventHandlers' in angular 상황 html 파일의 iframe 태그에 ViewChild를 걸고 ts 파일에서 this.receiver.contentWindow 를 작성하였고 화면 출력시에 에러가 발생하였다. @ViewChild('myiframe') myiframe: HTMLElement; 해결 @ViewChild의 HTMLElement를 HTMLFrameElement 로 변경하니 해결되었다. HTML Element 에 따라 정확히 지정해두어야 오류가 나지 않는 것이다. @ViewChild('myiframe') myiframe: H.. 2019. 12. 19.
ionic 5 #keypress is not working in Android 안드로이드 폰에서 keypress 가 먹히지 않는 이슈를 발견하였다. 숫자/문자 입력 이벤트를 잡기 위해 keypress대신 ionInput 으로 사용하고 Backspace나 Enter 같은 이벤트를 잡기 위해 keyup을 사용하였다. ion-input 의 value를 유효성 체크하여 값을 비우거나 유지하는 이벤트는 onChange로 사용하였다. 추가 작성. ionic 의 input event 는 속도가 너무 느리다! 속도 개선을 위해 ion-input를 지우고 숫자 키패드를 ion-grid로 출력해 터치 이벤트를 잡아 변수에 담아두는 방식으로 교체했다. 2019. 12. 16.
ionic 5 #Modal Controller 추가하여 사용하기 modal.page.ts 준비 import { Component, Input } from '@angular/core'; import { NavParams, ModalController } from '@ionic/angular'; @Component({ selector: 'app-modal', templateUrl: './modal.page.html', styleUrls: ['./modal.page.scss'] }) export class ModalPage { @Input() something1: string; @Input() something2: string; constructor(private navParams: NavParams, private modalCtrl: ModalController) { c.. 2019. 12. 3.
Angular 8 #사각형 내 점 판별 알고리즘으로 클릭 이벤트 설정하기 영역 외 클릭일 경우 해당 div를 zIndex로 숨긴다. (경우에 따라 다른 방법 가능) IE에선 zIndex를 숫자로 인식하는 현상이 있어 .toString()을 사용하였다. ============= html ============= button ============= ts ============= @ViewChild("_buttonRectangle", {static: false}) _buttonRectangle: jqxButtonComponent; @HostListener("click", ["$event"]) onClick(e) { var point = {x: e.clientX, y: e.clientY}; // 사각형 영역 var rect = this._buttonRectangle.nativeEl.. 2019. 11. 18.
jqWidgets #jqxButton routerLink 2019. 11. 5.
Angular #Lifecycle sequence HookPurpose and Timing ngOnChanges() Respond when Angular (re)sets data-bound input properties. The method receives a SimpleChanges object of current and previous property values. Called before ngOnInit() and whenever one or more data-bound input properties change. Angular가 데이터 바인딩 된 입력 속성을 설정할 때 응답합니다. 이 메소드는 현재 및 이전 특성 값의 SimpleChanges 오브젝트를 수신합니다. ngOnInit () 전에 호출되고 하나 이상의 데이터 바인딩 된 입력 속성이 변.. 2019. 10. 31.
728x90
728x90