Android Questions about Mozilla GeckoView - android

I am a beginner Android developer.
I using the 'WebView' had tried to make a Android App.
However, the speed of the web is too slow.
So the Internet search results found GeckoView.
But homepage has been difficult for me to understand I do not know English well.
My questions:
Can I use GeckoView instead of the WebView? Is it simple?
Can I use a code library that just adds to the 'build.gradle' in Android Studio?
Is there another altenative?

Yes, you can use GeckoView also....
Android WebView is not intended for building browser application because, many advanced Web API'S are disabled.
And different phones might have different versions of WebView all of which your app has to support....
Geckoview is open source library that allows you to render web content on Android using the Gecko web engine...
I made simple application with webview, just check out you'll get some help
https://github.com/malikhimani21/Project-2
In some cases, a WebView is a good option for displaying trusted first-party access to your web pages from either a browser or your own app
check out this link
https://developer.android.com/guide/webapps

Gecko view is only experimental. You can't use for production
https://wiki.mozilla.org/Mobile/GeckoView
So your only choice would be a webview. If you are great in javascript, I would recommend you to use react-native. This is how facebook is made, and you can follow extensive documents mentioned here.
https://facebook.github.io/react-native/

Related

How to develop the next best alternative to chrome extension in android

I have built a chrome extension that works fine. I know I can't deploy it to android. So I would have to build an app. The app may or may not have anything to do with chrome; I don't know. This isn't a chrome extension question.
But as to the integration between the app and the on-board browser, I see the android api doesn't have any functionality for browser or web integration? Is that correct?
I'm just making sure because building an app that is essentially it's own proprietary browser, just to get my functionality onto android, is not really something I think a lot of people would download. I'm looking for a more integrated way than that. Is there one?
For those who say impossible, I know for a fact there is an app which added a context menu inside chrome on android but I have no idea how they did that or what other integration is possible. It was a webpage pdf converter. Upon clicking that menu it converted the webpage to pdf, and opened the pdf in the app.

Running Website Natively On Phone Apps

I have customers wanting my website in app form, but the website is responsive. I've been looking for an open source project or code to just run the website in an app or open up their default browser to direct them to it. They just want the button.
Is there an open source project to make it easy to develop that code for iOS, Android, etc.
Are there any issues with running a website natively? Aka, same as cross-browser issues or..?
Thanks!
There is Apache-Cordova at this link. It is multi-platform and free/opensource.
In Android, you can use WebView.
Android WebView is a system component powered by Chrome that allows Android apps to display web content.
For more information about Android WebView, please visit the documentation

Chrome for Android content access from external app

Is there any way to read page content (html source or DOM) from the active Chrome tab on Android devices?
Chrome for Android doesn't support extensions and there is no plans to implement Extension API on Chrome for Android in the nearest future (however, Chrome for iOS now supports App Extensions).
Some apps (for example, LastPass) can access web content inside web browser.
How can I get read access to the active web page? Are there any external Chrome APIs or something similar?
Any suggestion will be appreciated. Thanks in advance.
It seems to be possible with Android Accessibility. I think the flag you need is FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY, so you can inject JavaScript into the website.
As you can see in this blog by lastbpass, they use the same approach. In the video at 0:53, you see the accessibility features they use.

Ttitanium webview and HTML5 application cache

I am using Titanium to create a application for Android. The app uses webview to load external HTML5 webpages. The webpage uses a manifest to cache the page and some assets. This works fine on desktop browsers and third party app browsers in Android (Chrome).
When I view the page in a webview in the Titanium build app, it seems that the manifest is not used, the page just loads everything from the server. The same problem occurs when I use the build in browser of my phone (HTC one X).
What I am trying to accomplish is that the pages are offline available, so that internet is not required tot view cached pages. Is there a fix for this problem, or should I go look in another direction to solve my problem?
the manifest file:
CACHE MANIFEST
# version 1
leerlingen.html
jquery.js
style.css
handler.js
NETWORK:
*
First: Titanium provides much more than a WebView. If you planned to display only web pages you maybe should have a look at PhoneGap / Cordova which might fit your needs in a better way.
As you've noticed not all browsers support HTML5 Caching feature as expected. I can't say if it doesn't work for Android in general or only for your specific version because WebKit usually does support it but it depends of the used WebKit version. And this could be different.
EDIT: It seems that (in native android) this feature can be enabled as written here: Application cache in HTML5 doesn't work in Android PhoneGap application. This is currently not possible in Titanium (there might be inofficial tweaks i don't know but from http://docs.appcelerator.com this is not possible).
Personally i'd prefer another solution. Cache data by myself and display it if there is no network connection. But this depends on what you try to achieve. Having few content which doesn't change often this would make sense. Having dynamically changing data (like twitter stream for instance) this would be difficult. Also it depends on your users and where they want to access your app.
And there is an open question: When you want to use all the caching features why do you want to create an app? Creating a simple mobile webpage would do the same job. When creating an app i wouldn't use the Caching Features of HTML 5. You should keep all the static resources in your app and simply load data from the network. This can be achieved by both Titanium and PhoneGap / Cordova. Titanium is more useful for a native UI and some native Features while PhoneGap / Cordova would be more appropriate for HTML5 based layout.
Just in case someone else is running in the same problems that i was facing, here is what i've done. HTML5's application cache does not seem to work in the build-in browser of Android and with that the webviews. In Titanium there seems to be no way to control the webview as to enable the application cache.
The work around for me was to use Titanium and it's httpClient function (Titanium.Network.HTTPClient) to request the files (HTML, CSS, javascript) and store it in the local app filesystem (Titanium.Filesystem).

How do I use webview to embed the web app in a native Android App?

I have a fully-working web app that is accessible using Android's browser.
The annoying part is the url bar uses a lot of the screen. Is there a way to make this web app a native Android app? I've read that webview can be used to embed a web site within the Android App.
Unfortunately, I only know web programming languages and have no Java experience. Will I still be able to do this on my own?
You certainly will need some learning in java, you can start with reading the following :
Webview documentation
A very detailled tutorial (quite hard if you haven't any java basics)
A basic tutorial on webview usage.
Have you looked at phonegap. It comes with a standalone app with a WebView embedded in it and with native android functionality support. You just need to provide your html/javascript app to it and you're done.
You can use a web app called MIT App Inventor
and get it done in less than 10 minutes, it's very easy, intuitive and requires no programming skills at all.
all you need to do is create a new project,
drag and drop a WebViewer component, on the right set the home url,
and your done! just connect to an android phone via USB to install the app
and you can even download the .apk to your computer, sign it and publish it on Google Play

Categories

Resources