using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Text;

namespace SampleApp.Droid.Source.Utility
{
    public class PokktStorage
    {

        private static String SharedPrefsName = "PokktSharedPrefName";

        public static void StoreVideoPoints(Context context, float points)
        {
            float oldPoints = GetVideoPoints(context);
            context.GetSharedPreferences(SharedPrefsName, FileCreationMode.Private).Edit()
                    .PutFloat("points", oldPoints + points).Apply();
        }

        public static float GetVideoPoints(Context context)
        {
            return context.GetSharedPreferences(SharedPrefsName, FileCreationMode.Private).GetFloat("points", 0);
        }

        public static String GetAppId(Context context)
        {
            String appID;
            appID = context.GetSharedPreferences(SharedPrefsName, FileCreationMode.Private).GetString("appId", "a2717a45b835b5e9f50284a38d62a74e");// video demo
			return appID;
        }
		

        public static void SetAppId(Context context, String appId)
        {
            if (!TextUtils.IsEmpty(appId))
            {
                context.GetSharedPreferences(SharedPrefsName, FileCreationMode.Private).Edit().PutString("appId", appId).Apply();
            }
        }

        public static String GetSecurityKey(Context context)
        {
            String securityKey;
            securityKey = context.GetSharedPreferences(SharedPrefsName, FileCreationMode.Private).GetString("securityKey", "iJ02lJss0M"); // video demo            
            return securityKey;
        }

        public static void SetSecurityKey(Context context, String appId)
        {
            if (!TextUtils.IsEmpty(appId))
            {
                context.GetSharedPreferences(SharedPrefsName, FileCreationMode.Private).Edit().PutString("securityKey", appId).Apply();
            }
        }
    }
}