Skip to content

Instantly share code, notes, and snippets.

public class ClientActivity extends Activity {
private String SERVICE_NAME = "Client Device";
private String SERVICE_TYPE = "_http._tcp.";
private InetAddress hostAddress;
private int hostPort;
private NsdManager mNsdManager;
@Override
public class QueryObject {
private String queryTtile;
private String queryAlbum;
private String queryArtist;
private String queryDuration;
private String filepath;
private String _id;
public QueryObject(Cursor cursor) {
public class PlayList extends ArrayAdapter<AudioObject> {
private int layoutResource;
private LayoutInflater inflater;
private final Context context;
public PlayList(Context con, int resource) {
super(con, resource);
layoutResource = resource;
context = con;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="60dp"
android:weightSum="3"
android:background="@color/orange_color_1"
android:orientation="horizontal">
<ImageView
android:layout_width="0dp"
public class SignUpActivity extends Activity {
private String nameString;
private String emailString;
private String fbID;
// some stuff
// onCreate, onPause, set layout, create buttons, etc
private void signUpUsingFacebook() {
Toast.makeText(this, "Connecting to facebook", Toast.LENGTH_LONG).show();
Session.openActiveSession(this, true, Arrays.asList("email", "user_birthday"), new Session.StatusCallback() {
@jayrambhia
jayrambhia / PlayListObject.java
Last active June 17, 2016 04:08
Inbox style Swipe ListView
public class PlayListObject extends ArrayAdapter<AudioObject> {
private int layoutResource;
private LayoutInflater inflater;
private float density = 2f;
private ListView listView;
public SPlayerPlayListObject(Context con, int resource) {
super(con, resource);
layoutResource = resource;
<?php
require './inc/aws.phar';
use Aws\Ses\SesClient;
/**
* SESUtils is a tool to make it easier to work with Amazon Simple Email Service
* Features:
* A client to prepare emails for use with sending attachments or not
*
* There is no warranty - use this code at your own risk.
/*
* Copyright (C) 2014 Chris Banes
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@jayrambhia
jayrambhia / ReceiverService.java
Last active August 29, 2015 14:16
AMQP chat/message server and client
package com.fenchtose.amqptest;
import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.util.Log;
@jayrambhia
jayrambhia / ButtonObservable.java
Last active October 25, 2017 03:30
Multiple button clicks using RxAndroid
public void setClickObservable(final Button button) {
Subscription subscription = Observable.create(new Observable.OnSubscribe<Integer>() {
@Override
public void call(final Subscriber<? super Integer> subscriber) {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {