So, I wanted to display html pages on a WebView in my Xamarin.Forms app. The html pages contain numerous images which are locally stored (PersonalFolder on Android & iOS and WindowsStorage LocalFolder on UWP).
For Android it works very well (not tested on iOS yet) and I can display the images. However it doesn't seem to be working on UWP. After some research on multiple forums I concluded that the only way to display images on a WebView via html string is to convert the images to Base64 string.
And this actually works, but the process of reading the image from the disk and converting to Base64 takes a while than I would expect (even on a high-end PC).
The other option I had is to save the Base64 string in to my SQLite db, but here my concern is the db will grow drastically.
My images are dynamically downloaded from the web and can not be included in "Assets" folder as part of the project.
Can anyone help me understand, if these are the only ways? Any better alternatives? I wish I could display images on UWP just like I could on Android.
Related
Our Xamarin forms app supports both Android and IOS. This app uses a lot of png images on each and every screen.
We are looking for a better approach to deal with it. Whether to download a zip of png images and maintain them locally (or) download each png image on demand and cache it. It's ok if the application takes bit more time at the time of login. Could you please suggest.
I have only written PC programs using C#, .NET, and WinForms, and am new to app development.
I have written a program that uses HTML files (as a type of "form"), that will then be passed to an app, which can then be used to read/record data. I.e.
On the PC, a user creates a HTML "form"
This is loaded onto a mobile device (phone or tablet)
The user can then open the app, and access each individual (or individual copies) a HTML form to read/record data.
This is then transferred back to the PC, and stored.
Now, I'm not too concerned with the transfer between the PC/device, or the storage of the data, or any of that at this point. What I am concerned about is the ability to open/view these HTML files within a single app.
As the program has already been written using .NET and WinForms, it needs to be converted to be used on a mobile device, and I have chosen Xamarin for this purpose. However I only have limited knowledge of this package, so I am not sure if I can achieve this within a single app (i.e. without having to pass it to a separate app to view the HTML files).
So: is there an environment in Xamarin that I can use to view HTML files within my app?
Xamarin.Forms has a WebView class that you can use to display HTML content, so viewing the content is rarely an issue.
Interacting with the HTML content can sometimes be a bit tricky because of the links not conforming to what the app expects. But you can often solve these issues using the WebView.Navigating event handler that will allow you to catch and change the navigation behavior.
Xamarin.Forms's WebView relies on the native UIWebView (iOS) and WebView (Android) and Xamarin.Forms allows you to override the native Renderers. Overriding the native renderer will give you access to the native WebView with full flexibility.
You also have the possibility to completely ignore Xamarin.Forms's WebView and write your own view using native views.
It would probably be smart to test your WinForms app on iOS using Safari and on Android using Chrome as they are using the same rendering engines that will be used in respectively UIWebView (iOS) and WebView (Android)
Website working fine in all browsers, but the issue is, it is loading webpage in mobile devices but with question mark in all images of the page. is it the problem with image size? if so, then what is the mobile image size need to be set?
It's like you've encountered BOM, you can see here to solve it: http://www.w3.org/International/questions/qa-byte-order-mark
The themes takes default mobile theme.. The new image property is created for that and re generated the thumbnails. It displays the images now in the mobile version...
I am an author of short stories. I like using google docs and I like the idea of when I update a story these changes propagate to the sites I publish on. This system works fine in the latter versions of chrome and IE. http://plumplucker.com/
This doesn't work in IOS and only when using Opera on android - At present I need to create PDFs to work on an iPhone or an iPad which defeats my purpose of instant updating.
But right now I am trying to get Firefox to display the contents of the embeded iFrames, but FF 9.01 only shows the outline of the iframe containing a blank page. This is btw how ios displays the same page.
Here is my test page http://plumplucker.com/test3.html
In FF this page will load an iframe of my site, but it will not display the stories. I also tried having docs on google apps in case that would act differently - but no difference.
I have tried
Any one have a clue?
Just wanted to say that I have given up on inserting google doc iframes into my webpages hoping that they will render correctly on all platforms and browsers. That proved to be wishful thinking.
Instead I have constructed an app that builds static pages from the Google doc url's. First I let this happen on the fly every time a user selected a story for viewing, but there was quite a lag with this method and with afterthought I saw no reason not to create static pages. This I do for all my texts even if I have only changed a few details in one of them. I publish PDSs at the same time with TCPDF.
i have develop a Jquerymobile applicataion in MVC3(Razor) it is working fine in mobile devices and desctop.Now i want create image gallery in this app that is when i open the app in Iphone then i get the images from Iphone gallery for uploading..Please help me how can i get all images gallery in Iphone..
a google [ other search engines available ] search for html image gallery, jquery gallery etc should yeild quite good results for displaying a gallery. however if you want the photo from the phone itself then you need something like phonegap and create an application for a phone so that you can access the phone itself.
there is no way for a website to access iphones files, hence the reason why upload boxes are disabled when you visit websites.
the other options is to hook through facebook and allow users to pick a photo from the ONLINE content, that can then be passed over, however this is theory and you need to actually create something, anything and then maybe get guidance when you are stuck, or have problems.