Read video file with cordova in android - android

Currently I am working on an Ionic Cordova app which let an user upload vdo and image from android device. I finished working image upload with help of cordova camera plugin which can choose photo from user phone and return base64 data. Now i am trying to get video as i did for image. But the video return data is file url which is sth like this content://com.android.providers.media.documents/document/video%3A27227 . I don't know how to continue .
Appreciate your help

You can use that url and pass it to a fileHandler routine and read the contents of the video.
I will forewarn you that it gets very complicated with iOS and Android using different file url formats. And there's no consistency between various Android devices that I ended up using a 3rd party plugin from the Ionic market place which is worth every penny and saved me months of development time and aggravation.

Related

Save image from html to phone photo directory

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

How to clear temporary data (storage) inside of a cordova project?

I am using cordova 3.5 and eclipse to develop a mobile application. Inside of an image stream I am downloading 30 images through jquery append (url). The storage information are displayed in the following figure.
Anyone knows how to clear the "DATA" (19.41MB) category programmatically?
I have the same issue with IOS, when I try to follow apples data storage guidelines...
best
M

Test URL for simulating upload and download multimedia (like steaming media, video, images)

I am having an app requirements like whatsapp application. The thing is that webservices are not ready and it will take time. Meanwhile I want the test URL which use JSON format to upload and download the videos and images.
I know the sample URL's for JSON simulation
http://www.jsontest.com/
http://www.mocky.io/
For HTTP GET and POST simulation
http://httpbin.org/
Like this I want it for images and video in the form of JSON upload/download.
You don't need a webservice to test download from android, just a server container like tomcat installed on your computer and place files you want to download on tomcats directory.
But you will need one for uploading to receive (even if it does nothing).
You may use the following websites to download an image from
http://dummyimage.com/
Or this website
https://placehold.it/
You may also use the following website for video downloads
http://www.sample-videos.com/index.php#sample-mp4-video

phoneGap: select audio file from device and upload

I am new to phoneGap. I am creating a dummy app to upload an audio file from iOS/android device on local server. So I was wondering if there is a way to open the audio gallery and select the required audio file to upload. Similar to an image gallery.
Is it possible to open audio list and select necessary audio file? If not, what is the alternative?
As far as I remember, you cannot reach the pictures and audio files stored in the media gallery. Therefore, you may need to implement your own native plugin and call the appropriate methods from your JavaScript code.
You can capture audio/image by using Capture plugin of Phonegap. Check this out Capture Plugin
You can perform basic File operations as well. Check this out File Plugin
For your situation, you have to implement native interface which can be accessed by your JavaScript code. This would be an alternative way for it. If you desire to create your own plugin, please have a look at Plugin Development Guide. This might be helpful.
Well I have implemented code using file plugin which will iterate through all the folders recursively to find all the image (created this as I needed multi selection approach which is not directly provided by cordova) . You can modify the extension of image (search) i.e png,jpeg etc with audio extension.
With this code you will get the path of audio files and you can make use of filetransfer to upload it on server
Hope it helps you

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.

Categories

Resources