Skip to content

Instantly share code, notes, and snippets.

@lnanek
lnanek / profile client
Created April 2, 2013 19:13
Using notifications with the HTC BLE SDK
@Override
public void onDeviceConnected(BluetoothDevice device) {
mService.registerForNotification(device, 0, new BleGattID("00002a37-0000-1000-8000-00805f9b34fb"));
// Note that the super class will call refresh.
super.onDeviceConnected(device);
}
@Override
public void onRefreshed(final BluetoothDevice aDevice) {
super.onRefreshed(aDevice);
@lnanek
lnanek / gist:3856690
Created October 9, 2012 04:54
Calling Foursquare venue API
Log.i(LOG_TAG, "Performing logged in venue search.");
venueExploreResults = mFoursquare.get(
"venues/explore",
"ll", mLat + "," + mLon,
"categoryId", "4d4b7105d754a06374d81259,4d4b7104d754a06370d81259,4d4b7105d754a06377d81259,4d4b7105d754a06376d81259",
"v", "20121008",
"venuePhotos", "1"
);
@lnanek
lnanek / gist:3856681
Created October 9, 2012 04:50
Example of logging into Foursquare
public class ShowRecommendations extends VenueListingActivity implements
LocationLookupCall.OnLocationLookupListener, OnExploreListener {
public void onLoginClicked() {
foursquare.showAuthorization()
// Refresh results if the user logged in.
.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (foursquare.isAuthorized()) {
<!DOCTYPE html>
<html>
<head>
<style>
/* doesn't work */
img, canvas {
image-rendering: optimizeQuality;
}
canvas {