일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- JSON
- 가우스
- iBATIS
- appspresso
- WebLogic
- tomcat
- Struts
- GPS
- ibsheet
- dock
- Spring
- JDOM
- jQuery
- jsr 296
- MySQL
- 선택적조인
- PHP
- Google Map
- oracle
- sencha touch
- 전자정부프레임워크
- PLSQL
- MFC
- node.js
- rowspan
- swingx
- Ajax
- Eclipse
- phonegap
- Android
Archives
- Today
- Total
Where The Streets Have No Name
Appspresso 에서 Flash구동시키기 본문
index.html에 추가할 부분
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="/appspresso/appspresso.js"></script>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
//activate ax.log(), comment out when you release app
ax.runMode = ax.MODE_DEBUG;
ax.log("Hello World");
</script>
</head>
<body>
<h1>Hello World</h1>
<h3>net.neocorea.flash</h3>
<embed src="game1.swf" width="100%" height="100%" type="application/x-shockwave-flash"></embed>
</body>
</html>
플러그인 위치한 MyPlugin소스에서 추가할 부분
import android.webkit.WebSettings;
import com.appspresso.api.AxError;
import com.appspresso.api.AxPlugin;
import com.appspresso.api.AxPluginContext;
import com.appspresso.api.AxRuntimeContext;
public class MyPlugin implements AxPlugin {
private AxRuntimeContext runtimeContext;
@Override
public void activate(AxRuntimeContext runtimeContext) {
this.runtimeContext = runtimeContext;
WebSettings settings = this.runtimeContext.getWebView().getSettings();
settings.setPluginsEnabled(true);
}
@Override
public void deactivate(AxRuntimeContext runtimeContext) {
this.runtimeContext = null;
}
@Override
public void execute(AxPluginContext context) {
String method = context.getMethod();
if ("echo".equals(method)) {
String message = context.getParamAsString(0, null);
context.sendResult(message);
}
else {
context.sendError(AxError.NOT_AVAILABLE_ERR);
}
}
}