I am trying to write a sample android program to read an epub file which is embedded video,but I am not sure whether WebView can work?
I believe that android only starts with html5 by default at ICS? I could be wrong but you would probably need to get some OS stuff and work from there, maybe look into opera or dolphin browser, not sure if they have source code available but just along those lines, you need to find a OS browser with HTML5
Related
When I try upload files opening via standard Android browser, I can't do it. I read in internet, that this trouble of webview.
My system is 4.2.
Is there way to solve this trouble, maybe install any patch? Or maybe in another version of android there is no this problem and the easy way is updating to new system. How to make webview to work forcibly?
Please don't recommend to use any another browser, I need standard.
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.
I have a dynamic HTML5 document that does not contain any external resources (no images, css and scripts are coded inside of document). This HTML5 application is working fine with internet browser. I was wondering, if it would be possible to convert this HTML5 application into standalone Android application, so it can be executed directly without browser. Please advise.
Create an Android app using Eclipse.
Create a layout that has a <WebView> control.
Move your HTML code to /assets folder.
Load webview with your file:///android_asset/ file.
And you have an android app!
Edit:
PhoneGap has now been discontinued.
Original answer:
You could use PhoneGap.
http://phonegap.com/
http://docs.phonegap.com/en/2.1.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android
This has the benefit of being a cross-platform solution. Be warned though that you may need to pay subscription fees. The simplest solution is to just embed a WebView as detailed in #Enigma's answer.
You can use https://appery.io/
It is the same phonegap but in very convinient wrapper
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.
HI, i want to load a flash file in my android application. Can any one guide me how to do?
A flash file requires the Flash Player runtime to...well...run. The ability to run flash files is available to the Android platform in two forms.
As a plugin that renders Flash content in the native Android web browser(just like your browser on your desktop computer), or by utilizing the Android UI webView API and loading an HTML file with an embedded Flash file. In other words, create a webview in your Android application and load it with the remote or local URL of HTML file with the embedded flash content. Essentially you are putting a stripped down version of the Android browser into your application to render the Flash file.
Adobe AIR for Android. You could rewrite your Android application into a Flex Mobile Application, if your application relies heavily on Flash, and then run it directly as and AIR application and just us the AIR API's to load it.
A quick search on Google will show you code examples on how to write the HTML file to embed the Flash file, and it will tell you how to us the Android API webview to load said HTML file.
Good luck, let me know if you have any trouble.
You need Android 2.2 or later. It has built-in flash support.
If you are running Android 2.1 you just cant do it.
Flash is only available on Android 2.2, so you have to upgrade it first.