Giter Site home page Giter Site logo

purplemadcanada / wallpaper-phonegap-plugin Goto Github PK

View Code? Open in Web Editor NEW
18.0 6.0 13.0 236 KB

This plugin allows a user to save an image residing in the application folder or from a remote URL into the internal storage of the device. It also allows to set the image as a wallpaper which includes saving the image into the storage of the device.

License: Other

Java 82.41% JavaScript 17.59%

wallpaper-phonegap-plugin's Issues

Usage for cordova 3.3

Edit Wallpaper.js

cordova.define("ca.purplemad.wallpaper.wallpaper", function(require, wallpaper, module) {
var wallpaper = {
setImage: function(imagePath, imageTitle, folderName, successCallback, errorCallback) {
cordova.exec(
successCallback, // success callback function
errorCallback, // error callback function
'Wallpaper', // mapped to our native Java class called "Wallpaper"
'setwallpaper', // with this action name
[{ // and this array of custom arguments to create our entry
"imagePath": imagePath,
"imageTitle": imageTitle,
"folderName": folderName
}]
);

},
saveImage: function(imagePath, imageTitle, folderName, successCallback, errorCallback) {
    cordova.exec(
        successCallback,    // success callback function
        errorCallback,      // error callback function
        'Wallpaper',        // mapped to our native Java class called "Wallpaper"
        'savewallpaper',    // with this action name
        [{                  // and this array of custom arguments to create our entry
            "imagePath": imagePath,
            "imageTitle": imageTitle,
            "folderName": folderName
        }]
    );

}

};
module.exports = new wallpaper();
});

Basic operations, you'll want to copy-paste this for testing purposes:

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// prep some variables

// prep some variables
var imagePath = "http://demos.jquerymobile.com/1.4.0/_assets/img/jquery-logo.png"; // Mention the complete path to your image. If it contains under multiple folder then mention the path from level "www" to the level your image contains with its name including its extension.
var imageTitle = "gaga"; // Set title of your choice.
var folderName = "img"; // Set folder Name of your choice.
var success = function() { alert("Success"); }; // Do something on success return.
var error = function(message) { alert("Oopsie! " + message); }; // Do something on error return.

// For setting wallpaper & saving image
wallpaper.setImage(imagePath, imageTitle, folderName, success, error);

// For saving image
//wallpaper.saveImage(imagePath, imageTitle, folderName, success, error);
};

App gets freezed when downloading image.

Hello sir, your plugin works fine but with one problem. When ever i'm downloading an image from online using your plugin the app freezes untill the download completes.

If a user downloads a large image, the app freezes for 1 - 2 minutes and then again comes back to normal.

Any help will be greatly appreciated.
Thanks in advance..

used the code

yup i have used the code under usage section as well as i have used the .js file but its not working for me
android 4.0.4
thankyou

Setting wallpaper from outside app image

After downloading a image is saved into internal storage inside a folder. This folder is outside of the app. Is it possible to set that image as wallpaper with this plugin? If so what will be the imagePath?

Possibility to set Wallpaper from Album-Pictures

Is there a possibility to set a wallpaper to an image, that is located in one of the picture-albums on the smartphone. Or in any folder of the filesystem?

Or is it possible to set the wallpaper from a data-uri (base64)?

Android 4.1 fail

Cordova 3.4
Android 4.1 real device and emulator
Fail save external image and set as wallpaper.
Error can't find image in dir((
Android 2.3 and Android =>4.4 work very well!!!

lock screen

Hello!

I installed your plugin, it's so awesome.

But i wanna set the lockscreen wallpaper too.
Is There any way or solution to make it?

Kind regards,
David Póczik

Loading local images

The plugin works perfectly when trying to set images from an link or the image URL.
But when i try to load the same image from www/flower.jpg then it shows an error with Oopsie! www/flower.jpg

What is the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.