일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Ajax
- MFC
- PLSQL
- GPS
- Spring
- appspresso
- jQuery
- ibsheet
- Struts
- WebLogic
- 가우스
- rowspan
- JDOM
- sencha touch
- 전자정부프레임워크
- PHP
- phonegap
- Eclipse
- node.js
- jsr 296
- iBATIS
- 선택적조인
- tomcat
- JSON
- Google Map
- dock
- oracle
- MySQL
- Android
- swingx
Archives
- Today
- Total
Where The Streets Have No Name
phonegap에서 flash구동시키기 본문
위와 같이 안드로이드 프로제트를 생성합니다.
activity클래스를 phonegap에서 제공되는 DroidGap으로 고친후 webview의 플러그인을 활성화하는 코드를 추가합니다
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings.PluginState;
import com.phonegap.*;
public class FlashTestActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
WebSettings settings = this.appView.getSettings();
settings.setPluginsEnabled(true);
//settings.setPluginState(PluginState.ON);
}
}
아래 layout xml에서 webview를 추가합니다.
<?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/appView"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
/>
</LinearLayout>
/assets/www/index.html을 작성해서 아래와 같이 flash파일을 추가한다.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Flash Test</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.1.js"></script>
</head>
<body>
<h1>Flash Test</h1>
<img class="tx-entry-embed" src="http://cfs.tistory.com/static/admin/editor/spacer.gif" width="100" height="100" type="application/x-shockwave-flash"/>
</body>
</html>