Activity에서 다른 Activity를 호출할 때 Intent를 이용하여 화면전환을 하는 것과 같이 핸드폰에 기본적으로 장착된 App의 Activity를 호출 하는 경우에는 Intent의 action 중 ACTION_VIEW를 이용하여 웹 브라우저를 호출하는 방법 입니다.
기본 브라우저를 이용하여 웹 페이지 URL을 연결하려면 public Intent (String action, Uri uri) 메소드를 사용하는데 action 부분에는 ACTION_VIEW를 입력하고 Uri는 웹 주소를 입력하면 됩니다.

 

Intent intentUrl = new Intent(Intent.ACTION_VIEW, Uri.parse("https://copycoding.tistory.com/"));
startActivity(intentUrl);

 

URL에 파라미터를 추가해서 넘기려면 URL 뒤에 붙여주도록 합니다.

 

String param = "/47";
Intent intentParam = new Intent(Intent.ACTION_VIEW, Uri.parse("https://copycoding.tistory.com/" + param));
startActivity(intentParam);

 

인터넷을 사용해야 하므로 Manifest에 permission을 추가해 주면 됩니다.
<uses-permission android:name="android.permission.INTERNET" />

 

버튼을 누르면 첫화면으로 이동 하고 param을 붙인경우 페이지를 찾아 갑니다.

 

 

전체 소스
수정된 파일은 3개 입니다.

AndroidManifest.xml

 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="copycoding.tistory.actionviewuri">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.ActionViewUri">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

 

activity_main.xml

 

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    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">

    <Button
        android:id="@+id/btnUrl"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="URL"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.229"
        android:onClick="clickUrl"/>

    <Button
        android:id="@+id/btnParam"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="176dp"
        android:text="URL+Param"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btnUrl"
        app:layout_constraintVertical_bias="0.0"
        android:onClick="clickParam"/>
</androidx.constraintlayout.widget.ConstraintLayout>

 

 

MainActivity.java

 

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {

   @Override protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
   }
     
  public void clickUrl(View view) {
     Intent intentUrl = new Intent(Intent.ACTION_VIEW, Uri.parse("https://copycoding.tistory.com/"));
     startActivity(intentUrl);
  }

  public void clickParam(View view) {
      String param = "/47";
      Intent intentParam = new Intent(Intent.ACTION_VIEW, Uri.parse("https://copycoding.tistory.com/" + param));
      startActivity(intentParam);
   }
}

 

- copy coding -

티스토리 글쓰기가 변경되어서 표 그리기가 어렵긴 한데 일년에 한번 하는거라 함 정리해 봅니다.

 

특이한건 올해부터 UI/UX 디자이너 항목이 신설 되었군요.

 

2020년에 해당하는 자료가 2021년 단가로 사용됩니다.

 

의외로 단가가 내려간 경우도 눈에 띄는 군요.

 

 

  일평균 임금 월평균 임금 시간평균 임금
  2018 2019 2020 2018 2019 2020 2018 2019 2020
 IT기획자 316,403 403,081 388,724 6,581,182 8,424,393 8,124,332 39,550 50,385 48,591
 IT컨설턴트 443,652 437,900 458,818 9,227,962 9,152,103 9,589,296 55,457 54,737 57,352
 정보보호컨설턴트 212,881 340,978 342,406 4,427,925 7,126,439 7,156,285 26,610 42,622 42,801
 업무분석가 413,856 501,090 532,243 8,608,205 10,472,778 11,123,879 51,732 62,636 66,530
 데이터분석가 292,480 335,799 347,670 6,083,584 7,018,209 7,266,303 36,560 41,975 43,459
 IT PM 377,354 362,780 411,329 7,848,963 7,582,109 8,596,776 47,169 45,348 51,416
 IT PMO 323,207 410,270 326,211 6,722,706 8,574,648 6,817,810 40,401 51,284 40,776
 SW 아키텍트 342,701 389,104 421,761 7,128,181 8,132,265 8,814,805 42,838 48,638 52,720
