본문 바로가기

반응형

안드로이드

(75)
카카오내비 길찾기 자바 implementation "com.kakao.sdk:v2-navi:2.20.1" Intent gt= NaviClient.getInstance().navigateIntent(new Location(title, lng+"", lat+""), new NaviOption(CoordType.WGS84)); startActivity(gt);
android 타임아웃 주고 현재위치 찾기 implementation 'com.google.android.gms:play-services-location:21.0.0' private FusedLocationProviderClient fusedLocationProviderClient; boolean locationReceived=false; Handler timeoutHandler; private void getLocation() { timeoutHandler = new Handler(); fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(IntroActivity.this); if (ActivityCompat.checkSelfPermission(this, Ma..
android webview popup **FrameLayout 으로 구성하여 addview 해줘야 함.. import androidx.appcompat.app.AppCompatActivity; import android.Manifest; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.DialogInterface;..
안드로이드 다른앱 위에 그리기(노티알림) 1.매니페스트 2.권한 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // 마시멜로우 이상일 경우 if (!Settings.canDrawOverlays(this)) { // 다른앱 위에 그리기 체크 Uri uri = Uri.fromParts("package" , getPackageName(), null); Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, uri); startActivityForResult(intent, 2222); } else { } } else { } 3.서비스 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { st..
WorkerManager android java 1. build.gradle def work_version = "2.7.1" implementation "androidx.work:work-runtime:$work_version" 2 WorkerManager public class WorkerManager extends Worker { public WorkerManager(@NonNull Context context, @NonNull WorkerParameters workerParams) { super(context, workerParams); } @NonNull @Override public Result doWork() { android.util.Log.d("myLog", "Doing some background work!"); doWork(); re..
안드로이드 문자 , 카카오톡 알림 캐치 1.메니페스트에 서비스 선언 2. 메인에서 시스템 권한 요청 if (!permissionGrantred()) { Intent gt= new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"); startActivity(gt); } private boolean permissionGrantred() { Set sets = NotificationManagerCompat.getEnabledListenerPackages(this); if (sets != null && sets.contains(getPackageName())) { return true; } else { return false; } } 3.서비스 구현 com.android.messagi..
Android Java 갤러리 다중이미지 가져와서 연속크랍(Crop) implementation 'com.github.yalantis:ucrop:2.2.5' 1.갤러리 호출 private void getImageUri() { Intent intent = new Intent(Intent.ACTION_PICK); intent.setType(MediaStore.Images.Media.CONTENT_TYPE); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent, 2222); } 2.사진 선택후 onActivityResult에서 crop 라이브러리 호출 List imageUri..
PDF 파일 불러와서 Sign하기(JAVA) 1.PDF 파일을 Bitmap 으로 변경 Bitmap pdf = pdfToBitmap(context, pdfFile, 0); public static Bitmap pdfToBitmap(Context context, File pdfFile, int pageNumber) { try { ParcelFileDescriptor fileDescriptor = ParcelFileDescriptor.open(pdfFile, ParcelFileDescriptor.MODE_READ_WRITE); PdfRenderer pdfRenderer = new PdfRenderer(fileDescriptor); PdfRenderer.Page page = pdfRenderer.openPage(pageNumber); int rendere..

반응형