How to convert a website into an Android app from scratch?

Spread the love

In this tutorial, we will learn How to Convert a Website into an Android Application using Android Studio.

If you do not know anything about Android Studio yet, Don’t worry.
We will start everything from scratch.

This is how the website looks like:

And the Android app, we developed using Android Studio looks like:

Before we begin:

NOTE: If you downloaded Android Studio and already installed in your system then you can skip the part and Go to direct the coding part.

If not
Download Android Studio:

Google provides Android Studio for the Windows, Mac OS X, and Linux platforms. You can download this software from the Android Studio homepage.

Before downloading Android Studio, make sure your platform meets one of the following requirements:
Windows OS
Microsoft Windows 7/8/10 (32-bit or 64-bit)
2 GB RAM minimum, 8 GB RAM recommended
2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution
For accelerated emulator: 64-bit operating system and Intel processor with support for Intel VT-x, Intel EM64T (Intel 64), and Execute Disable (XD) Bit functionality

Mac OS
Mac OS X 10.8.5 or higher, up to 10.11.4 (El Capitan)
2 GB RAM minimum, 8 GB RAM recommended
2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution

Linux OS
GNOME or KDE desktop
: Tested on Ubuntu 12.04, Precise Pangolin (64-bit distribution capable of running 32-bit applications)
64-bit distribution capable of running 32-bit applications
GNU C Library (glibc) 2.11 or later
2 GB RAM minimum, 8 GB RAM recommended
2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution
For accelerated emulator: Intel processor with support for Intel VT-x, Intel EM64T (Intel 64), and Execute Disable (XD) Bit functionality, or AMD processor with support for AMD Virtualization (AMD-V)

Installing Android Studio on 64-bit Windows 8.1

Figure 1. Set up Android Studio
Figure 2. Do you want to install the Android SDK and AVD?
Figure 3. Accept the license agreement to continue the installation
Figure 4. Set the Android Studio and Android SDK installation locations
Figure 5. Create a new shortcut for Android Studio

To complete your installation, leave the Start Android Studio box checked and click Finish.

Figure 6. Leave the Start Android Studio checkbox checked to run this software

Running Android Studio

Android Studio presents a splash screen when it starts running:

If you’re like me and don’t have a previously installed version, you can just keep the default setting and click OK.

Figure 9. Validate your Android SDK and development environment setup

When you click Next, the setup wizard invites you to select an installation type for your SDK components. For now, I recommend you keep the default standard setting.

Figure 10. Choose an installation type
Figure 11. Review settings

The wizard will download and unzip various components. Click Show Details if you want to see more information about the archives being downloaded and their contents.

Figure 12. The wizard downloads and unzips Android Studio components

Your options are to either put up with the slow emulator or use an Android device to speed up development. I’ll discuss the latter option later in the tutorial.

Finally, click Finish to complete the wizard. You should see the Welcome to Android Studio dialog box:

Figure 14. Welcome to Android Studio

You’ve installed and configured Android Studio and created a project for your first Android Studio mobile app; now you’re ready to build your Android application. In Android Studio, this means populating your new project with Java source code and resource files.

Your first Android Studio mobile app

Starting a new project

From our setup so far, you should still have Android Studio running with the Welcome to Android Studio dialog box. From here, click Start a new Android Studio project. Android Studio will respond with the Create New Project dialog box shown in Figure.

Figure 15. Create a new project
Figure 16. Select your target device categories

Click Next, and you will be given the opportunity to choose a template for your app’s main activity. For now, we’ll stick with Empty Activity. Select this template and click Next.

Next, you’ll customize the activity:

Enter W2A as the activity name and main as the layout name, and click Finish to complete this step. Android Studio will respond that it is creating the project, then take you to the project workspace.

Figure 19. Android Studio workspace

The project window is organized into a tree whose main branches are App and Gradle Scripts. The App branch is further organized into manifests, java, and res subbranches:

  • manifests stores AndroidManifest.xml, which is an XML file that describes the structure of an Android app. This file also records permission settings (where applicable) and other details about the app.
  • java stores an app’s Java source files according to a package hierarchy, which is ca.javajeff.w2a in this example.
  • res stores an app’s resource files, which are organized into drawable, layout, mipmap, and values subbranches:
  • drawable: an initially empty location in which to store an app’s artwork
  • layout: a location containing an app’s layout files; initially, main.xml(the main activity’s layout file) is stored here
  • mipmap: a location containing various ic_launcher.png files that store launcher screen icons of different resolutions
  • values: a location containing colors.xml, dimens.xml, strings.xml, and styles.xml

