Skip to content

Instantly share code, notes, and snippets.

View jayrambhia's full-sized avatar

Jay Rambhia jayrambhia

View GitHub Profile
@jayrambhia
jayrambhia / MainActivity.java
Last active August 29, 2015 14:18
EventBus Demo
public class MainActivity extends ActionBarActivity {
private EventBus eventBus;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
eventBus = EventBus.getDefault();
package com.fenchtose.checklistdemo;
import com.fenchtose.checklistdemo.views.CheckListItemView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
@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) {
@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;
/*
* 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
<?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.
@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;
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() {
<?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 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;