Java tutorial
//package com.java2s; //License from project: Apache License import android.app.Application; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; public class Main { private static Application app; private static String mCookie; private final static String key = "Set-Cookie"; private static String getSharedPreCookie() { if (TextUtils.isEmpty(mCookie)) { SharedPreferences sp = app.getSharedPreferences("_cookie", Context.MODE_PRIVATE); mCookie = sp.getString(key, ""); } return mCookie; } }