Skip to content

Instantly share code, notes, and snippets.

View Farbklex's full-sized avatar

Alexander Hoffmann Farbklex

View GitHub Profile
@Farbklex
Farbklex / Player.log
Created October 20, 2023 15:38
Log file for Secret Shuffle game
Mono path[0] = 'F:/Libraries/steamapps/common/Secret Shuffle/Secret Shuffle_Data/Managed'
Mono config path = 'F:/Libraries/steamapps/common/Secret Shuffle/MonoBleedingEdge/etc'
Initialize engine version: 2022.3.5f1 (9674261d40ee)
[Subsystems] Discovering subsystems at path F:/Libraries/steamapps/common/Secret Shuffle/Secret Shuffle_Data/UnitySubsystems
GfxDevice: creating device client; threaded=1; jobified=0
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: NVIDIA GeForce RTX 3060 Ti (ID=0x2486)
Vendor: NVIDIA
VRAM: 8038 MB
@Farbklex
Farbklex / README.md
Last active August 5, 2023 05:34
Android: Create a signed universal APK with all dynamic feature modules included with gradle wrapper via commandline

Android Studio doesn't automatically include dynamic feature modules when building signed release APKs. But universal APKs can be created via the bundletool and signed later.

The gradle wrapper has a task for this already. This makes creating universal APKs easier since APK creation and signing are executed with one command and no separate download of bundletool is required.

You can use packageReleaseUniversalApk with the name of your base application module (e.g.: app) to create a universal APK:

./gradlew :app:packageReleaseUniversalApk

This will however only create an unsigned APK unless you specify the signing informations in your gradle file or pass the information through the command line as shown below.

@Farbklex
Farbklex / ConnectivityChecker.kt
Created February 18, 2020 13:27
Android: Check if the device has internet access on devices with API level >= 23.
package me.a_hoffmann.gists
import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkCapabilities
/**
* Checks if the device has an internet connection.
* NOTE: Works only on android API level 23 and above!
*/
@Farbklex
Farbklex / ConvertIntToByteArray.kt
Last active February 18, 2020 15:00
Convert an Int to an array or list of Byte with a fixed length (int to byteArray with padding). Useful when a protocol requires you to allocate multiple bytes for one value but you don't need all of them to represent it.
// Convert size int to a list of bytes
val intValue: Int = 4
val intAsBytes = ByteBuffer.allocate(4).putInt(size).array().toList()
@Farbklex
Farbklex / FlashingAnimator.kt
Created January 28, 2020 09:36
Simple "flashing" animation for an android view
package me.a_hoffmann.gists
import android.animation.ValueAnimator
import android.view.View
object FlashingAnimator {
const val ANIMATION_DURATION: Long = 800
/**
* Executes a "flashing" animation on a view
@Farbklex
Farbklex / CustomArrayAdapter.kt
Created January 22, 2020 14:14
Custom ArrayAdapter for Spinner Views in Android
package me.a_hoffmann.exampleapp
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.TextView
import me.a_hoffmann.exampleapp.R