Save image from html to phone photo directory - android

I have the below tag in my website for downloading image
<a href="data:image/png;base64,%20iVBOdfd...." download="myimage.png" />
The above tag is working normally, when it is pressed, it will download the image without any issue.
When I tried this function on ios / android, the web browser will download the image to some "Download" folder instead of writing it to camera roll (IOS) / DCIM (android).
My question is, is it possible to write to camera roll or DCIM? If it is possible, how can I achieve it? This function is crucial to my application as my users always find it hard to navigate on phone to retrieve the downloaded images at later time.
P.S: My concern is more about the writing destination, filesystem access on phone, not the download itself.
P.S: this is a normal website written using html, vuejs. not native, not react native, not vue-native.
Thank you.

That is not possible since it is the web browser who has access to the device and your web application cannot decide where to save the image. You'll need to implement an app to achieve the expected result. Also study Progressive Web Apps to see whether it's possible

Related

Android HTML form in local

I have to develop a user registration form that is going to run on an Android tablet locally, without internet connection.
The idea I have is to make the submit using Javascript and store the user data in a .CSV file.
The page that show the form will be opened with Chrome or Safari, that is, in a web browser.
Is it possible to do this on an Android tablet? What would be the procedure?
I think that programming the form and then putting it in some internal folder will be enough and then open the index.html file with the browser.
Any advice or suggestion?
Thank you very much.

Mobile Application based on the website

Im new with Android. My task is to create a mobile application based on a responsive WordPress website. I would like to be able to download some of the content of this site. Website uses HTTPS. In the first, most primitive version, I tried to use WebView. I wanted to use the following: WebView load website when online, load local file when offline. Unfortunately, only the white page appeared and nothing more. In the case of "Google.com link" a page has been loaded in an external browser (Oreo Android).
Any suggestion how should I start? The easiest way would be to download an HTML page or have access to files on the server. Unfortunately, I do not have that access.
As always -1 without even trying to help....
As I said load from cache when Internet is disabled not working. Work only WebView (without login, because CORS). So how should I face it?

Display a pdf that is loaded via webview (android)

I'm looking for a way to display a pdf that is loaded in a webview.
The case is as follows:
- We load a (external) web application inside a webview.
- The web application is secured, users have to login to access their data.
- When the user has logged in there is a button for downloading a pdf file.
- On iOS the pdf file is being displayed inside the webview, on Android it isn't.
- It is not possible to access the pdf by using a webservice instead of the webview (so, Titanium.Network.HTTPClient cannot be used)
We tried several solutions that we found on the internet. Unfortunately, till now without any success.
We tried:
- Google's documentviewer: http://docs.google.com/viewer?embedded=true&url=. This is not working because the pdf is 'behind' a username/password. Google is not aware of the session.
- Saving the pdf to the local file system and open it with Android Intent. We did not succeed in saving the pdf on the local filesystem.
The last option (saving the pdf and open it by using Ti.Android.Intent) seems to be the best option. But is it possible to save a pdf from a webview???
Maybe an external module (or using pdf.js) is also an option.
Can someone point me in the right direction.
We even don't know if what we want is possible?
Any help is really appreciated.
Stefan.

how can i manage phonegap android online app

i'm beginner developer of phonegap android application developer. i'm in confusion. i want to make a photo gallery that work online(with internet). 1st: how can i embed my photo gallery with the application. 2nd: if user connection lost during checking photos there is not show the my app url (could not find URL http://www.domain.com/app/index.php) after connection lost it will go to on default error page of no internet connection.
my online application is in php how can i iframe that app in my native application.
phonegap android application developer help me. i'm very thankful to you for this.
Phonegap is not really a way to embed a full application inside an app. The app itself is its own website (sort of).
Your best direction is to create a PHP page on your sever that outputs an XML or JSON file of the images you are going to show THEN create a custom application using HTML / Javascript that pulls in the XML/JSON and parses it into your app. For best practise you should cache or store said files locally for when the device isn't connected to the network.

Saving webpage in cache using webview in android

I am working on an application where I load few websites in webview now I want to save webpages so after sometime even if there is not internet user will able to see those pages. But I am confused on how to save whole webpage in cache or any other medium. The main thing is we need to show pages back even if there is not internet.
Has anyone implemented this before. Please provide some demo code as this is my first attempt on cache..
Thank You
The easiest way is save webpages in cache directory or any other(Internal or external storage)
You can get the data of web page using HttpClient.execute() or HttpClient.get() now store that data in .html file also you have to download images or other contents which are bind to that page, Now in your application you have to check for connection if connection not available then load the page which one you saved in storage with file://<location of your webpage..>
EDIT:
I think using HTML5 you can display off-line webpages. (I never tried this, but I referred some blogs on it). Look at this nice post about HTML5 Creating mobile Web applications with HTML 5, Part 3: Make mobile Web applications work offline with HTML 5 Also this
hope this will help you.

Categories

Resources