Skip to content

Instantly share code, notes, and snippets.

@fdoyle
fdoyle / CameraManager.java
Last active May 30, 2016 17:55
This is a stripped down version of the CameraManager class used in the Android stock camera
package com.wta.videodemo;
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@ktuite
ktuite / UniqueId.java
Created December 3, 2012 03:08
Generating and storing a random, unique user id to track unique installations of an android app.
// adaptation of: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html
// but using shared preferences instead of a file: http://developer.android.com/reference/android/content/SharedPreferences.html
// here's a better look at using shared preferences: http://developer.android.com/guide/topics/data/data-storage.html#pref
public class UniqueId {
private static String sID = null;
private static final String SHARED_PREF_KEY = "SKETCHABIT2";
private static final String ID_KEY = "id";
@mbinna
mbinna / include-version-info.sh
Last active November 12, 2021 20:59
Include Version Info from Git into Info.plist at build time
Add the script include-version-info.sh into a new run script build phase of your application target. The build phase
should be located after the build phase "Copy Bundle Resources".
@pete911
pete911 / input stream to string
Created February 9, 2012 10:27
java - input stream to string (one liner)
return new Scanner(is).useDelimiter("\\A").next();