Android
파이어베이스로 푸쉬알림 보내기
build.gradle (app) plugins { id 'com.android.application' } apply plugin: 'com.android.application' android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.example.allmap" minSdkVersion 16 targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguar..
안드로이드 스튜디오 웹뷰 메인 엑티비티
package com.example.allmap; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import androidx.appcompat.app.AppCompatActivity; import java.net.URISyntaxException; public ..
안드로이드 스튜디오 웹뷰 메인 엑티비티
package com.example.allmap; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import androidx.appcompat.app.AppCompatActivity; import java.net.URISyntaxException; public ..
안드로이드 스튜디오 웹뷰 XML 코드
android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent"> android:layout_width="match_parent" android:layout_height="match_parent" />
vscode git 깃허브 연동
기본 스토리지 초기화 > 깃허브 스토리지 생성 > 메인 이름을 master 로 변경/ // 다른방법 초기화 없이 바로 깃허브 연결하기 // 이미 연결된 저장소 지우기 git remote rm origin 1번 git remote add origin + 링크 2번 git pull origin master --allow-unrelated-histories //필수 필수 필수 처음 이걸 안해주면 오류남 오리진은 필수고 마스터는(메인으로 변경될 수 있음) 3번 git push -u origin master //마스터가 메인으로 변경될 수 있음 최종 푸쉬
인텔리제이 JAVA if문,while문 예제
String A = "안녕하세요"; if(A=="안녕하세요"){ System.out.println("반갑습니다"); } else { System.out.println("안녕못합니다"); } while(A == "안녕하세요"){ System.out.println("반가워요"); break; } int a = 1; int b = 2; int c = 3; if(a==1 || a==0){ if(a==1 && b ==2) { if(a==1 || b == 10) { System.out.println("or 연산자 성공"); } } }
인텔리제이 JAVA try catch (예외처리)
public class javastudy { public static void main(String[] args) { int intarray []= new int[5]; //012345 try { intarray[3] = 10; intarray[6] = 1; //인덱스 초과 할당 } catch (Exception e) // try 문 오류시 실행 { e.printStackTrace(); //문제 찾기 System.out.println("배열 범위 초과"); System.exit(0); } System.out.println("프로그램이 끝났어요"); } }
안드로이드 스튜디오 shared preferences 예시(뒤로가기 저장)
선언 EditText et_save; String shared = "file"; @Override//종료시 값 저장 protected void onDestroy() { super.onDestroy(); SharedPreferences sharedPreferences = getSharedPreferences(shared,0); SharedPreferences.Editor editor = sharedPreferences.edit(); String value = et_save.getText().toString(); editor.putString("힌트",value); editor.commit(); } 시작 et_save = (EditText)findViewById(R.id.et_save); //재 시작시 저장..
안드로이드 스튜디오 로그인 화면 xml 만들기
나만의 앱을 만들기 위해 여러 구성 요소들을 생각하다가 로그인 기능은 꼭 필요하겠다 싶어서 로그인 기능을 만들었다. 아래 코드는 첫화면 로그인 xml 코드 회원가입 xml 코드 로그인 성공시 xml