package mars.mobile;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Log;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import static mars.mobile.MainActivity.prefs;

/**
 * Created by cho on 2015-11-01.
 */
public class registDB extends AsyncTask<String , Integer , String> {

    private String temp_url=null,regid,index,Android_id;
    private String PhoneNumber;
   // public static SharedPreferences prefs;
    private String TAG="registDB",alram;
    private boolean push_agree = false;

    @Override
    protected String doInBackground(String... params) { //안보이는것 처리
        // TODO Auto-generated method stub
         Context mContext;
        mContext = MainActivity.context;


        if(!push_agree) alram = "0"; else alram = "1";
        temp_url=params[0];
        regid=params[1];
        PhoneNumber=params[2];
        index=params[3];



        try {
            String u_id = java.net.URLEncoder.encode(new String(params[0].getBytes("UTF-8")));
            URL url = new URL(temp_url+"?regid="+regid+"&Str_MyPhoneNumber="+Android_id+"&index="+index+"&Android_id="+Android_id+"&alram="+"1");
            url.openStream();
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return null;
    }




}
