Skip to main content

Convert website to android and ios application using react native expo webview

Convert website to android and ios application using react native expo webview

If you want to check you can check on github by using below link also dont forget to give star ;)
Source Code: https://github.com/shubham715/react-native-expo-webview-convert-website-to-app

React native is the best choice to create multi platform mobile application , but sometimes we dont want to write a complete application because we already have a web application or a website and its complicated to manage both . So we have a solution for this problem. React native supports webView that makes easy to run any website url like an app natively.

What is webview in react native?

In React native, WebView helps to show web content in a native view.

For this tutorial we will use EXPO.

What is EXPO ?

EXPO a set of tools to help you quickly start an app. Expo have many inbuilt components that helps to simplify the development and testing of React Native app.

So please follow the below steps to create a mobile application by using your website url easily

First install nodeJS, react native , EXPO. You can check react native official documents for this.

After successfully installation of above tools we can proceed to next steps

Now open terminal and go to your directory file by using "cd" command.

then run the following command

 
 expo init rn 'MyWebView'
 


After press enter , it will create a rn folder and into "rn" folder, expo will install all the required packages.

Now navigate to "rn" folder by using cd command

cd rn

So our react-native application structure is installed and now we will install "Webview by using expo"

Open terminal and make sure you are in "rn" directory

Now run the below command

 
expo install react-native-webview
 

the above command will install webview package and now we can use it to show our website in webview.



Now in terminal(cmd) run below command
 
yarn start
 

here we installed packages through yarn that's why we are using yarn otherwise you can use expo or npm to start application
When you press enter , the command will give you output same like below screenshot.



Now you can scan qr code using expo app and run application.

Ok so our mobile application is working nice and showing default homepage.


Now open App.js from the root directory of our project and import webview by using below code

 
import { WebView } from 'react-native-webview';
 

Now we need to create view for it and then we need to pass url in it so that url will show in webview.
We can render webview by using below code
 
<WebView source={{ uri: 'https://thecoderain.blogspot.com/'}} style={{ marginTop: 20 }} />;
 

I know it looks like difficult and can make you confuse but dont worry here is the full code of App.js file .

 
import React from 'react';

import { StyleSheet, Text, View } from 'react-native';

import { WebView } from 'react-native-webview';



export default class App extends React.Component {

  render() {

    return <WebView source={{ uri: 'https://thecoderain.blogspot.com/'}} style={{ marginTop: 24 }} />;

  }
}
 




Now save the file and check in mobile or in simulator, because we already running expo app and scanned above mentioned qr code so it will show changes instant.

Great our mobile application is ready. There is so much possibilities like preloader , navigation that you can add . So keep try to make it more better.

To create apk or ios app , please follow our tutorial "how to convert react native app to apk file" and "How to convert react native app to ios application" tutorial

Happy Coding Thanks.

Source Code: https://github.com/shubham715/react-native-expo-webview-convert-website-to-app

Related Links:-
Convert website to mobile application
Create a mobile application by using website
Create mobile application using react native
How to use react native Expo Webview
React native webview to load website
Build ios app using webview
Convert website to ios application
Convert website to android application
Build a simple react native app using expo
React native tutorial



