browser plugin development?

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

browser plugin development?

Postby mikeDC » Tue Jun 23, 2009 7:47 pm

I can t seem to find any actual resources for developing a plugin for the browser
I found some src here but I still would not know how to install it
http://www.netmite.com/android/mydroid/ ... t/android/

I want my plugin to access the phone resources so its not as simple as just developing a webkit plugin.

My motivation is to have phone # recognition by the browser. allowing the user to click a phone number to initiate a call as opposed to manually typing it out. I cant seem to find anything out there that does this, and I'm willing to give it a shot, but if there is something out there let me know!
mikeDC
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Mar 09, 2009 4:22 am

Top

Re: browser plugin development?

Postby Northsun » Wed Jul 08, 2009 1:32 am

mikeDC wrote:I can t seem to find any actual resources for developing a plugin for the browser
I found some src here but I still would not know how to install it
http://www.netmite.com/android/mydroid/ ... t/android/

I want my plugin to access the phone resources so its not as simple as just developing a webkit plugin.

My motivation is to have phone # recognition by the browser. allowing the user to click a phone number to initiate a call as opposed to manually typing it out. I cant seem to find anything out there that does this, and I'm willing to give it a shot, but if there is something out there let me know!


My understanding is that there is currently no way to write a browser plugin. (See http://groups.google.com/group/android- ... a7da74d34c for more info.)

However, the functionality you want already exists in the current Cupcake release - although phone numbers aren't displayed any differently, the browser treats them like hyperlinks that launch the dialer, ready for you to edit/dial/add to contacts, etc.
Northsun
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Jul 08, 2009 1:25 am

Audeo/vedio through webkit

Postby spoorti » Mon Oct 05, 2009 5:27 am

Hi,

I am trying to play audio and vedio through webkit.. But its not showing up in the browser. I have written the HTML code in assets folder. I will give the entire code here.. My guess is that the plugin for Android Browser for playing media is missing. Please help me how to overcome this.

Please Reply me as soon as possible

Assets Folder

<html>
<body>
<h1>hello</h1>
<object width="300" height="42">
<param name="src" value="New.mp3">
<param name="autoplay" value="true">
<param name="controller" value="true">
<param name="bgcolor" value="#FF9900">
<embed src="New.mp3" width="300" height="42">
</body>
</html>

New.mp3 is also in assets folder

java code

package com.hello;

import android.app.Activity;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
import android.util.Log;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class HelloWebActivity extends Activity {
private static final String LOG_TAG = "WebViewDemo";
WebView webview;
private Handler mHandler = new Handler();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
/* webview.getSettings().setJavaScriptEnabled(true);*/

WebSettings webSettings = webview.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(false);

webview.setWebChromeClient(new MyWebChromeClient());

webview.addJavascriptInterface(new DemoJavaScriptInterface(), "demo");
Debug.startMethodTracing("webview");
webview.loadUrl("file:///android_asset/simple.html");
Debug.stopMethodTracing();

/*webview.loadData("<html><body>Hi dude<br><br>Hi again</body></html>", "text/html", "UTF-8");*/
/* webview.loadUrl("file:///android_asset/simple.html");*/
}
final class DemoJavaScriptInterface {

DemoJavaScriptInterface() {
}

/**
* This is not called on the UI thread. Post a runnable to invoke
* loadUrl on the UI thread.
*/
public void clickOnAndroid() {
mHandler.post(new Runnable() {
public void run() {
webview.loadUrl("javascript:wave()");
}
});

}
}

/**
* Provides a hook for calling "alert" from javascript. Useful for
* debugging your javascript.
*/
final class MyWebChromeClient extends WebChromeClient {
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
Log.d(LOG_TAG, message);
result.confirm();
return true;
}
}

}

Please help me out in this... If you know other way of playing audeo/vedio through webkit also let me know

Thanks,
Spoorti
spoorti
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jul 06, 2009 6:36 am

Top

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests