안드로이드 스튜디오 설치 저의 Homepc.11q.kr 홈페이지를 어플로 만들어 봅니다(추가 sir.kr)
컨텐츠 정보
- 5,357 조회
- 3 댓글
- 0 추천
- 목록
본문
안드로이드 스튜디오 설치 ..
http://developer.android.com/sdk/index.html#download
모바일 웹버전을 안드로이드 어플 생성 참조 사이트
sir.co.kr 홈페이 작업 관련 파일 정보
===================
MainActivity.java
----------------------------------------------------------------
package com.example.sir;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {
WebView web;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
web = (WebView) this.findViewById(R.id.web1);
web.setWebViewClient(new WebViewClient());
web.loadUrl("http://sir.co.kr"); //자신에 홈피
}
}
----------------------------------------------------------------
activity_main.xml
----------------------------------------------------------------
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >
<WebView
android:id="@+id/web1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
----------------------------------------------------------------
<< 안드로이드 스튜디오 에서 설정 작업 >>
프로젝트 Empty으로 선택 진행 합니다...
이름주고 finish
상기 파일을 수정 합니다
===================
MainActivity.java
----------------------------------------------------------------
package com.https_11q_kr.homepc;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
WebView web;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
web = (WebView) this.findViewById(R.id.web1);
web.setWebViewClient(new WebViewClient());
web.loadUrl("https://11q.kr"); //자신에 홈피
}
}
----------------------------------------------------------------
activity_main.xml 파일 수정
https://zetawiki.com/wiki/안드로이드_웹뷰_웹페이지_사용불가
참조 수정AndroidManifest.xml 에 인터넷 권한을 넣어주면 된다. uses-permission은 manifest의 자식이다.<uses-permission android:name="android.permission.INTERNET" > </uses-permission>
AndroidManifest.xml 파일 수정
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.https_11q_kr.homepc">
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<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">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.https_11q_kr.sir">
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<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">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
package com.https_11q_kr.sir;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
WebView web;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
web = (WebView) this.findViewById(R.id.web1);
web.setWebViewClient(new WebViewClient());
web.loadUrl("https://sir.kr/"); //자신에 홈피
}
}
==================================
ㅁㅊ샾
active...
==================================
<?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">
tools:context="${relativePackage}.${activityClass}" >
<WebView
android:id="@+id/web1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
============================
◎ ■ ▶ ☞ ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다. https://11q.kr ♠
관련자료
-
첨부등록일 2019.08.25 00:32등록일 2019.08.25 00:59
shimss@11q.kr님의 댓글
package com.https_11q_kr.homepc; 외 복사
==================
package com.https_11q_kr.homepc;
import androidx.appcompat.app.AppCompatActivity;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
WebView web;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
web = (WebView) this.findViewById(R.id.web1);
web.setWebViewClient(new WebViewClient());
web.loadUrl("https://11q.kr"); //자신에 홈피
}
}
=====================
shimss@11q.kr님의 댓글
에서
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
만 추가
===============
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.https_11q_kr.homepc">
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<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">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
=================
shimss@11q.kr님의 댓글
===================
<?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">
tools:context="${relativePackage}.${activityClass}" >
<WebView
android:id="@+id/web1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
===============