Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;

import android.content.SharedPreferences;

public class Main {
    public static final String FB_VARIABLES = "fbvariables";
    public static final String FB_ID = "id";
    private static final String FB_NAME = "name";
    private static final String IS_FIRST_TIME = "firsttime";

    public static void setFbDetails(Context context, String fb_id, String fb_name) {
        SharedPreferences fbInfo = context.getSharedPreferences(FB_VARIABLES, 0);
        SharedPreferences.Editor editor = fbInfo.edit();
        editor.putString(FB_ID, fb_id);
        editor.putString(FB_NAME, fb_name);
        editor.putString(IS_FIRST_TIME, "yes");
        editor.commit();
    }
}