Android native code from web browser using javascript - android

Is it possible to access android native code using javascript in the default android browser?
Regards,
Dom

No, sorry.
You can create your own Android app that exposes Java objects to WebKit through the WebView widget. Also, you can link to Android apps from your Web content displayed "in the default Android browser" (whatever that might be for the user). And, you can arrange to have an app that you write respond to URLs that otherwise might go to a browser. But that's about it.

Related

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

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.

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

Display offline html in android app with a tablet

I have to create an android app, that displays an offline html website. Does android sdk have an internal browser control? What kind of dev sw do you recommend to create this basic wrapper?
Read about WebView.
It's built-in webrowser engine and you can use it to your target.
Yes. WebView
http://developer.android.com/reference/android/webkit/WebView.html
This component allows you to specific a local url (file://) if required or even passed the complete html to the load method. Also capable of event handling for more advanced scenarios.

How do you replace the default webkit browser with another one in an android web view?

How can I change the webview in an app so it uses another engine, not the engine from the android browser?
You cannot "change the webview". If another browser elects to make its code available as a JAR exposing some sort of widget, you may be able to use that -- you would have to contact the browser developer to find out.

Categories

Resources