본문 바로가기
반응형

Android49

Android Naver map test는 아래 기기에서 진행함. samsung note 8 (android 9) xiaomi redmi 9 (android 11) 개발 툴 정보 Android Studio Chipmunk | 2021.2.1 Patch 1 Build #AI-212.5712.43.2112.8609683, built on May 19, 2022 Runtime version: 11.0.12+7-b1504.28-7817840 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 Memory: 1280M Cores: 12 *androidx로 인해 개발 툴 정보도 포함 함. 4.1버전하고 조금 다른 부분이 있음. 기능 지도 띄우고, 이벤트 몇개만 추가한 .. 2022. 8. 5.
android floating Action bar & Bottom Navigation View(5) test는 아래 기기에서 진행함. samsung note 8 (android 9) xiaomi redmi 9 (android 11) 그 외 리소스 파일 badge, 메뉴 등등의 리소스들을 코드로 올리려고 하였으나 귀찮아서.... 통으로 압출해서 올림. *소스도 dll 파일이나 기타 등등의 파일을 제외하고 소스만 추출하는 방법이 있는 것 같은데... 찾아보기 귀찮고... 암튼.... 통으로 다 올림. 없는 파일 있으면 댓글 주시면, 올리겠습니다. 블로그를 매일 보는 것이 아니라서... 시간이 얼마나 걸릴지는 모르겠네요. 하지만, 당분간 기존 진행한 프로젝트에서 구현한 기능 중에 업무를 제외한 구현한 기능만 정리해서 업로드 할 예정입니다. 2022. 8. 2.
android floating Action bar & Bottom Navigation View(4) test는 아래 기기에서 진행함. samsung note 8 (android 9) xiaomi redmi 9 (android 11) 대량의 텍스트를 사용하여 TextView에 스크롤이 생기게해서 상단바, 하단바가 감춰지는 것을 테스트. a_text.java package com.norang.autoactionbar; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.annotation.SuppressLint; import andro.. 2022. 8. 1.
android floating Action bar & Bottom Navigation View(3) test는 아래 기기에서 진행함. samsung note 8 (android 9) xiaomi redmi 9 (android 11) 스크롤 되는 사이트(webview)로 상단바, 하단바가 감춰지는 것을 테스트. a_web.java package com.norang.autoactionbar; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.core.conten.. 2022. 8. 1.
android floating Action bar & Bottom Navigation View(2) test는 아래 기기에서 진행함. samsung note 8 (android 9) xiaomi redmi 9 (android 11) 기본 코드 AndroidManifest.xml build.gradle ----------------------------------------------------------------------------------------------------------- plugins { id 'com.android.application' } android { compileSdk 32 defaultConfig { applicationId "com.norang.autoactionbar" minSdk 28 targetSdk 32 versionCode 1 versionName "1.0" .. 2022. 7. 22.
android floating Action bar & Bottom Navigation View(1) floating action bar floating Bottom Navigation Vew badge 2022. 7. 16.
SharedPreferences 사용법 간단한 읽고, 쓰기 //load private SharedPreferences appData; protected void onCreate(Bundle savedInstanceState) { appData = getSharedPreferences("map", MODE_PRIVATE); } //읽기 public void btnReadClick(View view) { String value = appData.getString("walkthrough", "");//""인 기본 값 if (value.equals("")) { intent = new Intent(getApplicationContext(), OnBoardingActivity.class); startActivity(intent); } } //쓰기 pub.. 2021. 11. 29.
LinearLayout LinearLayout 정리중 android:orientation="vertical" //horizontal. vertical 참고 URL https://recipes4dev.tistory.com/89 2021. 11. 29.
WebView로 cookie 데이터 저장 WebView로 cookie 데이터 저장 import android.webkit.CookieManager; CookieManager.getInstance().removeAllCookies(null); CookieManager.getInstance().setCookie("http://192.168.18.13:808", "name" + "=" + name); CookieManager.getInstance().setCookie("http://192.168.18.13:808", "action" + "=" + action); CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true); webView.loadUrl("http://192.168.18... 2021. 8. 9.
[error] java.net.ConnectException: Failed to connect to /192.168.18.13:44354 D/NetworkManagementSocketTagger: tagSocket(76) with statsTag=0xffffffff, statsUid=-1 W/System.err: java.net.ConnectException: Failed to connect to /192.168.18.13:44354 W/System.err: at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:1418) W/System.err: at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:1368) W/System.err: at com.android.o.. 2021. 8. 6.
[error] Uncaught TypeError: Cannot read property 'setItem' of null", source Uncaught TypeError: Cannot read property 'setItem' of null", source webview에서 발생시 아래 코드 넣어주면 됨. 로컬저장소 사용을 허가하는 설정. webView.getSettings().setDomStorageEnabled(true); 2021. 8. 6.
postDelayed public class MainActivity extends Activity { final Handler handler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); auth(); handler.postDelayed(new Runnable() { @Override public void run() { gotoLogin(); } }, 1000 * 2); } protected void auth() { } protected void gotoLogin() { Intent intent .. 2021. 8. 4.
Android webview에서 kakaomap 표시 안될 때.. 크롬에서는 잘 보이는데... app안의 webview에서는 안보일 때. 다음과 같이 한다. 아마도 os가 9버전부터 허용되지 않은, 도메인은 접속 못하게 하는 기능 때문으로 보인다. 아마 app에서 나가는 요청은.. 다 해야 될 것으로 보인다. daum.net daumcdn.net dapi.kakao.com 192.168.18.13 daumcdn.net dapi.kakao.com 2021. 7. 26.
AlertDialog AlertDialog AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);//this, LoginActivity.context(x) builder.setTitle("알림"); builder.setMessage("비밀번호를 발급받으시겠습니까?"); builder.setCancelable(false);//외부 클릭시 팝업 닫히는 것 무시 builder.setNegativeButton("취소", new DialogInterface.OnClickListener(){ @Override public void onClick(DialogInterface dialog, int id) { gotoWebView("miniforget.html").. 2021. 7. 19.
[error] java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, int)' on a null object reference 위에러 해결법. 혹시, 다음과 같이 외부 class에 적용해 두었다면... 꼭 확인 해 볼 것. public class SettingData { public static SettingData singleTon; private Context context; private SharedPreferences appData; private SettingData() { .. 2021. 7. 19.
actionbar 제거 제거 방법 1 res\values\themes\themes.xml의 내용을 수정. 위 두개의 theme.xml 수정함. false true 제거 방법 2 소스에서 제거 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_site); ActionBar actionBar = getSupportActionBar(); actionBar.hide(); String url = ""; webView = findViewById(R.id.webView); webView.getSettings().setJavaScriptEnabled(true.. 2021. 7. 11.
[error] ERR_CLEARTEXT_NOT_PERMIT webview에서 안드로이드 버전 9부터 나오는 에러로 아래 URL 참조하면됨. https://captainyellow.tistory.com/654?category=804032 [Tip] 안드로이드 9(pie) http 프로토콜 접속 에러 android 7 이하 버전에서는 정상 작동 하던 http 프로토콜이 버전 8이상부터 작동이 안될 때. AndroidManifest.xml에 다음 코드를 추가한다. android:allowBackup="true" .. captainyellow.tistory.com 추가로...www.naver.com -> naver.com으로 등록해야됨 2021. 7. 11.
[error] cannot infer type arguments for ArrayAdapter<> CallbackExecute에서 spinner에 바인드할 경우 발생 ArrayAdapter spnAdp = new ArrayAdapter(this, R.layout.support_simple_spinner_dropdown_item, arrGroup); 다음과 같이 변경. ArrayAdapter spnAdp = new ArrayAdapter(SearchActivity.this, R.layout.support_simple_spinner_dropdown_item, arrGroup); 2021. 6. 23.
[Tip] 안드로이드 9(pie) http 프로토콜 접속 에러 android 7 이하 버전에서는 정상 작동 하던 http 프로토콜이 버전 8이상부터 작동이 안될 때. AndroidManifest.xml에 다음 코드를 추가한다. .............................. 그리고...res 폴더 밑에 xml 폴더를 만들고, network_security_config.xml을 만들고 다음 코드를 추가한다. app\src\main\res\xml\network_security_config.xml 192.168.18.13 해결 방법은 몇가지 있으나... 이 것이 제일 보편적임. 허용할 서버만 밑으로 추가만 하면됨. 이렇게 하는 방법도 있음. 딱 저 빨간 색만 AndroidManifest.xml에 추가 하면 됨. .............................. 2021. 6. 14.
[ERROR] You need to use a Theme.AppCompat theme (or descendant) with this activity. You need to use a Theme.AppCompat theme (or descendant) with this activity. 위 메세지는 AlertDialog를 사용할 때 나타나며... 해결 방법은 2가지가 있다. 첫번째는 import 를 다음과 같이 변경하는 것이다. import android.support.v7.app.AlertDialog; -> import android.app.AlertDialog; 두번째는 AndroidManifest에 다음 코드를 추가 하는 것 첫번째를 선택했을 경우, Unable to add window -- token null is not for an application 위에 같은 메세지가 나타날 수 있다. 이 경우에는 아래와 같이 코딩이 되어 있을 것이다. A.. 2021. 6. 11.
Android FileList 파일 탐색기 안드로이드 파일 탐색기 중간에 필터로 걸린 부분있으나.. 강제로 모든 파일 조회되게 변경해 놓음. FileTreeListViewAdapter에서 파일 선택하는 부분은, 폴더, 파일 이미지 인터넷이나 개인이 사용하는 이미지 사용바람. 따로 올려 놓지 않음. 저작권 문제가 있을 수 있어서... *주의사항 external 저장장치와 SD card는 착각하면 안된다... 네이밍도 그지같이 해 놓음. ㅡㅡ; test device : note 4 android os : Marshmallow 6.0 package com.example.sampleproject; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; imp.. 2021. 4. 4.
Android Dialog Android Dialog로 사용가능한 모든 예제... 더 있나?? test device : note 4 android os : Marshmallow 6.0 package com.example.sampleproject; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.Gravity; import android.view.View; import android.widget.EditText;.. 2021. 4. 2.
Android QRcode Create test device : note 4 android os : Marshmallow 6.0 build.gradle implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.journeyapps:zxing-android-embedded:3.6.0' activity_qrcode.xml QrcodeActivity.java package com.example.sampleproject; import androidx.appcompat.app.AppCompatActivity; import android.graphics.Bitmap; import android.os.Bundle; import android.util.Log; import an.. 2021. 3. 17.
Android Barcode Create test device : note 4 android os : Marshmallow 6.0 build.gradle implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.journeyapps:zxing-android-embedded:3.6.0' activity_barcode_print.xml BarcodePrintActivity.java package com.example.sampleproject; import androidx.appcompat.app.AppCompatActivity; import android.graphics.Bitmap; import android.graphics.Color; import android.o.. 2021. 3. 17.
Bluetooth file & text transfer #3 client test device : note 4 android os : Marshmallow 6.0 Client Source activity_bluetooth2.xml Bluetooth2Activity.java package com.example.sampleproject; import androidx.annotation.Nullable; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.blue.. 2021. 3. 17.
Bluetooth file & text transfer #2 server test device : note 4 android os : Marshmallow 6.0 server source Source activity_bluetooth1.xml Bluetooth1Activity.java package com.example.sampleproject; import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothSocket; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import a.. 2021. 3. 17.
Bluetooth file & text transfer #1 etc test device : note 4 android os : Marshmallow 6.0 설명 없음. 알아서 보시기 바람. 소스 full로 올림. Source BlueToothData.java public class BlueToothData implements Serializable { private SettingValue.BT_MESSAGE_TYPE message_type; private String fileName; private byte [] data; public SettingValue.BT_MESSAGE_TYPE getMessage_type() { return message_type; } public void setMessage_type(SettingValue.BT_MESSAGE_TYPE mes.. 2021. 3. 17.
Android ListView Sorting List의 데이터를 정렬함. 2개의 데이터를 비교(파일, 폴더 구분, 이름) private ListView lvListView; private ArrayList arrFileData; lvListView = (ListView)findViewById(R.id.lvListView); //정렬 비교 로직(폴더 파일 오름 차순 ) private Comparator folderNfileSorting = new Comparator() { @Override public int compare(FileData data1, FileData data2) { int result ; if (data1.getIsFile() < data2.getIsFile()) result = -1; else if (data1.getIsFile(.. 2021. 1. 3.
Android Error Message android.content.res.Resources$NotFoundException imageview의 경우 리소스 파일 위치 변경. 참조:https://stackoverflow.com/questions/48161713/android-content-res-resourcesnotfoundexception-resource-id-0x7f07007e 2021. 1. 1.
자주 쓰는 코드 모음. Toast.makeText(getApplicationContext(), "print string", Toast.LENGTH_LONG).show(); //패키지 이름 가져오기. Context.getPackageName() //OR getPackageName() //String replace string= string.replace("D+", "A+"); //개행 \r, \n, \r\n foreach for(String s : filesList) tvTest.setText(tvTest.getText() + s + "\r"); 2020. 10. 30.
반응형