Escolar Documentos
Profissional Documentos
Cultura Documentos
CODEBIND.COM
FREE PROGRAMMING TUTORIALS AND LESSONS BY PROGRAMMINGKNOWLEDGE
ABOUT
Programmingknowl
7,682 likes
Epson Lig
Like Page
Discover Brand
ProgrammingKnowledge
Of Engaging Yo
Customers Wit YouTube 902R
Experiences.
www.epson.co.id
156
http://www.codebind.com/android-tutorials-and-examples/convert-website-android-application-using-android-studio/ 1/10
3/9/2019 How to Convert a Website into Android Application using Android Studio
layout/activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/r
xmlns:tools="http://schemas.android.com/tools" android:layo
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/webView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
src/main/AndroidManifest.xml
MainActivity.java
package com.example.programmingknowledge.easyonlineconverter;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends ActionBarActivity {
private WebView myWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
http://www.codebind.com/android-tutorials-and-examples/convert-website-android-application-using-android-studio/ 2/10
3/9/2019 How to Convert a Website into Android Application using Android Studio
myWebView = (WebView)findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true
true);
myWebView.loadUrl("http://www.easyonlineconverter.com")
myWebView.setWebViewClient(new
new WebViewClient());
}
@Override Take your
public void onBackPressed() {
if
if(myWebView.canGoBack()) {
app ad
myWebView.goBack();
} else {
revenue
super
super.onBackPressed(); to the
}
} next level.
@Override
public boolean onCreateOptionsMenu(Menu menu) { Sta now
// Inflate the menu; this adds items to the action bar
getMenuInflater().inflate(R.menu.menu_main, menu);
return
return true
true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar w
// automatically handle clicks on the Home/Up button, s
// as you specify a parent activity in AndroidManifest
int
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if
if (id == R.id.action_settings) {
return
return true
true;
}
return
return super
super.onOptionsItemSelected(item);
}
}
menu/menu_main.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" tools:contex
<item android:id="@+id/action_settings" android:title="@str
android:orderInCategory="100" app:showAsAction="never"
</menu>
OUTPUT
Now run your android app, and you will see the following result
http://www.codebind.com/android-tutorials-and-examples/convert-website-android-application-using-android-studio/ 3/10
3/9/2019 How to Convert a Website into Android Application using Android Studio
Video Instructions
NEWSLETTER
How to Convert a Website into Android Applic…
Applic…
Subscribe to our newsletter and
stay updated on the latest
developments and special
o ers!
Name
Email *
Subscribe
RECENT POSTS
Pin Diagram and Pin Android Examples Android Studio How to install Jenkins on Ubuntu
description of 8085 Android SeekB 18.04 (Debian Linux)
Microprocessor Example
CATEGORIES
VideoToGifs.com
RECENT COMMENTS
EasyOnlineConverter.com
SqliteTutorials.com Boss COTIGA on How to Install
PostgreSQL 9.6 on Ubuntu 18.04
ProgrammingKnowledge
LTS (Linux)
YouTube 902R
Aya Sato on Android MySQL
Database Tutorial – Android
June 2018
Best Flight Deals For Indonesia Departures May 2018
Flight Shop
April 2018
March 2018
This Is Why You Should Sleep on Your Left Side (Backed by
Science) February 2018
Health & Human Research
January 2018
October 2017
September 2017
Comments Community
1 Login July 2017
April 2017
Join the discussion…
March 2017
LOG IN WITH February 2017
OR SIGN UP WITH DISQUS ?
December 2016
July 2016
June 2016
⛺ May 2016
META
Log in
Aniruddha Basak • 2 years ago
I can't able to download pdf files on this webview app. pls Entries RSS
help
Comments RSS
1△ ▽ • Reply • Share ›
http://www.codebind.com/android-tutorials-and-examples/convert-website-android-application-using-android-studio/ 5/10
3/9/2019 How to Convert a Website into Android Application using Android Studio
t workin'
2△ ▽ • Reply • Share ›
△ ▽ • Reply • Share ›
webView is an error
△ ▽ • Reply • Share ›
http://www.codebind.com/android-tutorials-and-examples/convert-website-android-application-using-android-studio/ 9/10
3/9/2019 How to Convert a Website into Android Application using Android Studio
http://www.codebind.com/android-tutorials-and-examples/convert-website-android-application-using-android-studio/ 10/10