I have tried using this WL.App.openURL('link','_blank').
In my app, I have some hyperlinks. Upon clicking a link, it has to load respective pages in the app itself.
How do I accomplish this?
You are mis-using the API...
You have 2 options:
Use Cordova's InAppBrowser API
This way you can display a browser window ontop of the app; when done you tap a button to close it and return to the app. This code snippet works:
visit Apache.org;
Read the Integrating server-generated pages in hybrid applications training module and inspect the sample project
This way you can load an external URL within the application's WebView.
For your case option 1 seems the solution to use.
Related
I want to executive/run other pre-installed android based application inside my new developed application. For example I want to run what's app, Facebook, and Skype at the same time within my application.
I am analyzing about the android containers in which application can be load and execute. Like we used WebView container to load website.
Please suggest for the same
You should use Deep Links or better Dynamic Links - https://firebase.google.com/docs/dynamic-links/android/receive
How it works? You have 2 buttons in your App. On click on them you will open needed app or open it page on Play Market (or your own web site or something else, because you can config it via Dynamic Links).
Is it possible to create a mobile app for both Andriod and iOS which will display the same data as on a website written in HTML CSS and js?
The site only displays information but this info is used regularly by users. I have been asked if it's possible to create an app that the same info would be available on? Ideally, any changes made to the website would be reflected in the app without having to change the code for the app as well.
edit - The page on the app will still need functionality i.e being able to open modals when a button is clicked.
You could embed your site in a native app using a WebView. Nowadays you have several technologies as React native and Flutter that could help publishing your site as a multiplatform app.
I'm building a web app for internal use of a company that uses Samsung tablets (Android 9 and Chrome latest versions). I have a page with a list of links to PDF documents and the problem is that when I click any of them, they do not open automatically but instead show an Open button asking to open the document. If I click Open, the document opens as expected with the default viewer (Google PDF Viewer). When I go back, the Open button is still there. If the document has already been downloaded, the browser asks whether to download it again. These images show the situation:
http://www.maresme.net/stackoverflow/chrome_android_pdf/open_button.jpg
http://www.maresme.net/stackoverflow/chrome_android_pdf/allow_auto_downloads.jpg
Is it possible to bypass this step and have the docs open automatically without showing this button? I want to avoid this button and that when users go back from reading the doc they find again the list of links to other PDFs.
I've tried different methods of embedding PDFs (embed, object and iframe) without success. Also, I considered using pdf.js with the canvas tag but my webapp must also work offline and this solution uses too much resources.
Searching the net I found references about an option in Chrome under "Privacy and security" to allow automatic opening of the PDFs but this option does not appear in the tablets I'm using. Is it a security restriction that can't be bypassed?
I will really thank any help with this, it's driving me nuts.
I'm going to answer myself: the problem with Chrome mobile is that it has no support for extensions, so there is no PDF plugin that allows to view this kind of files within the browser. When you intend to open a PDF file the browser has to open it in an external app, be the default viewer (if defined) or any other which is capable (a list will be presented). This is why it asks permission, which I suppose it's a security measure and don't know how/if it can be circumvented.
With pdf.js (and other commercial kits) you can parse the PDF file using JavaScript in the browser, so no plugins are required. However, you must include all this code in your PWA for offline use (and there is some). Another approach that has worked for me is to use the Kiwi browser which supports extensions (I have a closed group of users and I can force this) and then use a plugin, for instance, the plugin version of pdf.js.
Hope this helps someone.
I am using phonegap to be able to have my website (that is already hosted in shared hosting server) and has responsive web design. I have tried the solution provided in posted question:
typing my website link in src, that has been done successfully as the index page is loaded and no website link shown in the app, but once the user click on any button (which basically go to other website pages) it will open it inside the app but the link of the webpage is shown, you can see the screenshout I took from my mobile (android).
<content src="http://192.168.1.4:8080/www/index.html" />
I have followed the same instruction in the answer and set the target to _self in the following:
indow.open(url, target, options);
but it still show the link of the site.
Thanks
Ok I figure out this issue, Actually I need to set the location = no and the link will not be shown
I know about phonegap but here i am want to know if it
is possible to have an android application which is not
really an application but merely a browser that opens only
a particular webpage, that is only the mobile site i already
designed, am not sure but i have seen some android apps and i know
they do something similar , below are the things i want :
The app should be installable.
Just opens a link to an existing webpage online.i.e its more like a browser
only it just opens only a specified web page
is this possible with Phonegap for Android ?
You can do that. You would want to use the inappbrowser plugin to open an external page when ondeviceready is fired. Take a look at my SO answer here for a guide on how to use the inappbrowser, and you can take a look here for the docs about ondeviceready.