Comments

Monday, January 28, 2013

Android Simple Blog Reader

Posted by at Monday, January 28, 2013 Read our previous post

AndroidWallpaper

I wrote a simple Blog Reader for Android.

Its very very simple its load the url into a webview.

Download Here

Download Source Code Here

MainActivity.java

package com.woot.securityisjustanillusion;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;

public class MainActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
final Context context = this;

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = new Intent(context, WebViewActivity.class);
startActivity(intent);
MainActivity.this.finish();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

}


WebViewActivity.java



package com.woot.securityisjustanillusion;

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

public class WebViewActivity extends Activity{

WebView webView;

@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);

webView = (WebView) findViewById(R.id.webView1);
gotoPage();
};


private void gotoPage(){
WebSettings webSettings = webView.getSettings();
webSettings.setBuiltInZoomControls(true);

webView.setWebViewClient(new Callback());
webView.loadUrl("http://security-is-just-an-illusion.blogspot.de");

}

private class Callback extends WebViewClient{

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return (false);
}

}

}


 



Have pfun ….

No comments:

Post a Comment

[#] iNFO [#]

All the information provided on this site is for educational purposes only.
 
The site and it's author is in no way responsible for any misuse of the information.
©2012 Security is just an Illusion is powered by Blogger - Template designed by Stramaxon - Best SEO Template