Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to call file swf in asset folder on my android application like call file .jpg ?
sory, im just newbie on android.. please help me :(
Posted

1 solution

Have you tried calling it from the browser ?

something like file://sdcard/filename.swf

You will need adobe 10.1 or greater to do this.

When you say call it, you want to load it into a webview ? or just launch it via intent ?

/Darren
 
Share this answer
 
Comments
migmeg 30-Nov-11 4:58am    
whether there are differences between load into a webview with launch it via intent ??? so sory .. i really don't know.. please give some advice or explanation.thanks before
Darren_vms 30-Nov-11 8:24am    
what are you attempting to do, what code do you already have ?
migmeg 30-Nov-11 10:48am    
package net.learn2develop.skripsi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;

public class hurufa extends Activity implements OnClickListener {
Button backtomenu;


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

String html = "<object width=\"550\" height=\"400\"> <param name=\"movie\"value=\"file:///android_assets/flash2.html\" <embed src=\"file:///android_assets/flash2.html\" width=\"550\" height=\"400\"></embed></object>";
String mimeType = "text/html";
String encoding = "utf-8";
WebView wv = (WebView) findViewById(R.id.webView1);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setPluginsEnabled(true);
wv.loadDataWithBaseURL("null", html, mimeType, encoding, "");
wv.setWebViewClient(new HelloWebViewClientA());


backtomenu=(Button)findViewById(R.id.button1);
backtomenu.setOnClickListener(this);
}
}

@Override
public void onClick(View view) {
// TODO Auto-generated method stub
if(view==backtomenu){
Intent x=null;
x=new Intent(hurufa.this,menu.class);
startActivity(x);
}
}
}




package net.learn2develop.skripsi;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class HelloWebViewClientA extends WebViewClient {
public boolean ShouldOverrideUriLoading (WebView view,String url){
view.loadUrl(url);
return true;
}
}




<relativelayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">

<webview android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerhorizontal="true" android:layout_centervertical="true">

<textview android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" android:gravity="center" android:text="huruf A" android:textsize="40dp">

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="135dp"
android:text="Kembali ke Menu Utama" />;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900