How to convert Website into Application using Android studio

Convert Your own Website into Application in simple steps ......




If you want to create your own application using android studio you have to just follow the simple steps on the bellow and you can create app within 10 to 15 minutes.

You Don't have to pay any money to your developer just simple follow the steps and create your own apps.


  • First  to Download the Android studio..
  • Then start a new project .
  • Select the Empty Activity.
  • Then Give your Project name or App name And then simply click the next button
  • your project will be start to Run and its take time so plz wait for whole process will complete.

Steps 1 ) : Add permission for Internet 

Go to the Manifest file and click them and simply add this code.

"

<manifest ... >
    <uses-permission android:name="android.permission.INTERNET" />
    ...
</manifest>

"


Steps 2 ) : Adding a WebView to your app

To add a WebView to your app, you can either include the <WebView> element in your activity layout, or set the entire Activity window as a WebView in onCreate().

To add a Webview in activity layout

"
<WebView
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
/>

"

To load a web page in the WebView, use loadUrl(). For example:

"

WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://www.example.com");

"

Adding a WebView in onCreate()

To add a WebView to your app in an activity’s onCreate() method instead, use logic similar to the following:

"

WebView myWebView = new WebView(activityContext);
setContentView(myWebView);

"

Steps 3 ) : Enabling javascript

If the web page you plan to load in your WebView uses JavaScript, you must enable JavaScript for your WebView. Once JavaScript is enabled, you can also create interfaces between your app code and your JavaScript code.

JavaScript is disabled in a WebView by default. You can enable it through the WebSettings attached to your WebView.You can retrieve WebSettings with getSettings(), then enable JavaScript with setJavaScriptEnabled().

"

WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);

"

Second Ways :

1)-------------------------------------------------------------------------------------------

<uses-permission  android:name="android.permission.INTERNET"></uses-permission>

2)-------------------------------------------------------------------------------------------

android:id="@+id/webview"

3)-------------------------------------------------------------------------------------------

import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

4)--------------------------------------------------------------------------------------------

private WebView mywebView;

5)--------------------------------------------------------------------------------------------

mywebView=(WebView) findViewById(R.id.webview);
 mywebView.setWebViewClient(new WebViewClient());
 mywebView.loadUrl("https://coupon.technovedant.com/");
 WebSettings webSettings=mywebView.getSettings();
 webSettings.setJavaScriptEnabled(true);

6)------------------------------------------------------------------------------------------------

public class mywebClient extends WebViewClient{
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon){
            super.onPageStarted(view,url,favicon);
        }
        @Override
        public boolean shouldOverrideUrlLoading(WebView view,String url){
            view.loadUrl(url);
            return true;
        }
    }
@Override
    public void onBackPressed(){
        if(mywebView.canGoBack()) {
            mywebView.goBack();
        }
    else{
        super.onBackPressed();
            }
}

-----------------------------------------------------------------------------------------------

See video for more knowledge : Link


Tags


How to create free application
how to convert website to apps
create free website to application

Post a Comment

0 Comments