Create Android Web Browser Application Project Download

Make Android simple internet browser complete project with Source Code Download.

Android Web browsers are used to surf websites on android phones. With the help of web browser you can visit website, download content from other websites and do much more. So my in this project i am creating an Web browser android app to visit websites with back button automatic history remember function. So here is the complete step by step tutorial for Create Android Web Browser Application Project Download.

android-project-download-code-button

Components & Widgets that are used in this project to designing browser app.

  1. EditText.
  2. Button.
  3. WebView.
  4. ProgressBar.

1. EditText : EditText is used to get URL from user like google.com , android-examples.com etc.

2. Button : Setting up on click listener function on button so each & every time after clicking on button it will get EditText value and set that url value into webview.

3. WebView : Webview is used to display websites.

4. ProgressBar : Shows on screen while webview is loading.

Create Android Web Browser Application Project Download

Code for MainActivity.java file.

 package com.android_examples.com.webbrowser;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;


public class MainActivity extends Activity {
 
 WebView web1;
 EditText ed1;
 Button bt1;
 String Address;
 String add;
 ProgressBar pbar;
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 
 web1 = (WebView)findViewById(R.id.webView1);
 ed1 = (EditText)findViewById(R.id.editText1);
 bt1 = (Button)findViewById(R.id.button1);
 pbar = (ProgressBar)findViewById(R.id.progressBar1);
 pbar.setVisibility(View.GONE);
 
 bt1.setOnClickListener(new View.OnClickListener() {
 
 @Override
 public void onClick(View v) {
 
 Address = "http://" + ed1.getText().toString();
 WebSettings webSetting = web1.getSettings();
 webSetting.setBuiltInZoomControls(true);
 webSetting.setJavaScriptEnabled(true);
 
 web1.setWebViewClient(new WebViewClient());
 
 web1.loadUrl(Address);
 
 }
 });
 }

 public class WebViewClient extends android.webkit.WebViewClient
 {
 @Override
 public void onPageStarted(WebView view, String url, Bitmap favicon) {

 // TODO Auto-generated method stub
 super.onPageStarted(view, url, favicon);
 pbar.setVisibility(View.VISIBLE);
 }
 
 @Override
 public boolean shouldOverrideUrlLoading(WebView view, String url) {

 // TODO Auto-generated method stub
 view.loadUrl(url);
 return true;
 }
 @Override
 public void onPageFinished(WebView view, String url) {

 // TODO Auto-generated method stub

 super.onPageFinished(view, url);
 pbar.setVisibility(View.GONE);
 }

 }

 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event)
 {
 if ((keyCode == KeyEvent.KEYCODE_BACK) && web1.canGoBack()) {
 web1.goBack();
 return true;
 }
 return super.onKeyDown(keyCode, event);
 }
}

Code for activity_main.xml layout file.

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 tools:context="com.android_examples.com.webbrowser.MainActivity" >

 <Button
 android:id="@+id/button1"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignParentRight="true"
 android:layout_alignParentTop="true"
 android:text="GO" />

 <EditText
 android:id="@+id/editText1"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignBottom="@+id/button1"
 android:layout_alignParentLeft="true"
 android:ems="10" 
 android:hint="Type Your URL Here"/>

 <View
 android:id="@+id/view12"
 android:layout_width="wrap_content"
 android:layout_height="3dp"
 android:layout_alignBottom="@+id/button1"
 android:layout_alignParentLeft="true"
 android:background="#3bbdfa" />

 <WebView
 android:id="@+id/webView1"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:layout_below="@+id/editText1"
 android:layout_centerHorizontal="true" />

 <ProgressBar
 android:id="@+id/progressBar1"
 style="?android:attr/progressBarStyleLarge"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_centerHorizontal="true"
 android:layout_centerVertical="true" />

</RelativeLayout>

 

Code for AndroidManifest.xml file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.android_examples.com.webbrowser"
 android:versionCode="1"
 android:versionName="1.0" >

 <uses-sdk
 android:minSdkVersion="8"
 android:targetSdkVersion="21" />

 <uses-permission android:name="android.permission.INTERNET" />
 
 <application
 android:allowBackup="true"
 android:icon="@drawable/ic_launcher"
 android:label="@string/app_name"
 android:theme="@style/AppTheme" >
 <activity
 android:name=".MainActivity"
 android:label="@string/app_name" >
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />

 <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
 </activity>
 </application>

</manifest>

Screenshots:

webbrowser

Create Android Web Browser Application Project Download

Click Here To Download Create Android Web Browser Application Project Download.

16 Comments

  1. Pls show me how to make Complete web browser with all features. Just exactly like opera mini. Thanks I’m grateful

  2. I want to make a app store like 9apps, please suggest me how to develop.

  3. That Great Sir, Dynamic with Notification App

  4. how can the browser perform the cache function

  5. how to add new tab on this browser?

  6. Unable to Play YouTube Videos..

  7. How can I import this android project in android studio..

  8. How to make a browser that stores history and bookmarks in sqlitedatabase

  9. WITH THAT CODE WE ARE UNABLE TO DOWNLOAD ANY THING FROM WEB PLS TELL CODE TO FIX IT

Leave a Reply

Your email address will not be published. Required fields are marked *