The Gradle Scripts branch identifies various .gradle (such as build.gradle) and .properties (such as files that are used by the Gradle-based build system.

Now the coding part will start…

Add a webView to your activity as shown in the picture below.


<RelativeLayout xmlns:android=”"
xmlns:tools=”" android:layout_width=”match_parent”
<?xml version=”1.0" encoding=”utf-8"?>
<manifest xmlns:android=”" package=”com.vinaysomawat.careerhigh”
<uses-permission android:name=”android.permission.INTERNET”/>
<activity android:name=”.SplashActivity” android:theme=”@style/SplashTheme”>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
<activity android:name=”.MainActivity” />

package com.vinaysomawat.careerhigh;
* Created by Vinay Somawat on 10-01-2019.
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;
protected void onCreate(Bundle savedInstanceState) {
mywebview = (WebView)findViewById(;
WebSettings webSettings = mywebview.getSettings();
mywebview.setWebViewClient(new WebViewClient());
public void onBackPressed(){
if(mywebview.canGoBack()) {
} else
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(, menu);
return true;
public boolean onOptionsItemSelected(MenuItem item){
int id = item.getItemId();
if(id =={
return true;
return super.onOptionsItemSelected(item);


<menu xmlns:android=”"
xmlns:tools=”" tools:context=”.MainActivity”
<item android:id=”@+id/action_settings” android:title=”@string/action_settings”
android:orderInCategory=”100" app:showAsAction=”never”



<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<style name="TextAppearance.AppCompat.Widget.ActionBar.Title" parent="android:TextAppearance">
<item name="android:textColor">@color/titlecolour</item>
<item name="android:textSize">30sp</item>



<?xml version="1.0" encoding="utf-8"?>

<string name="app_name">CareerHigh</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>



<?xml version="1.0" encoding="utf-8"?>
<color name="colorPrimary">#000000</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="titlecolour">#398bb7</color>

Add a launching activity to App: (It looks nice)

Launching Activity

package com.vinaysomawat.careerhigh;

* Created by Vinay Somawat on 10-01-2019.
import android.content.Intent;
import android.os.Bundle;

public class SplashActivity extends AppCompatActivity {

protected void onCreate(@Nullable Bundle savedInstanceState) {
Intent intent = new Intent(this, MainActivity.class);

And add some code it values/styles.xml

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background</item>

create a drawable/background.xml file:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="">
<item android:drawable="@color/colorPrimary" />

<bitmap android:src="@drawable/logo2"


make sure you add a sample image to drawable folder to display in launching activity.


Now run your android app, and you will see the following result

Finally, your first Android App is created.

If you got stuck somewhere

Download the Source Code

Or use the following command:


>git clone 

And share your Android App with your friends.

Did I get something wrong? Mention it in the comments. I would love to improve.
If you learned even a thing or two, clap your hands 👏 as many times as you can to show your support!
Hello World, I am Vinay Somawat. A creative developer and a logical designer. You can find me on Linkedin or stalk me on GitHub or maybe follow me on Twitter? If that’s too social for you, just drop a mail to if you wish to talk tech with me.

Have a nice day!

Facebook Comments

Related Post

Her Name Is Kathryn: The Woman Who Accuses Ronaldo of Rape September 29, 2018  11:59 AM She was supposed to be invisible, damned to silence. Forever. Nobody was to ever learn about that night in Las Vegas back in 2009, especially not her version ...
Jamal Khashoggi: Saudi Arabia calls murder claims ‘lies̵... Media playback is unsupported on your device Media captionCCTV footage shows missing Saudi journalist Jamal Khashoggi entering the Saudi consulate in Istanbul.Saudi Arabia has called ...
Google News bug chews up massive amounts of data in the background Google News users report massive background data usage. Image: ALAIN JOCARD/AFP/Getty ImagesBy Johnny Lieu2018-10-23 02:02:50 UTCGoogle News is chewing up huge amounts of data in o...
Two dead after man shoots 14 in Canada Updated July 23, 2018 17:07:14 Map: CanadaTwo people are dead after a gunman shot 14 people, including a young girl, in Toronto, Canada, police say. The incident happened on Sunday loc...

Spread the love

Posted by Contributor

%d bloggers like this: