CATCH LOC Developers

Login

CatchLoc SDK 초기화

Description

CatchLoc 계정을 생성하고 위치수집을 위한 초기화 작업을 위해 최초한번이상 실행해 주셔야 합니다.

기본적으로 앱 시작시 onCreate시에 한번 실행하는 방식을 권장합니다.

UI thread에 영향을 주지 않도록 async task등을 이용하시기를 권장합니다.

CatchLoc계정의 Unique id가될 member_key의 경우 각 앱에서 자유롭게 설정하셔도 됩니다. 다만 해당 Key는 Unique해야 합니다.

Example

/************************************************************************************/ // Each customer bereavement unique user identification key, the following example is a sample that setting with email address. // Each customer can be set as a separate value *********/ // Example Email Address mMemberKey = "user_id@xxxxx.com"; // Example Unique Hash String //mMemberKey = "fsdfsfsaklewkdleppfsksl"; // Example Unique Serial Number //mMemberKey = "1234567890"; class CatchLocAsyncTask extends AsyncTask<Void, Void, String[]> { CatchLocResult catchlocResult = new CatchLocResult(); @Override protected String[] doInBackground(Void... params) { catchlocResult = CatchlocSDK.startCatchLoc(MainActivity.this, mApiKey, mMemberKey); return null; } @Override protected void onPostExecute(String[] result) { Log.d("catchloc.sdk", "CatchLocSDK service starting..."); if (!catchlocResult.IsOk) { Toast toast = Toast.makeText(MainActivity.this, "CatchLocResult : "+catchlocResult.IsOk+"/"+ catchlocResult.Message, Toast.LENGTH_LONG); toast.show(); } } } CatchLocAsyncTask catchLocAsyncTask = new CatchLocAsyncTask(); catchLocAsyncTask.execute(); /************************************************************************************/