2011-07-15 13 views
0

私のAndroidアプリケーションはサウンドだけの.swfファイルを再生する必要があります。プラグインなどがありますので、通常どおり再生できますか?ありがとう。ここで.swfサウンドファイルを再生しますか?

+0

http://stackoverflow.com/questions/1887758/playing-a-flash-file- – marto

答えて

0

は完璧なソリューションです::

package com.adySol; 

import android.app.Activity; 
import android.os.Bundle; 
import android.webkit.WebSettings.PluginState; 
import android.webkit.WebView; 

public class adySol extends Activity { 
/** Called when the activity is first created. */ 
@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 



    String url ="file:///android_asset/mulberrybush.swf"; 
    // String url ="http://www.bing.com/"; 
WebView wv=(WebView) findViewById(R.id.webView1); 
wv.getSettings().setJavaScriptEnabled(true); 
    wv.getSettings().setPluginState(PluginState.ON); 
    wv.getSettings().setAllowFileAccess(true); 
wv.loadUrl(url); 

} 
} 

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" 
android:background="@android:color/white" 
> 
<WebView android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="match_parent"></WebView> 

</LinearLayout> 
+0

回答ありがとうございます。しかし、MediaPlayerで通常の.mp3を再生すると、CPU負荷は〜0%です。しかし、これを使用して.swfを再生すると、CPUの〜6%が使用されます。何故ですか?別の質問:2.1以前の電話機(これは1.5/1.6)でも動作しますか? – Omar

+0

これは2.2以上のバージョンの作品です。 –

+0

古いデバイスで動作させるものはありますか? – Omar

関連する問題