Skip to content

Instantly share code, notes, and snippets.

View frankkienl's full-sized avatar
🤖
making Android apps

Frank Bouwens frankkienl

🤖
making Android apps
View GitHub Profile
@iamcalledrob
iamcalledrob / CaptureComposable.kt
Last active April 6, 2025 20:32
Android headless composable capture
import android.app.Presentation
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Picture
import android.graphics.SurfaceTexture
import android.hardware.display.DisplayManager
import android.view.Display
import android.view.Surface
import android.view.ViewGroup
import androidx.compose.foundation.layout.Box
@hvisser
hvisser / DemoModeEnabler.kt
Created January 23, 2018 11:44
Enables demo mode on a device for the purpose of taking screenshots
class DemoModeEnabler {
fun enable() {
executeShellCommand("settings put global sysui_demo_allowed 1")
sendCommand("exit")
sendCommand("enter")
sendCommand("notifications", "visible" to "false")
sendCommand("network", "wifi" to "hide")
sendCommand("battery", "level" to "100", "plugged" to "false")
sendCommand("clock", "hhmm" to "1000")
@stkent
stkent / android-bluetooth-low-energy-resources.md
Last active August 1, 2024 08:47
Android Bluetooth Low Energy (BLE) Resources
@branflake2267
branflake2267 / stful-page.liveTemplate
Last active February 11, 2025 10:08
Flutter - Basic Routing to Pages YouTube source code - This is the IntelliJ IDEA live template for a stateful widget for a page.
class $NAME$ extends StatefulWidget {
$NAME$({Key key, this.title}) : super(key: key);
static const String routeName = "/$NAME$";
final String title;
@override
_$NAME$State createState() => new _$NAME$State();
}
@sim642
sim642 / DI.m3u
Created July 5, 2015 12:52
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
@gillesdemey
gillesdemey / querystring.swift
Last active March 24, 2021 10:53
Retrieve specific query string parameter from NSURL
func getQueryStringParameter(url: String, param: String) -> String? {
let url = NSURLComponents(string: url)!
return
(url.queryItems? as [NSURLQueryItem])
.filter({ (item) in item.name == param }).first?
.value()
}
@commonsguy
commonsguy / gif2animdraw
Last active May 1, 2023 14:26
Ruby script to convert animated GIF into an Android AnimationDrawable
#!/usr/bin/ruby
require 'fileutils'
require 'RMagick'
require 'slop'
require 'builder'
opts = Slop.new do
banner "gif2animdraw [options]\n"
on :i, :input=, 'path to animated GIF (or directory of GIFs)', :required => true
on :o, :outdir=, 'path to root output directory', :required => true
@frankkienl
frankkienl / DiscoverTest.java
Last active December 19, 2015 13:49
How to start the OUYA Discover and OldDiscover.
/**
* This is how we can start OldDiscoverActivity
* This is possible because OldDiscoverActivity has an Intent-Filter in the AndroidManifest.XML
*/
Intent i = new Intent();
//i.setClassName("tv.ouya.console", "tv.ouya.console.launcher.store.adapter.DiscoverActivity");
i.setClassName("tv.ouya.console", "tv.ouya.console.launcher.store.OldDiscoverActivity");
try {
startActivity(i);
} catch (Exception e) {
@devunwired
devunwired / GifDecoder.java
Last active October 8, 2024 08:32
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions: