This is a migrated thread and some comments may be shown as answers.

How to download and store file form sql server into mobile device ?

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aravind
Top achievements
Rank 1
Aravind asked on 30 Nov 2014, 04:30 PM
Hi
 We develop mobile application,in that need to play audio and video file using html 5 tag,if we specify html 5 tag in following way it work,in below first saved file manually in mobile device in external sd card contain mobile_Dev folder,inside folder i save mp4 file,And in mobile application i specify src to file path and deploy in mobile device it work.
<video id="video" width="320" height="240" controls>
   <source src="/ext_card/mobile_Dev/Obi Wan.mp4" type='video/mp4'  />
</video>

So i need to dynamically save file form sql server inside mobile device in same folder path and pass to file name for video tag,we are use web service that deploy in one server.So first download and save file inside main server and pass that file path to mobile device for download file inside mobile device specific folder and then pass file path to html 5 tag ?

Regards
 Aravind

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 03 Dec 2014, 06:19 PM
Hi Aravind,

I am not sure how your files are stored in the SQL database, but if you have a url to each video file stored on your server, then you can use the FileTransfer API to download the files locally on your device. You can have a look at the FileTransfer sample project to get started. The sample demonstrates how to download an image file and then display it in an img tag. You should be able to use the very same approach in your application to download and then display a video in the video tag.

You would only have to keep in mind that the AppBuilder device simulator doesn't support the video and audio html5 tags and you will not be able to see the video playing in the simulator. Also, please make sure to enable Hardware Acceleration in the Android project properties to enable the video run as expected on Android devices. 

Regards,
Tina Stancheva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Aravind
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or