Get a libGDX-powered Android live wallpaper up and running quickly with this project template

Overview

This project is a libGDX Android live wallpaper template. It's the demo application created by the libGDX code generator, remade as a live wallpaper.

This is a heavy refactor of the generated project. Here are the differences:

  • The launcher has been removed, as live wallpapers don't have launchers
  • The 'core' module has been removed. It isn't needed for live wallpapers because they aren't games - you won't be targeting multiple platforms.
  • The directory structure, build scripts and related project files have been refactored to represent a standard Android Kotlin project
  • This project includes a copy of the unit test templates provided by the standard Android project template

Local Setup

  • Install the Android SDK version found at android/build.gradle buildToolsVersion.
  • If Android Studio doesn't create a local.properties in the root directory, create one. Define a sdk.dir property that contains the full path to the Android SDK.

Avoiding Pitfalls

Version Conflicts

There's a delicate balance between:

  1. The libGDX version
  2. The Android API version
  3. The Android SDK version
  4. The com.android.tools.build:gradle version

LibGDX lags behind the latest Android API and SDK versions. Their code generator creates a project with the officially supported versions, but allows you to use later versions after clicking through a warning. The SDK version influences the com.android.tools.build:gradle version as well.

If you want to use AndroidX (which this project does), that's another complication to deal with, as it has its own minimum API version.

The whole situation is a big, tangled mess of conflicting requirements. This project deviates from the officially supported libGDX configuration, but I haven't noticed any ill effects. I make no guarantees.

When a new version of any of these things is released, you may be tempted to upgrade. Since the libGDX project doesn't list supported configurations on their site, the only way I know to get this information is to download their code generator and see what the current version spits out.

Common Issues

Could not identify launch activity

When deploying/running/debugging the application for the first time, Android Studio might report an error in the console:

04/03 11:29:34: Launching 'android' on Pixel 4a API 31.
Install successfully finished in 6 s 770 ms.
Could not identify launch activity: Default Activity not found
Error while Launching activity
Failed to launch an application on all devices

This is from a bad Run/Debug configuration, not your project.

  1. Go to Run -> Edit Configurations -> [your app] -> Launch Options
  2. Change the Launch dropdown menu from Default Activity to Nothing.

(Live wallapers don't have default activities. They're launched from the wallpaper picker).

You might also like...
A lightweight, feature-rich wrapper for the Telegram Bot API, providing a handy Kotlin DSL to quickly build your bot.

Kotlin Telegram Bot Kotlin based wrapper over Telegram API. Current version of the Telegram Api: 6.0 Principles Annotations Magic. The basic interacti

Wallum is a superfast ⚡ lightweight wallpaper app, built using Kotlin, Retrofit, MVVM, Paging 3, Hilt, and Navigation Components
Wallum is a superfast ⚡ lightweight wallpaper app, built using Kotlin, Retrofit, MVVM, Paging 3, Hilt, and Navigation Components

Show some ❤️ and star the repo to show support for the project Wallum Android App Wallum is a super-fast 🚀 , lightweight wallpaper app built purely w

WhatsaApp Clone - A Wallpaper and ringtone Application Built With Kotlin
WhatsaApp Clone - A Wallpaper and ringtone Application Built With Kotlin

Wallpaper WhatsAppCLone is a Clone of WhatsApp Messaging App.It allows users to

Android app that show the palette of material theme based on your wallpaper
Android app that show the palette of material theme based on your wallpaper

Material-You-Palette Android app that show the palette of material theme based on your wallpaper Show color blocks and names in on color Few Samples W

Identification of android devices using wallpaper image
Identification of android devices using wallpaper image

WallpaperID The source code of the demo application that calculates an ID for a device using wallpaper images. The ID is scoped to a device and will b

A wallpaper app for Android.
A wallpaper app for Android.

Chignon Mignon Wallpapers Browse the ever-growing collection of wallpaper designs to match the patterns of your favorite bags. This simple Android app