Comments

  1. Thanks for posting. Its an Important topic to be read.
    React JS training in hyderabad

    ReplyDelete
  2. Hey! This is my first visit to your blog! We are
    a collection of volunteers and starting
    a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!

    React Native Development Company
    Reactjs Development Company Texas

    ReplyDelete
  3. In this present era of digitalization, a mobile application is one of the primary necessities for today’s modern-age businesses to stand-out in the industry, including even the top Indian app developers of the market are swapping towards mobile applications rather than the ordinary websites. The applications developed through cross-platform are apparently becoming more prevalent in the market, and React Native is one of the most preferred cross-platform development solutions by the developers as it allows them to preserves native platform compatibilities through react development.

    ReplyDelete
  4. Hi!
    Thanks for sharing such a nice article in depth. If you are looking for the best React Native App Development Company, QSS Technosoft is one of them.

    ReplyDelete
  5. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information.. Convert wordpress site to progressive web APP

    ReplyDelete
  6. This is a very interesting web page and I have enjoyed reading many of the articles and posts contained on the website, keep up the good work and hope to read some more interesting content in the future.
    Mobile App Development Company in Dubai
    Mobile App Development Company
    Mobile App Development Company in UAE
    Android App Development Company in Dubai

    ReplyDelete
  7. Thanks for this tutorial

    You have mentioned two tutorials to follow next; "how to convert react native app to apk file" and "How to convert react native app to ios application". May you please post their links

    Thanks so much

    ReplyDelete
    Replies
    1. https://thecoderain.blogspot.com/2020/03/solution-your-project-must-have-android.html

      Delete
  8. The number of increasing smartphone users can be seen. There are several other reasons which advocate converting the website into an application, but if you want to know that how to convert a website into an Android app and also you can hire indian app developer, a prominent name in the app development companies of India.

    ReplyDelete
  9. Mobile apps are playing an important role day to day life and apart from these the rise of on-demand cross-platform app development services it allows creating applications that stand out in the market by applying available resources efficiently .

    ReplyDelete
  10. React Native is a framework for cross-platform mobile app development for iOS and Android. This framework depends on React ideas and, in this way, permits making solid mobile applications. React Native Mobile App Development is viewed as less effective and beneficial. HireFullStackDeveloperIndia React Native Mobile App Development Services have helped clients reach their business objectives on both Android and iOS platforms.

    Consult today to hire React Native Developers!

    ReplyDelete
  11. Look at the way my pal Wesley Virgin's tale launches in this SHOCKING and controversial video.

    As a matter of fact, Wesley was in the military-and shortly after leaving-he unveiled hidden, "self mind control" tactics that the CIA and others used to obtain whatever they want.

    These are the same secrets many famous people (notably those who "come out of nothing") and elite business people used to become wealthy and successful.

    You probably know how you utilize only 10% of your brain.

    That's mostly because most of your brain's power is UNTAPPED.

    Perhaps that thought has even occurred INSIDE your own head... as it did in my good friend Wesley Virgin's head around seven years ago, while riding an unlicensed, garbage bucket of a car without a license and in his pocket.

    "I'm very fed up with going through life paycheck to paycheck! When will I become successful?"

    You've taken part in those questions, isn't it so?

    Your very own success story is waiting to start. Go and take a leap of faith in YOURSELF.

    Watch Wesley Virgin's Video Now!

    ReplyDelete
  12. You do realize that this type of SEO marketing hurts your google rating right? Google is not going to crawl this link and mark it reliable, too smart for that now.

    ReplyDelete
  13. Thanks for sharing a useful post..! This blog is very important for React Native programmer & developer. Keep sharing further valuable information like this post.

    Best React Native App Development Service in New York

    Top React Native Mobile App Development Companies in New York

    ReplyDelete
  14. Very good! Thanks for these amazing ideas. You provide very informative information about conversion about websites to android and IOS applications by the use of react-native web viewing steps. If you want to gain more knowledge about how to react-native works.

    ReplyDelete
  15. Are you searching for Website Development service in USA ?Digital veloce is one of the Website Development service in USA .Our customized services range from Website development and designing to mobile apps and internet marketing. We are offering the best web development services in the US at an reasonable price. Visit Website - http://www.digitalveloce.com Call Now- +91-8920928177

    ReplyDelete
  16. Thanks for sharing this wonderful information for converting website, android and ios application using react native expo. This will helpful every react native application development company

    ReplyDelete
  17. Thank you for sharing your blog. This is a very informative blog to mobile app development.are you intrested to covert website into Mobile app? Follow this:- Top Mobile App Development Company

    ReplyDelete
  18. This is the most junk article I have ever read, it absolutely provide nothing

    ReplyDelete
    Replies
    1. Sorry to hear that , may be you need to learn programming first then only you can understand. btw happy coding :)

      Delete
  19. Here is the super extra 20x fast server and cheap best and cheapest web hosting service to grow your big and small business on all search engine & get more sales or traffic, 70% blast discount, 24 hour live chat support.

    ReplyDelete

  20. Very help full blog, for sharing content and such nice information for me. I hope you will share some more content about. Please keep sharing! IOS App Development Services

    ReplyDelete
  21. Really a Helpful blog. Here you have clearly explained about how to convert website to android and ios application using react native expo webview. React Native platform is one of the most preferred cross-platform development by the developers. If you have questions regarding React Native Services reach out Way2Smile Solutions Website Development Company in Chennai

    ReplyDelete
  22. There are more benefits of react native development frameworks and react native app developers have extensive knowledge to build user friendly application with cost effective solutions.

    ReplyDelete
  23. Are you looking for React Native Development Service or want to grow your existing team of experts to create multi-platform User Interfaces for both iOS & Android? React-Native is the most preferred JavaScript framework for building cross-platform application development. To Hire React Native Developer who will deliver the most value to your app development team, you should be prepared to recognize whether they maintain the needed skills, both professional and interpersonal.

    Hire Full Stack Developer to get an excellent one-stop software solution for your Web or Mobile App Development. Get a Free Quote For Your Reliable Front-end or Back-end Solutions.

    ReplyDelete
  24. HireFullStackDeveloperIndia is one of the best Mobile App Development Company in Jeddah that develop a client's dream app idea into a powerful mobile application. They create mobile apps for a variety of handheld devices that are responsive enough to adapt to changing market trends. They are well versed in developing mobile apps for Android, iOS, iPad, and Windows that satisfy your app requirements with value for money and prompt service.

    ReplyDelete
  25. Best Web Design Company in Lebanon delivers stunning and functional websites that resonate with the people interacting with them. They will discover the tiered content support levels by following the process and including it in the website design. Their motive is the global growth in the web development domain by rendering effective services and solutions.

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Check out the top reasons why businesses should hire a React Development Agency to build their web or mobile application. Zazz is a premier ReactJS Development Company. For more information please visit the website.

    ReplyDelete
  28. Beautifully Explained. For the past few days I was researching on this topic but could not find any reliable source. Finally I am able understand the basics all thanks to you. Keep up the good work. If you want to enquire about React Native App Development Companies, I can help you with that.

    ReplyDelete
  29. This post is so insightful and gives me a very nice piece of knowledge about the subject. I visited your blog for the first time, but I was really impressed. Continue posting as I will come every day to read it.
    best react native app development services in UK

    ReplyDelete
  30. Thanks for sharing such amazing content which is very helpful for us. Please keep sharing like this. Also check for Mobile Apps Development using React Native or many more.

    ReplyDelete
  31. Excellent Blog, I like your blog and It is very informative. Thank you

    RPA Online Course
    Pega Online Course

    ReplyDelete
  32. This blog likely provides a tutorial on converting a website into an Android or iOS application using React Native and Expo WebView. It may offer step-by-step instructions and code examples for creating a mobile app that displays a website using WebView. A valuable resource for developers looking to transform web content into mobile applications using these technologies. If you are looking forward to Hire Node js developers, we will gladly help you.

    ReplyDelete

