All Projects → vasani-arpit → cordova-plugin-downloadmanager

vasani-arpit / cordova-plugin-downloadmanager

Licence: other
A Cordova plugin to download file in system's default download manager

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cordova-plugin-downloadmanager

cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (-48.89%)
Mutual labels:  cordova, phonegap, cordova-plugin, phonegap-plugin
cordova-swift3-plugin-example
Swift 3 Cordova plugin example to support blog post.
Stars: ✭ 23 (-48.89%)
Mutual labels:  cordova, phonegap, cordova-plugin, phonegap-plugin
Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-62.22%)
Mutual labels:  cordova, phonegap, cordova-plugin
cordova-plugin-example
Example Cordova plugin for iOS and Android to support blog post.
Stars: ✭ 15 (-66.67%)
Mutual labels:  phonegap, cordova-plugin, phonegap-plugin
cordova-plugin-zeep
Zip compression/decompression for the cordova/phonegap platform
Stars: ✭ 27 (-40%)
Mutual labels:  cordova, phonegap, cordova-plugin
cordova-plugin-dbcopy
Copy SQLite Database from www folder to default app database location
Stars: ✭ 90 (+100%)
Mutual labels:  cordova, cordova-plugin, phonegap-plugin
ionic-native-sms-retriever-plugin-master
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
Stars: ✭ 16 (-64.44%)
Mutual labels:  cordova, cordova-plugin, phonegap-plugin
Cordova Admob Pro
🔥 Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.
Stars: ✭ 690 (+1433.33%)
Mutual labels:  cordova, phonegap, cordova-plugin
Blinkid Cordova
ID scanning for cross-platform apps built with Cordova and Phonegap.
Stars: ✭ 44 (-2.22%)
Mutual labels:  cordova, phonegap, cordova-plugin
cordova-study
📱 Cordova学习记录,Cordova插件的使用,热更新、media、device、集成x5内核等等。
Stars: ✭ 19 (-57.78%)
Mutual labels:  cordova, cordova-plugin
Cordova Ionic Phonegap Branch Deep Linking Attribution
The Branch Cordova Ionic Phonegap SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
Stars: ✭ 228 (+406.67%)
Mutual labels:  cordova, phonegap
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (+424.44%)
Mutual labels:  cordova, cordova-plugin
Onesignal Cordova Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Stars: ✭ 214 (+375.56%)
Mutual labels:  cordova, phonegap
Cordova Plugin Touch Id
💅 👱‍♂️ Forget passwords, use a fingerprint scanner!
Stars: ✭ 209 (+364.44%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Audioinput
This iOS/Android Cordova/PhoneGap plugin enables audio capture from the device microphone, by in near real-time forwarding audio to the web layer of your application. A typical usage scenario for this plugin would be to use the captured audio as source for a web audio node chain, where it then can be analyzed, manipulated and/or played.
Stars: ✭ 137 (+204.44%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-android-window-background
Simple Cordova plugin to set Android window background on start-up 🎨 🍭
Stars: ✭ 15 (-66.67%)
Mutual labels:  cordova, cordova-plugin
JiaCordova
在Cordova及插件的基础上封装一些常用的功能,不断更新中
Stars: ✭ 35 (-22.22%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Googlemaps
Google Maps plugin for Cordova
Stars: ✭ 1,647 (+3560%)
Mutual labels:  cordova, phonegap
cordova-fonts
Cordova plugin for enumerating fonts on a mobile device
Stars: ✭ 14 (-68.89%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-1password
Plugin for adding 1Password App Extension into Cordova/PhoneGap Apps
Stars: ✭ 12 (-73.33%)
Mutual labels:  cordova, phonegap

cordova-plugin-downloadmanager

A Cordova plugin to download file in system's default download manager

Supported Platforms

  • Android (SDK >= 11)

Installation

cordova plugin add https://github.com/vasani-arpit/cordova-plugin-downloadmanager

How to Use

//after device is ready
var fail = function (message) {    
   alert(message)
}
var success = function (data) {
       console.log("succes");
}
cordova.plugins.DownloadManager.download("Your URL to download", "Your file name","Your Description" ,success, fail);
var options = {
  setDestinationInExternalPublicDir: true  // set true if you want to use public dir instead of files dir
}
cordova.plugins.DownloadManager.download("Your URL to download", "Your file name","Your Description" ,success, fail, options)

To add an already downloaded file to the Downloads database.

// Full absolute path the the already downloaded file.  It should be in file:///storage/emulated/0/Download/ or subfolder.
const filepath_sanitized = filepath.replace("file://", "");  // Note: Don't include any file:// prefix in the path.

/**
 * Method that calls the addCompletedDownload method on the DownloadManager object
 * @param {string} title Must match the filename which was written.
 * @param {string} description doesn't seem used?
 * @param {string} mimeType i.e. "text/plain"
 * @param {string} path Absolute file path. Note: Don't include any file:// prefix in the path.
 * @param {number} length size of the downloaded file
 * @param {function(string)} success callback
 * @param {function(string)} error callback
 */
cordova.plugins.DownloadManager.addCompletedDownload(filename, "Your Description", 'text/*', filepath_sanitized, length,
  (result) => {
    console.info(result);
  },
  (err) => {
    console.error(err);
  })

Result

screenshot

If this plugin helps your project then don't forget to star the repo.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].