Camera.Parameters params = mCamera.getParameters();
Log.d(TAG, "Supported sizes:");
List<Camera.Size> sizes = params.getSupportedPictureSizes();
for (Camera.Size s : sizes) {
Log.d(TAG, String.format(" %s x %s", s.width, s.height));
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.geoloqi.android.sdk.util; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* A simple class for timing short lived events. | |
* | |
* @author Tristan Waddington | |
*/ | |
public class Timer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
A Geoloqi socket client demo. | |
:author: Tristan Waddington | |
""" | |
import sys | |
import time | |
import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.geoloqi.android.sdk.util; | |
import java.util.Random; | |
/** | |
* <p>This class will efficiently generate insecure random | |
* alpha-numeric Strings.</p> | |
* | |
* <p>Source largely based on | |
* <a href="http://stackoverflow.com/a/41156/772122">this example</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// List all security providers | |
for (Provider p : Security.getProviders()) { | |
Log.d(TAG, String.format("== %s ==", p.getName())); | |
for (Provider.Service s : p.getServices()) { | |
Log.d(TAG, String.format("- %s", s.getAlgorithm())); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in *.png ; do | |
mv "$i" "ic_menu_${i##*[0-9]_}"; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a thread pool | |
private ExecutorService mThreadPool = Executors.newSingleThreadExecutor(); | |
// Execute a new Runnable on a background Thread | |
Future f = pool.submit(new Runnable() { | |
public void run() { | |
while (true) { | |
// We're running! | |
Log.d(TAG, "."); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TypefaceTextView.java | |
* Simple | |
* | |
* Copyright 2012 Simple Finance Corporation (https://www.simple.com) | |
* | |
* 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 | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We imply that we expect a JSON response by using the SFJsonRequestHandler... | |
Future f = client.getPath("/foo/bar", new SFJsonRequesthandler() { | |
@Override | |
public void onStart() { | |
// Pass | |
} | |
@Override | |
public void onFinish() { | |
// Pass | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Instances of this class can be used to safely retain references to | |
* <code>View</code> objects. | |
* | |
* <p> | |
* Prior to Android 4.0 storing a <code>View</code> as a tag with the | |
* {@link View#setTag(int, Object)} method could <a | |
* href="http://code.google.com/p/android/issues/detail?id=18273">result in | |
* memory leaks</a>. Instead, the {@link View#setTag(Object)} method should be | |
* used with a <code>ViewHolder</code> instance as the object. |