myWebView = (WebView) findViewById(R.id.WebView1);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
Thursday, May 29, 2014
How to Zoom out WebView content
myWebView.setInitialScale(60);
myWebView.getSettings().setLoadWithOverviewMode(true);
myWebView.getSettings().setUseWideViewPort(true);
myWebView.getSettings().setLoadWithOverviewMode(true);
myWebView.getSettings().setUseWideViewPort(true);
How to load a web page in webview control
WebView myWebView;
myWebView = (WebView) findViewById(R.id.WebView1);
myWebView.loadUrl("http://www.google.com");
myWebView = (WebView) findViewById(R.id.WebView1);
myWebView.loadUrl("http://www.google.com");
Playing Ringtone
MediaPlayer player = MediaPlayer.create(this, Settings.System.DEFAULT_RINGTONE_URI);
try
{
player.prepare();
}
catch (IllegalStateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
player.start();
//5 sec alaram
try
{
Thread.sleep( 1000 );
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
player.stop();
Log.i("info","Alaram done");
try
{
player.prepare();
}
catch (IllegalStateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
player.start();
//5 sec alaram
try
{
Thread.sleep( 1000 );
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
player.stop();
Log.i("info","Alaram done");
Subscribe to:
Posts (Atom)