일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- error
- release Apk
- Program type already present
- 안드로이드
- html
- JavaScript
- java error
- Android Apk 이름
- android error
- Kotlin
- CSS사용법
- Firebase
- css
- Android
- Java
- jQuery
- apache gzip
- release unsigned
- DataTable
- Android Apk 이름 변경
- Eclipse
- fragment
- Android Apk
- MySQL
- tomcat
- FLUTTER
- Exception
- android fragment
- R프로그래밍
- spring
- Today
- Total
목록App/Android (59)
selfstarter
Android drawable image에서 bitmap으로 변환 drawable image -> bitmap bitmap -> drawable image로 변환 Context context = getApplicationContext(); Drawable drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.girl, null); Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap(); Drawable drawable1 = new BitmapDrawable(context.getResources(), bitmap);
# layout - activity_main.xml ``` xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > ``` - fragment_detail.xml ``` android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" androi..
fragment add, replace add는 activity에 기존 fragment는 놔두고 추가하는 것. onDetch를 호출하지 않을 때도 있다고 한다. 그리고 같은 fragment를 add할 시 에러 발생 replace는 기존 fragment를 변경하는 것. add, remove를 같이 쓰는게 번거로워 보여 간편하게 replace 사용 fragment backstack 현재 실행하려는 트랙잭션의 상태를 기억한다. 스마트폰의 back key를 통해 프래그먼트를 이전 상태로 되돌릴 수 있다 만약 activity가 하나이고 fragment만 이동하는 구조라면 스마트폰 back key 설정을 하지 않으면 앱을 나가버린다 replace 다음에 addToBackStack 함수만 호출하면 된다 public ..
XML에 선언된 Fragment Java객체로 가져오기 android.app.Fragment 사용 시 Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment); androidx.fragment.app.Fragment 사용 시 Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_list);
DrawerLayout Drawer는 서랍 화면에 나타나지 않다가 왼쪽에서 오른쪽으로 touch를 drag하면 나타난다 서랍처럼 열리는 메뉴화면과 메뉴를 열지 않았을 때 보이는 주화면으로 이루어져 있다 주화면은 DrawerLayout에 첫번째이고 layout_gravity 속성을 가지는 메뉴가 서랍메뉴가 된다 메뉴화면이 어느방향으로 열리고 닫힐지는 layout_gravity 속성으로 정의한다 layout_gravity는 오로지 left, right만 지정할 수 있다 Drawer의 너비는 고정값, 높이는 화면 높이와 같게 맞춘다 Dependencies 추가 dependencies { implementation "androidx.drawerlayout:drawerlayout:1.0.0" } Code Draw..
column constraints or comma expected 해결방법 Error or comma expectedCode private static final String SQL_CREATE_USER = "CREATE TABLE "+User.UserEntry.TABLE_NAME + " (" + User.UserEntry.ID + " INTEGER PRIMARY KEY," + User.UserEntry.PASS + " VARCHAR(20)";Case Sqlite query문 작성 시 mysql처럼 VARCHAR(20)을 사용했다. 하지만 sqlite의 문자열 자료형은 TEXT이다. 그래서 TEXT로 수정했다 그래도 문제가 계속 발생하였다. 확인해보니 create query문에서 컬럼이름을 작성할 때 괄..
Android 동영상을 배경화면 넣기 Android 배경화면에 동영상을 넣으려면 VideoView를 사용한다 res/raw 폴더를 생성한다(Android Resource Directory) raw 폴더 안에 동영상을 넣는다. java code로 동영상을 id로 가져올 때 Cannotcannot resolve symbol raw error가 뜰 수 있는데 Clean Project하거나 Android Studio를 껐다 다시 키고 앱 실행시키니까 해결되었다 아래 예제에서 로그인 화면 처럼 좀 예쁘게 꾸미기 위해서 build.gradle 에 dependencies com.google.android.material:material:1.1.0' 을 추가했다. VideoView예제만 보려면 나머지 위젯은 삭..
android constraintlayout 속성 정리 Bias bias는 편견, 치우치다는 의미. app:layout_constraintHorizontal_bias에서 숫자가 작을 수록 수평에서 start쪽에 치우치고 클수록 end 쪽에 치우친다 0.7은 1을 100% 이므로 수평에서 70% 치우쳤다는 의미이다 constrainedWidth, constrainedHeight app:layout_constrainedWidth를 사용하면 전체 너비안에 화면에 요소가 전부보이도록 너비를 수정해준다 높이를 벗어나고 싶지 않다면 app:layout_constrainedHeight="true" 길이가 길어지는 위젯에 써야한다(위에 예제에서 버튼에 쓰면 안됨) Percent layou_width를 0을 주고 lay..