In this Android tutorial, we will make an app which will demonstrate how to convert a website into an android app in the Android studio. This app will simply load a URL of any website. But make sure that the website which you want to convert into the app should be responsive. We will use google.com in our app.
- What is android activity
- How to use Listview in android studio step by step? android tutorial
- How to use button in android studio?
- brief overview of project files in android studio
- Basic overview of android studio (Hello world)
Steps to convert website into android app
In this file, we will add internet permissions. So add the following line of code
<uses-permission android:name="android.permission.INTERNET" />
In this file, we need only webview widgets. Drag and drop webview or add code manually. You can adjust height and width.
<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"/>
Select main_activity.java file
This is all about MainActivity.java. Now you can test your app. It should load Google’s homepage.
I hope now you understand how to convert a website into an android app. This is very basic app. You can do a lot more things with the app. For example, you can add processing bar, a sharing button, a menu etc. For any query, you can ask in the comment section. I will recommend you to read my more tutorials on Android development.