Infrastructure아키텍트 343,040 461,684 517,539 7,135,232 9,649,203 10,816,565 42,880 57,711 64,692
 데이터 아키텍트 339,179 399,985 437,063 7,054,923 8,359,679 9,134,617 42,397 49,998 54,633
 UI/UX 개발자 208,809 258,696 302,033 4,343,227 5,406,750 6,312,490 26,101 32,337 37,754
UI/UX 디자이너     250,345     5,232,211     31,293
 응용SW 개발자 260,046 305,985 323,174 5,408,957 6,395,094 6,754,337 32,506 38,248 40,397
 시스템SW 개발자 235,596 247,970 253,051 4,900,397 5,182,563 5,288,766 29,450 30,996 31,631
 임베디드SW 개발자 256,186 271,214 277,998 5,328,669 5,668,383 5,810,158 32,023 33,902 34,750
 데이터베이스 운용자 291,249 274,324 298,254 6,057,979 5,733,364 6,233,509 36,406 34,290 37,282
 NW엔지니어 316,056 327,598 350,062 6,573,965 6,846,793 7,316,296 39,507 40,950 43,758
 IT시스템운용자 247,442 278,605 284,286 5,146,794 5,822,848 5,941,577 30,930 34,826 35,536
 IT지원 기술자 307,532 183,743 203,918 6,396,666 3,840,221 4,261,886 38,442 22,968 25,490
 SW제품 기획자 253,055 426,419 444,306 5,263,544 8,912,158 9,285,995 31,632 53,302 55,538
 IT서비스 기획자 253,563 383,295 441,052 5,274,110 8,010,861 9,217,987 31,695 47,912 55,132
 IT기술영업 368,834 376,746 372,497 7,671,747 7,874,001 7,785,187 46,104 47,093 46,562
 IT품질관리자 367,144 402,554 438,304 7,636,595 8,413,382 9,160,554 45,893 50,319 54,788
 IT테스터 183,091 198,611 207,793 3,808,293 4,150,962 4,342,874 22,886 24,826 25,974
 IT감리 238,242 340,109 391,741 4,955,434 7,108,276 8,187,387 29,780 42,514 48,968
 IT감사 290,773 398,085 274,802 6,048,078 8,319,985 5,743,362 36,347 49,761 34,350
 정보보호관리자 290,773 398,085 391,725 6,048,078 8,319,985 8,187,053 36,347 49,761 48,966
 침해사고대응전문가 197,358 278,202 327,674 4,105,046 5,814,424 6,848,387 24,670 34,775 40,959
 IT교육강사 267,067 321,017 257,614 5,554,994 6,709,263 5,384,133 33,383 40,127 32,202
                   

 

 

이렇게 많은 돈을 받을일 없지만 구경이나 해 봅니다.

 

코로나 이후 이미 보편화된 화상회의나 온라인 교육용 툴들이 많은데 개인적으로는 구글 미트를 사용하고 있습니다.  얼굴을 보며 회의하는 것도 중요 하지만 대부분 프로그램 소스를 공유하며 회의를 진행 하다 보니 프리젠테이션 기능은 meet 가 좋은것 같아요.


1. 회의 공간 생성 및 초대

사용 방법도 간단 합니다.  사이트에 접속해서 방을 만들고 그냥 초대를 하면 되는데(물론 구글 계정에 로그인을 해야 합니다.)

https://apps.google.com/meet/

 

 

회의용 방을 만드는 사람은 [회의 시작하기] 버튼을 누르면 

 

 

 

방이 바로 생성 되고 방을 찾아올 수 있는 코드도 생성이 됩니다.  우측 팝업 창에서 [복사] 아이콘을 클릭 하면 코드가 복사 되는데요.  이걸 문자나 카톡에 복사해서 상대방에게 전달 합니다.

 

 

 

이렇게 접속 주소를 받은 사람은 google meet에 접속 하여

 

 

 

참여 버튼을 클릭하여 요청합니다.

 

 

 

방장의 화면에 접속요청이 들어오면 허가해주고 끝입니다.

 

 

 

2. 회의용 프리젠테이션

사람 얼굴대신 오리를 보여주고 있는데 얼굴을 보며 회의를 해도 되지만 저는 컴퓨터 화면을 공유 하도록 합니다.

 

 

 

하단의 [Present now]를 클릭하면 어떻게 공유를 할 것인가 선택을 하게 되는데 A Window는 열린 창중 하나(word, powerpoint, eclipse 등등)를 선택해서 화면에 공유하는 것으로 아래 그림처럼

 

 

 

모니터에 열린 창들을 다 보여줍니다. 그 중 하나를 선택해서 [공유]버튼을 클릭하면 됩니다.

Your enter screen은 모니터 전체를 보여주는데 만일 듀얼 모니터라면 아래처럼 

 

 

 

두개의 화면 중 하나를 선택해서 공유 버튼을 클릭 하면 됩니다.

모니터 화면1을 선택 하면 아래처럼

 

 

 

이렇게 공유가 되어서 온라인 회의를 진행 하면 됩니다.  참가자들도 필요하면 자신의 화면을 공유해가며 프리젠테이션이 가능 합니다. 

 

- copy coding -

지난 번에 NAVER Map에서 사용 권한 아이디를 생성하고 안드로이드에서 네이버 지도를 표현하는 방법을 알아 보았습니다.

Android에서 Naver map 이용하기 위한 Client ID 생성


 이번에는 네이버 지도에서 핸드폰의 현재 위치를 표시하는 방법을 알아보려고 합니다.

 Android API 개발 가이드를 보면 FusedLocationSource를 이용한 현재 위치 표시 방법에 대해 기본적인 소스가 제공되고 있고 현재의 위치를 GPS_PROVIDER를 이용하여 좌표를 구하고 위치를 표현하는 방법도 소개가 되고 있습니다.

여기서는 제공된 소스에서 약간 생략된 부분에 대한 내용을 추가하여 설명 드립니다



1. AndroidManifest.xml

 

위치 추적에 사용되는 권한을 추가해 줍니다

 

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

그리고 네이버 API에서 생성된 사용자 ID도 manifest에 추가를 합니다.

 

<application
    ...

    <meta-data
        android:name="com.naver.maps.map.CLIENT_ID"
        android:value="네이버 API ID" />

</application>

 

2. build.gradle

 

build.gradle (Project: XXXX)

 

maven {
    url 'https://naver.jfrog.io/artifactory/maven/'
}

 

build.gradle (Module: app)

지도와 위치 정보를 사용하기 위한 의존성을 추가 합니다.

 

dependencies {
    implementation 'com.naver.maps:map-sdk:3.10.2'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
}

 

이렇게 하고 Sync Now만 하면 환경설정은 완료 됩니다.

 


3. activity_main.xml

레이아웃에 지도를 표시할 fragment를 추가하고

 

<fragment android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/map"
    android:name="com.naver.maps.map.MapFragment" />

 

4. MainActivity.java

이제 구현을 하기만 하면 됩니다.

OnMapReadyCallback 을 상속받아 지도를 표시할 수 있도록 합니다.

 

public class MainActivity extends AppCompatActivity implements OnMapReadyCallback {

 

지도와 위치 정보에 필요한 변수들과 권한을 정의 해 줍니다.

 

private NaverMap naverMap;
private FusedLocationSource locationSource;
private static final int LOCATION_PERMISSION_REQUEST_CODE = 1000;
private static final String[] PERMISSIONS = {
        Manifest.permission.ACCESS_FINE_LOCATION,
        Manifest.permission.ACCESS_COARSE_LOCATION
};

 

 

화면을 생성할 때 지도와 현재 위치를 받아 옵니다.

 

FragmentManager fm = getSupportFragmentManager();
MapFragment mapFragment = (MapFragment)fm.findFragmentById(R.id.map);
if (mapFragment == null) {
    fm.beginTransaction().add(R.id.map, mapFragment).commit();
}
mapFragment.getMapAsync(this);
locationSource = new FusedLocationSource(this, LOCATION_PERMISSION_REQUEST_CODE);

 

 

그리고 마지막으로 현재 위치를 지도에 표시해 줍니다.

 

public void onMapReady(@NonNull NaverMap naverMap) {
    this.naverMap = naverMap;

    naverMap.setLocationSource(locationSource);  //현재 위치
    ActivityCompat.requestPermissions(this, PERMISSIONS, LOCATION_PERMISSION_REQUEST_CODE);  //현재위치 표시할때 권한 확인
}

 

위치 정보를 가져올 수 있는 권한을 사용자가 선택하도록 합니다.
화면에서 권한 부분이 제일 먼저 표시되어 허가를 하면 됩니다.

 

public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    if(locationSource.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
        if(!locationSource.isActivated()) {
            naverMap.setLocationTrackingMode(LocationTrackingMode.None);
            return;
        } else {
            naverMap.setLocationTrackingMode(LocationTrackingMode.Follow);
        }

    }
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}

 

 

5. 결과 화면

 

허용을 선택 합니다.

 

 

6. 전체 소스

 

- AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="copycoding.tistory.navermap">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.naver.maps.map.CLIENT_ID"
            android:value="네이버 API ID" />

    </application>

</manifest>

 

- build.gradle (Project: XXXX)

 

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://naver.jfrog.io/artifactory/maven/'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

 

 

- build.gradle (Module: app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "copycoding.tistory.navermap"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.naver.maps:map-sdk:3.10.2'
    implementation 'com.google.android.gms:play-services-location:17.0.0'

    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

 

- activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    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 android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/map"
        android:name="com.naver.maps.map.MapFragment" />

</androidx.constraintlayout.widget.ConstraintLayout>

 

- MainActivity.java

package copycoding.tistory.navermap;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentManager;

import android.Manifest;
import android.graphics.PointF;
import android.os.Bundle;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.naver.maps.geometry.LatLng;
import com.naver.maps.map.CameraUpdate;
import com.naver.maps.map.LocationTrackingMode;
import com.naver.maps.map.MapFragment;
import com.naver.maps.map.NaverMap;
import com.naver.maps.map.OnMapReadyCallback;
import com.naver.maps.map.overlay.Marker;
import com.naver.maps.map.overlay.PathOverlay;
import com.naver.maps.map.util.FusedLocationSource;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity implements NaverMap.OnMapClickListener, OnMapReadyCallback {

    private NaverMap naverMap;
    private FusedLocationSource locationSource;
    private static final int LOCATION_PERMISSION_REQUEST_CODE = 1000;
    private static final String[] PERMISSIONS = {
            Manifest.permission.ACCESS_FINE_LOCATION,
            Manifest.permission.ACCESS_COARSE_LOCATION
    };
    List<LatLng> lstLatLng = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        FragmentManager fm = getSupportFragmentManager();
        MapFragment mapFragment = (MapFragment)fm.findFragmentById(R.id.map);
        if (mapFragment == null) {
            fm.beginTransaction().add(R.id.map, mapFragment).commit();
        }
        mapFragment.getMapAsync(this);
        locationSource = new FusedLocationSource(this, LOCATION_PERMISSION_REQUEST_CODE);

    }

    @Override
    public void onMapReady(@NonNull NaverMap naverMap) {
        this.naverMap = naverMap;
        naverMap.setLocationSource(locationSource);  //현재위치 표시
        ActivityCompat.requestPermissions(this, PERMISSIONS, LOCATION_PERMISSION_REQUEST_CODE);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {

        if(locationSource.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
            if(!locationSource.isActivated()) {
                naverMap.setLocationTrackingMode(LocationTrackingMode.None);
                return;
            } else {
                naverMap.setLocationTrackingMode(LocationTrackingMode.Follow);
            }

        }

        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}

- copy coding -


1···21222324252627···118

+ Recent posts