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

2 posts, 0 answers
  1. Aravind
    Aravind avatar
    15 posts
    Member since:
    Oct 2014

    Posted 30 Nov 2014 Link to this post

     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'  />

    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 ?

  2. Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 03 Dec 2014 Link to this post

    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. 

    Tina Stancheva

    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.

Back to Top