·¹À̾ƿô Àüü¸¦ À¥ºä·Î Àû¿ëÇÏ´Â ÃÊ°£´Ü À¥ºä ÀÔ´Ï´Ù.
°£´ÜÇÏ°Ô À¥¾Û ¸¸µé¶§ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
Á¦°¡ ¼Ò¼ÓµÈ Á¦Àϳ²±³È¸ ¸ð¹ÙÀÏÀ¥¿ë ¾ÛÀ» ¸¸µå´Âµ¥ Àû¿ëÇÑ ¼Ò½º¸¦ ±âÁØÀ¸·Î ¼³¸íÇÏ°Ú½À´Ï´Ù.
¿ïÆ®¶ó±Þ Ãʺ¸ Áö½ÄÀ̹ǷΠ°í¼ö´Â ¿ö~ÀÌ ¿ö~ÀÌ ¤»¤»
³»¿ëÀº Áö¼ÓÀûÀ¸·Î ±â´É Ãß°¡·Î ¼öÁ¤ÇØ ³ª°¥ °Ì´Ï´Ù.
1. ÆÛ¹Ì¼Ç Ãß°¡
AndroidManifest.xml ¿¡
<uses-permission android:name="android.permission.INTERNET"/>
Ãß°¡
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="
http://schemas.android.com/apk/res/android"
package="net.apptools.jinch"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".JinchActivity"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="portrait">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
2. ·¹À̾ƿô XML
/res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
3. ¼Ò½ºÄÚµù
/src/net.apptools.webview/MainActivity.java
package net.apptools.jinch;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class JinchActivity extends Activity {
private WebView wv;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//À¥ºä ÀνºÅϽº »ý¼º
wv = (WebView)findViewById(R.id.webView);
//½ºÅ©·Ñ ¾ø¾Ö±â Ãß°¡
wv.setVerticalScrollBarEnabled(false);
wv.setHorizontalScrollBarEnabled(false);
//ÀÚ¹Ù½ºÅ©¸³Æ® °¡´ÉÇÏ°Ô
wv.getSettings().setJavascriptEnabled(true);
//Ç÷¯±×ÀÎ °¡´ÉÇÏ°Ô (Ç÷¡½Ã µ¿¿µ»ó µî)
wv.getSettings().setPluginsEnabled(true);
//ȨÆäÀÌÁö ºÒ·¯¿À±â wv.loadUrl("
http://www.jinch.co.kr/plugin/mobile/");
wv.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
view.loadUrl(url);
return true;
}
});
}
@Override
//¹é¹öÆ° Ŭ¸¯½Ã µÚ·Î°¡±â Ãß°¡ µÚ·Î°¡±â ´õÀÌ»ó ¾øÀ¸¸é Á¾·á public boolean onKeyDown(int keyCode, KeyEvent event) {
if((keyCode==KeyEvent.KEYCODE_BACK)&&wv.canGoBack()) {
wv.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
//Á¾·á󸮽à Á¾·á ÇÒÁö ¹°¾îº¸±â Ãß°¡
public void onBackPressed()
{
new AlertDialog.Builder(this)
.setTitle("Á¾·á")
.setMessage("Á¾·á ÇϽðڽÀ´Ï±î?")
.setNegativeButton("¾Æ´Ï¿ä", null)
.setPositiveButton("¿¹",new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog,int whichButton)
{
finish();
}
}).show();
}
}
4. ¾Û ¸íĪ º¯°æ
/res/values/string.xml ¿¡¼
<string name="app_name">Á¦Àϳ²±³È¸</string>
app_name ºÎºÐ ¼öÁ¤!
´ÙÀ½¹ø¼öÁ¤¿£ ¾Û ¾ÆÀÌÄÜÃß°¡ keystore Àû¿ë ¹× ¸¶ÄÏ µî·Ï±îÁöµµ ¿Ã¸±²²¿ä! ^^
* ÇØ´ç °Ô½Ã±ÛÀº Áö¼ÓÀûÀ¸·Î ¼öÁ¤µË´Ï´Ù.