Websites (static or dynamic) conversion to android app - android

Let us take a website like Facebook. We access it using a desktop web browser or a mobile web browser. Now, I can also install a Facebook app from the google playstore.
I understand a website can be converted to an android app using WebView layout in android studio.
Is that the only way these websites are converted to android apps?
Is there a different way that an android app can be developed for a website like facebook other than using WebView? (For eg. Facebook developed as a webapp for desktop/mobile browsers) and developed from scratch using Android Studio without using WebView but still can log in and make updates which reflects on the app as well as mobile/destop browser)
Why would there be a different method, if any? Any limitations for webview?

1.) Not necessarily.
2.) For a "dynamic" site, you could develop API's that retrieve the data to be shown on the web pages. These API's could then also be used to build an Android app.
3.) First of all, by using a WebView, you would want to carefully design the UI of the website to be responsive and look good for mobile devices. (How it would appear in the WebView). On the other hand, if you were to build your app from the ground up, you would be able to basically have a custom implementation of the website in app form. If you were to build server API's and query them over HTTP from the android client, you would probably be able to give it more of an "app" feel, rather than just a website.
Here's an example of both scenarios.
If you wanted to build an app for Facebook, you would do one of the following.
a.) Develop a mobile-friendly version of the website and display it in a WebView in the Android app. Done!
b.) Develop server API's to retrieve information that you would find on the Facebook website. (Posts on users walls, photos, etc) Then implement these API's to display data in the Android client using components like ListView's and ImageView's

webView.setInitialScale(1);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);
webView.loadUrl("http://www.educationboardresults.gov.bd/");

Related

Is it possible to emulate Kotlin android Android with a browser?

I am looking forward to create an Android app with Kotlin.
But I can not use Android Studio or other IDEs. I am using the Amazon AWS Cloud9 IDE now.
I have found there is WebView and read articles, but I still cannot figure out how it works.
It is possible to emulate the UI on the web or is it only for web application development?
The WebView framework allows you to specify viewport and style properties that make your web pages appear at the proper size and scale on all screen configurations for all major web browsers. You can even define an interface between your Android app and your web pages that allows JavaScript in the web pages to call upon APIs in your app—providing Android APIs to your web-based application.
Consider using these alternatives to WebView if your app falls into the following use cases:
If you want to send users to a mobile site, build a progressive web app (PWA).
If you want to display third-party web content, send an intent to installed web browsers.
If you want to avoid leaving your
app to open the browser, or if you want to customize the browser's
UI, use Chrome Custom Tabs.
More details

does the amazon app use the native webview?

I've read a few post saying that the amazon app uses webviews pretty heavily
(sources: - https://www.quora.com/Why-does-the-Amazon-app-use-WebView-in-their-Android-and-iOS-application
and https://www.teamblind.com/post/Amazon-app--webviews-cuT4sN6C)
Now, i've played with webviews a bit in android in the past where i loaded a remote url to the webview and it loaded the exact version of that website onto the mobile app. This to me was expected. So i investigated amazon's ios app and compared it to the desktop website (in mobile view), and indeed they were very similimar. However, there were some elemets that were missing on either or platforms. i'll attach the images below:
(left is the ios app, right is the mobile view of the website on desktop)
Now I have a few questions:
when people mention "webview" for amazon's use-case are they talking about the native webview from android and ios like the Webview and WKWebview? (https://developer.android.com/guide/webapps/webview and https://developer.apple.com/documentation/webkit/wkwebview), or are they talking about hybrid app technology like apache cordova or Ionic?
If it is indeed a native webview container, can you edit the html to remove some elements? like how some stuff were missing from the mobile app that weren't on the desktop website. And also add stuff like now the mobile app has "Buy Now" button, and the "favourite icon"?
How far can i go with Webviews, in terms of having access to native features like camera, gps and all that good stuff?
When people mention "webview" for amazon's use-case are they talking
about the native webview from android and ios like the Webview and
WKWebview?
Yes, they are indeed framework webviews.
But there is a good chance that they use hybrid app tech.
If it is indeed a native webview container, can you edit the html to remove some elements? like how some stuff were missing from the mobile app that weren't on the desktop website. And also add stuff like now the mobile app has "Buy Now" button, and the "favourite icon"?
You can edit html to remove / add elements using javascript in webview BUT this is not the case here.
These sites have a specific different UI for different devices. (Desktop / Mobile)
For example: Flipkart uses a mobile version on apps which is not available on browsers, except Chrome on mobile (I guess). It just redirects the user to the respective app store to download the app.
I assume it is done by checking the User-Agent field.
How far can i go with Webviews, in terms of having access to native features like camera, gps and all that good stuff?
You can use camera and gps via webview.
More info. here and here.

How android application and web application working?

I'm a little confused because I couldn't understand how android application working at the same time with web application . for example I have a web site and I wanna have a android app for my website and how can i programming at the same time , can i build my android app with php ?? this is the main question i have and i don't understand what i should do and how web site and android app working . for example Amazon has a android and ios app at the same and Amazon has a website , how those thing working together ???
You can build a webview app that is app where you can display HTML with Css and maybe also JS.
That is what google said about webview app:
By default, a WebView provides no browser-like widgets, does not enable JavaScript and web page errors are ignored. If your goal is only to display some HTML as a part of your UI, this is probably fine; the user won't need to interact with the web page beyond reading it, and the web page won't need to interact with the user. If you actually want a full-blown web browser, then you probably want to invoke the Browser application with a URL Intent rather than show it with a WebView.
You can find more information about a webview app is here: https://developer.android.com/reference/android/webkit/WebView.html
If you have any other questions about it feel free to ask.

How to embed a website into an Android App?

I have a mobile website, users user smart phone browser to access my site.
Now some users would like to have an Android App.
So is there any easy and fast way to create an Android App which will access the existing mobile website so that I can have an Android App without developing Android app?
You would have to create a "wrapper" Android App. That is a native Android App with a Main Activity that contains a WebView with JavaScript enabled and some sort of navigation controls either on the mobile website or the native app (buttons or menu) but you could bump into problems such as:
Users being stuck in a particular page with no way to navigating back or forward.
Google is now more picky with the apps and they have policies to reject or ban apps that are only wrappers or point to external websites (kind of what Apple did for iOS)
Any case, you would have to create a mobile layout for your website or a make it responsive (special CSS and JS UI/UX that fits better on mobile devices).
Another alternative is to make your website compatible with PROGRESSIVE WEB APPS (https://developers.google.com/web/progressive-web-apps/) which is basically a Web app with some special elements that allow it to receive push notifications, put a shortcut or app icon on the device's home screen, etc.
Good luck! Hope this helped!
You can use android WebView. For more details you go through the link Android Webview
the only way to do that, using WebView on your apps or you need to create manually
You can put your code into Cordova and convert it into other IDE like android studio or eclipse .
reference:
Import Cordova project in Android Studio

Building a downloadable iOS web app

I gather from this page that it's possible to use the WebView framework build an Android web app that can then be run on the device without using a web browser.
My question is: is the same possible for iOS, possibly through the UIWebView object?
Notice that the link talk about:
You can make your web content available to users in two ways: in a traditional web browser and in an Android application, by including a WebView in the layout.
With this you can implement a javascript bridge and catch javascript event in android java contest.
iOS allow the same. UIWebView can catch javascript event and work with it.
The most cross platform sdk for mobile development use this feauture to realize the application in javascript and work it in a selfcontained webView.
Use this to start

Categories

Resources