Skip to content

Instantly share code, notes, and snippets.

@sankarganesh
sankarganesh / main.xml
Created August 30, 2013 13:17
UI design for Alarm Setter
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
@sankarganesh
sankarganesh / AlarmSetter
Created August 30, 2013 13:17
Alarm Setter Class
package com.san.samples;
import java.util.Calendar;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
package com.example.obddemo;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.bluetooth.BluetoothSocket;
/**
* Provides the Main Activity class and Bluetooth Socket Listener class
* <p>
* The Main Activity class deals with establishing the connection with OBDII
*
*
*/
package com.example.obddemo;
@sankarganesh
sankarganesh / gist:2407640
Created April 17, 2012 17:28
Travese the child values according to Parent
/* In forward Navigation , index is a variable and automatically incremented when you swipes it , pos_po it is a position pointer variable , which says you have to pick first child or second child
*/
Class Helper{
public static int temp_child =0,temp_parent=0;
/*
@sankarganesh
sankarganesh / gist:2285701
Created April 2, 2012 17:55
Base Adpater
class MyGridAdapter extends BaseAdapter{
int temp_position=0,temp_count=0;
public int getCount() {
// TODO Auto-generated method stub
return page_no.size();
}
This is My code to publish checkin
public String APP_ID="101782413241377";
Facebook authenticatedFacebook = new Facebook(APP_ID);
AsyncFacebookRunner fbinvoker=new AsyncFacebookRunner(authenticatedFacebook);
Bundle params = new Bundle();
params.putByteArray("access_token",Main.access.getBytes());
params.putByteArray("message", "Hi".getBytes());
params.putByteArray("place", Main.place_id.getBytes());
JSONObject jo = new JSONObject();