간단한 웹 브라우저
- xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="package명"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/이미지"
android:label="@string/app_name" >
<activity
android:name=".Activity명"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
- SOURCE
package XXXXX;
import android.app.*;
import android.os.*;
import android.webkit.*;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class Activity명 extends Activity {
/** Called when the activity is first created. */
WebView mWeb;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWeb = (WebView)findViewById(R.id.web);
mWeb.setWebViewClient(new MyWebClient());
WebSettings set = mWeb.getSettings();
set.setJavaScriptEnabled(true);
set.setBuiltInZoomControls(true);
mWeb.loadUrl(url 주소);
}
class MyWebClient extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}
Android Sound Code (0) | 2018.01.05 |
---|---|
안드로이드용 ksoap2 (0) | 2012.04.25 |
WebView 를 사용할때 HttpClient 를 이용한 Session 유지 (0) | 2012.02.16 |
안드로이드 세션연구 (0) | 2012.02.16 |
구글 마켓에 앱 올리기 (0) | 2012.01.28 |