Wallpaper app made using Hilt, Retrofit, Room, Navigation Components, MVI, Coroutines, Flows, ViewModel, LiveData, Datastore Preference.
Wallpaper app made using Hilt, Retrofit, Room, Navigation Components, MVI, Coroutines, Flows, ViewModel, LiveData, Datastore Preference.

Android Picture Engine Wallpaper app made using Hilt, Retrofit, Room, Navigation Components, MVI, Coroutines, Flows, ViewModel, LiveData, Datastore Pr

Find your new favorite wallpaper that looks just like you 🖌️
Find your new favorite wallpaper that looks just like you 🖌️

Wollpaper Find your new favorite wallpaper that looks just like you. Builds The pre-built app can be downloaded under "releases" on the right side of

A wallpaper app Built with MVVM clean architecture using pixabay api
A wallpaper app Built with MVVM clean architecture using pixabay api

wallpaper get your API key at pixabay in order to test the APP! This project demonstrates the use of jetpack compose and modularization. it is complet

Comments
  • Question: is it possible to use this for showing a video, too?

    Question: is it possible to use this for showing a video, too?

    I've noticed this sample too, of showing a video using LibGdx: https://github.com/libgdx/gdx-video

    It doesn't seem to "fit" what's shown there, meaning that here it has a function of "render" that needs to be called all the time. Yet there it's quite automatic, as it binds to the MediaPlayer, and seem to use a different function, of "update" instead, probably to prepare the next frame.

    Is there really a way to use LibGdx to show a video on a live wallpaper? Could I also make it translate (move) horizontally, as you scroll (using offsetChange), and scale it accordingly to have something like scale-crop of images on Android?

    opened by AndroidDeveloperLB 3
Owner
Kurtis LoVerde
Kurtis LoVerde
Wallpaper and ringtone Application which allows user to set and download Wallpaper or ringtone

Wallpaper Wallpaper is a Wallpaper and ringtone Application which allows user to

Shubhanshu Sharma 2 Dec 19, 2021
Wallpaper Battle A combined online and local HD wallpaper file manager

Resplash Resplash is powered by Unsplash.com The internet’s source of freely-usable images. Powered by creators everywhere. Browse 1M+ high-res photos

null 1 Oct 19, 2021
A Jetpack Compose-based app to exhibit all the beautiful GLSL Fragment shaders I have ever written, where you can set them as Live Wallpaper.

?? Shader Showcase Shader Showcase is a minimal Android app made with Jetpack Compose, to showcase all the beautiful OpenGL* based Fragment shaders I

Piyush Pradeepkumar 198 Dec 28, 2022
Wallpaper4kapp - Wallpaper app get photo using Api From pexels

wallpaper4kapp this is wallpaper app , get photo using Api From https://api.pexe

Hazem Allaham 2 May 28, 2022
Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

freegemas-gdx Freegemas libGDX is an Android, HTML 5 and Java desktop port of Freegemas, which in turn is an open source version of the well known Bej

David Saltares 144 Jun 21, 2022
Freegemas libGDX is an Android and Java desktop port of Freegemas, which in turn is an open source version of the well known Bejeweled.

freegemas-gdx Freegemas libGDX is an Android, HTML 5 and Java desktop port of Freegemas, which in turn is an open source version of the well known Bej

David Saltares 144 Jun 21, 2022
A small RPG example for a YouTube tutorial series using Kotlin, LibGDX, LibKTX and GDX-AI.

Mystic Woods A libGDX project generated with gdx-liftoff. This project was generated with a Kotlin project template that includes Kotlin application l

Simon 15 Dec 19, 2022
Abel Suviri 6 Dec 16, 2022
Pass parameters safely and quickly between activities or fragments.

Bracer Pass parameters safely and quickly between activities or fragments. Read this in other languages: 中文, English, Change Log Prepare Add the JitPa

Season 57 Jan 3, 2023