Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Json Output from PHP

Dani Mahardhika edited this page Jul 5, 2017 · 2 revisions

With release 1.3.0 and above, Wallpaper Board supports json output from php.

How to configure it?

  1. Make sure to learn about dashboard configuration. Open WallpaperBoard.java inside apps\java\com.yourpackagename\applications\.
  2. Use setJsonStructure() from Configuration.

Here an example

import com.dm.wallpaper.board.utils.JsonStructure;

public class WallpaperBoard extends WallpaperBoardApplication {

    @Override
    public void onCreate() {
        Configuration configuration = new Configuration();
        
        configuration.setJsonStructure(
                new JsonStructure.Builder()
                        .jsonOutputUrl("https://www.mywebsite.com/wallpapers.php")
                    /* If you need to post some values, it's possible too */
                        .jsonOutputPost("tag", "value")
                        .jsonOutputPost("anotherTag", "anotherValue")
                        ...
                        .build());
        
        initApplication(configuration);
    }
}