Post a Comment

Popular posts from this blog

Run and compile sass scss file to css using node

  Today we learn how to use scss and generate css using node  or Run and compile sass scss file to css using node   So please follow simple  steps :-   Today we will create a project that can read scss file and generates css with it  Note: Make sure you have installed node in your system. If you want to help to install node js based on your system then check our other tutorial or check node js official website. Now create a blank folder and open  terminal(linux) or cmd(windows) and navigate to your current project folder by using cd command Now run below command npm init after enter it will ask you some package info that you can fill according to you or just keep enter until it finished. The above command will generate package.json file Now  we will install npm module that will convert our scss to css Run below command: npm install node-sass So we have installed node-sass package . Now open package.json file in your editor and add below code into it into

How to retrieve Facebook Likes, share , comment Counts

function facebook_count($url){     // Query in FQL     $fql  = "SELECT share_count, like_count, comment_count ";     $fql .= " FROM link_stat WHERE url = '$url'";     $fqlURL = "https://api.facebook.com/method/fql.query?format=json&query=" . urlencode($fql);     // Facebook Response is in JSON     $response = file_get_contents($fqlURL);     return json_decode($response); } $fb = facebook_count('https://www.facebook.com/BahutHoGyiPadhai'); // facebook share count echo $fb[0]->share_count;  echo "like"; // facebook like count echo $fb[0]->like_count ; echo "comment"; // facebook comment count echo $fb[0]->comment_count;  ?>

jQuery Datatable add date range filter

jQuery Datatable add date range filter Datatable is most useful jQuery plugin that helps to make our html tables more powerful and give powers to user to filter , search, sort, pagination etc, But Data table provides a common filter only and yes we can customize and add filter for each column, but still sometimes we need an advance filter like show results only between a date range, So today we will learn how to create a minimum and maximum date range fields and show date picker on it, and user can fill dates by selecting dates and data table will auto filter records based on it. Keep follow below steps :- I am using Bootstrap if you want to use any other framework then you can use. Create a new index.php file  and paste below code in it, i have used all required CDN like bootstrap, datatable, datepicker etc. <!DOCTYPE html> <html> <head>     <title>Datatable Date Range Filter Example</title>     <link rel="stylesheet" href="https://maxcd