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.
Related
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.
Intending to view a PDF File from the Hybrid Mobile App , created using HTML5 Jquery and Packaged with Phonegap.
But unable to achieve it ,
Things i tried
<object src="xyz.pdf" type="application/pdf"></object>
also,
window.open('xyz.pdf'); //through javascript
and
$(document).load('xyz.pdf');
Can anyone suggest the best way for viewing the PDF in a Hybrid Android Mobile App.
with cordova you must think about these:
HTML 5 object tag: not working
If you try with:
window.open('http://www.???.com/my.pdf', '_blank', 'location=yes');
The InAppViewer canĀ“t open this kind of files.
I think that there aren't an hybrid solution for this problem.
You must start to search or write about a plugin that use a native pdf's opening and then use it.
An example:
cordova-plugin-file-opener
The latest solution, a little more simple but include to open google docs is:
window.open('https://docs.google.com/viewer? url=http://www.example.com/test.pdf&embedded=true', '_blank', 'location=yes');
ref = window.open('index.html', '_self');
Go look at the Mozilla pdfJS project.
This project allows you to open a pdf (embedded in app or remote) in your app. No break-out links that relies on native viewers.
They also give you a very full featured sample viewer, that you can use as is, but much of functionality in that does not apply to mobile applications.
I have had success with this on Android 4.3 Devices.
Try installing the InAppBrowser plugin to do so. I have use it to open PDF files right inside the app on both iOS and Android.
Check the official InAppBrowser doc with full doc and examples, it has several options you can enable/disable (be sure to point to your current cordova version documentation):
My solution for connected apps with offline availability...
window.open('http://www.someserver.com/doc.pdf', '_system')
...this will open in default pdf viewer. I have my clients use adobe reader for obvious reasons. And also because once it is downloaded the first time, adobe app manages and edits the documents well, and the documents are also available offline from within adobe reader thereafter. Even pdf forms.
Have cordova.js linked on the page.
Have inAppBrowser added.
For full offline you may try FileOpener plugin. I have not needed to do that on android, but I have used that way in iOS.
Hope any of this may help.
Though am late here, still want to share what I know. You can use this plugin to view PDFs in the app (without inappbrowser). Supports only Android and iOS.
Hi I'm working around with jquery mobile and cordova 3 on a android device.
Everything works great except that I can't open links in the default browser or for example the maps application.
I can open it with a inappbrowser plugin but I dont want to do that. I just want to open the links to websites with the default browser.
I tried many things like here:
Opening Link in System Browser in PhoneGap 3.3 on Android
Open Links in Default Browser using Phonegap/Cordova
But I saw that the answers are showing the solution with the inappbrowser which I dont want.
How can I solve this?
Thanks for any help
For Android OS use following code.
navigator.app.loadUrl("http://google.com", {openExternal : true});
or through inline JavaScript:
<a onclick="navigator.app.loadUrl('https://google.com/', { openExternal:true });">Link</a>
It will NOT work with iOS, also, I don't know, if currently exist a solution for iOS, that don't require inappbrowser.
I'm looking to build an android app based off a mobile site. Basically, I just need an app with a browser that I can use as a platform.
Many of the "build an app online" sites offer this, where you just put in the home url etc, but they all include their own ads etc.
Any ideas where to start?
If you want to make your own simple app without Ads, use just a WebView inside of a simgle activity layout set to fill the screen.
Doing this you will eliminate all ads, as well as have the ability to add in more features later on if you so choose.
If you just want to create a launcher icon that will open up the default browser to your sites page, you can do that by just starting a browser intent, and then closing the actual app.
This will allow you to have an app icon and play store listing, however the only thing that iw will do is bring the user to your website like you have mentioned.
Create an Activity with a WebView.
I think you're looking for an app that displays a WebView. However, that will only display the website as if you were looking at it in a mobile browser such as Android Chrome.
If you want the data from a mobile site, without anything else, then you have to hope that the site provides that, or you have to download its HTML and scrape it.
I use the childbrowser in my jqtouch - phonegap iPhone app and have now created it in Eclipse aswell, I have got the childbrowser to work in Android.
In the iPhone the childbrowser has a Done button and in the Android it opens a window with a address field at the top, is this how it suppose to look like - work?
When I open a .pdf or .doc document in the iPhone it opens in the childbrowser so I can read it, but in the Android it downloads the document, is this what it suppose to do?
If so, is there a way to open .pdfs so you can read it without downloading it first?
3. Is the childbrowser suppose to work in the emulator?
Thanks.
Yes, that's how it's supposed to work. The child browser is a bit non-idiomatic on the Android platform, since the Android way is generally more to open content that isn't native to the app on another app where it is (see question 2). The typical way in Android when you encounter a link is rather to open the web browser with that link, but in iOS the Child Brower UI pattern is very common. The Child Browser Android plugin also have a way of sending links to the web browser, I'd recommend you try it and consider using that instead of the Child Browser for your Android app version.
Also yes, that's also how Android generally works. Creating in-app viewers for .doc of .pdf -files would be too difficult if that's not the app's primary task.