1)GetResultDetails.java
=================
package com.buzzoe.android;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.flurry.android.FlurryAdSize;
import com.flurry.android.FlurryAgent;
import drc.krs.expandListView.Adapter.ExpandListAdapter;
import drc.krs.expandListView.Classes.ExpandListChild;
import drc.krs.expandListView.Classes.ExpandListGroup;
import drc.krs.facebook.android.AsyncFacebookRunner;
import drc.krs.facebook.android.AsyncFacebookRunner.RequestListener;
import drc.krs.facebook.android.DialogError;
import drc.krs.facebook.android.Facebook;
import drc.krs.facebook.android.Facebook.DialogListener;
import drc.krs.facebook.android.FacebookError;
import drc.krs.facebook.android.SessionEvents;
import drc.krs.facebook.android.SessionEvents.AuthListener;
import drc.krs.facebook.android.SessionEvents.LogoutListener;
import drc.krs.facebook.android.SessionStore;
import drc.krs.facebook.android.Util;
import drc.krs.xmlread.Dict_Language_Constant;
public class GetResultDetails extends Activity {
/** Called when the activity is first created. */
private ExpandListAdapter ExpAdapter;
private ExpandableListView ExpandList;
private SharedPreferences mSharedPreferences_Read = null, mSharedPreferences_Write = null;
private Button btn_back = null, btn_resign = null, btnStartNext = null, btn_fb_share = null;
private TextView txt_round_title = null;
private LinearLayout llresult = null, lnr_full = null;
// private Facebook facebook = null;
private CommonClass mCommonClass = null;
private HashMap<String, String> parameters = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.xresult);
Memory_Alloc();
if (mCommonClass.CheckNetwork(this)) {
new GetResultDetail().execute("");
}
btn_back.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
finish();
}
});
btn_resign.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
if (mCommonClass.CheckNetwork(getBaseContext())) {
alert_lang_change();
}
}
});
btnStartNext.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
int round_no = Integer.parseInt(mSharedPreferences_Read.getString(Constant.SHARED_KEY.ROUND_NO, ""));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.PUSHNOTIFICATION_ALERT_ACTIVITY)) {
round_no = round_no + 1;
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.ROUND_NO, String.valueOf(round_no));
editor.commit();
}
Intent mIntent = new Intent(GetResultDetails.this, Your_Turn_Details_Activity.class);
mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(mIntent);
finish();
}
});
btn_fb_share.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
FaceBook_Flurry_Event();
if (Constant.FACEBOOK.mFacebook == null) {
Constant.FACEBOOK.mFacebook = new Facebook(Constant.FACEBOOK.FBAPP_ID);
}
System.out.println("GetResult activity session :" + Constant.FACEBOOK.mFacebook.isSessionValid());
if (Constant.FACEBOOK.mFacebook.isSessionValid()) {
String FB_str = String.format(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.PLAYED_BUZZOE_TAG, ""), mSharedPreferences_Read.getString(Constant.SHARED_KEY.USERNAME, ""));
Constant.FACEBOOK.mFacebook.setText(FB_str);
int Type = 1;
Constant.FACEBOOK.mFacebook.dialog(GetResultDetails.this, Type, Constant.FACEBOOK.STREAM_PUBLISH, new TestUiServerListener());
} else {
Constant.FACEBOOK.mFacebook.authorize(GetResultDetails.this, Constant.FACEBOOK.FBAPP_ID, Constant.FACEBOOK.PERMISSION, new LoginDialogListener());
}
}
});
// if (mCommonClass.CheckNetwork(this)) {
// new getHomeScreenDetails_GetWebData().execute("");
// }
}
public class TestUiServerListener implements DialogListener {
public void onComplete(Bundle values) {
final String postId = values.getString("post_id");
if (postId != null) {
Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
new AsyncFacebookRunner(Constant.FACEBOOK.mFacebook).request(postId, new TestPostRequestListener());
} else {
GetResultDetails.this.runOnUiThread(new Runnable() {
public void run() {
System.out.println("Fail");
}
});
}
}
public void onCancel() {
}
public void onError(DialogError e) {
e.printStackTrace();
}
public void onFacebookError(FacebookError e) {
e.printStackTrace();
}
}
public class TestPostRequestListener implements RequestListener {
public void onComplete(final String response) {
Log.d("Tests", "Got response: " + response);
try {
org.json.JSONObject json = Util.parseJson(response);
// final String message = json.getString("message");
String postId = json.getString("id");
GetResultDetails.this.runOnUiThread(new Runnable() {
public void run() {
System.out.println("Wall Success");
}
});
Log.d("Tests", "Testing wall post delete");
} catch (Throwable e) {
e.printStackTrace();
GetResultDetails.this.runOnUiThread(new Runnable() {
public void run() {
System.out.println("Wall Fail");
}
});
}
}
public void onFacebookError(FacebookError e) {
e.printStackTrace();
}
public void onFileNotFoundException(FileNotFoundException e) {
e.printStackTrace();
}
public void onIOException(IOException e) {
e.printStackTrace();
}
public void onMalformedURLException(MalformedURLException e) {
e.printStackTrace();
}
@Override
public void onComplete(String response, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onIOException(IOException e, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onFileNotFoundException(FileNotFoundException e, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onMalformedURLException(MalformedURLException e, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onFacebookError(FacebookError e, Object state) {
// TODO Auto-generated method stub
}
}
private void alert_lang_change() {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(GetResultDetails.this);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, "")).setMessage(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.ARE_YOU_SURE_YOU_WANT_TO_RESIGN_FROM_THE_GAME_TAG, "")).setCancelable(false).setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).setNegativeButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YES_SURE_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (mCommonClass.CheckNetwork(GetResultDetails.this)) {
new ResignUserFromGame_GetWebData().execute("");
}
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
private final class LoginDialogListener implements DialogListener {
public void onComplete(Bundle values) {
SessionEvents.onLoginSuccess();
}
public void onFacebookError(FacebookError error) {
SessionEvents.onLoginError(error.getMessage());
}
public void onError(DialogError error) {
SessionEvents.onLoginError(error.getMessage());
}
public void onCancel() {
SessionEvents.onLoginError("Action Canceled");
}
}
private void Memory_Alloc() {
mSharedPreferences_Read = getSharedPreferences(Constant.SHAREDPREFERENCES, MODE_WORLD_READABLE);
mSharedPreferences_Write = getSharedPreferences(Constant.SHAREDPREFERENCES, MODE_WORLD_WRITEABLE);
ExpandList = (ExpandableListView) findViewById(R.id.ExpList);
btn_back = (Button) findViewById(R.id.btn_back);
btn_resign = (Button) findViewById(R.id.btn_resign);
btnStartNext = (Button) findViewById(R.id.btnStartNext);
btn_fb_share = (Button) findViewById(R.id.btn_fb_share);
txt_round_title = (TextView) findViewById(R.id.txt_round_title);
llresult = (LinearLayout) findViewById(R.id.llresult);
llresult.setLayoutParams(new LinearLayout.LayoutParams(getResources().getDisplayMetrics().widthPixels, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, Constant.FLURRY.DISPLAY_ADS_SCREEN_HEIGHT, getResources().getDisplayMetrics())));
lnr_full = (LinearLayout) findViewById(R.id.lnr_full);
if (Constant.FACEBOOK.mFacebook == null) {
Constant.FACEBOOK.mFacebook = new Facebook(Constant.FACEBOOK.FBAPP_ID);
}
if (!Constant.FACEBOOK.mFacebook.isSessionValid()) {
SessionStore.restore(Constant.FACEBOOK.mFacebook, this);
}
SessionEvents.addAuthListener(new SampleAuthListener());
SessionEvents.addLogoutListener(new SampleLogoutListener());
mCommonClass = new CommonClass();
parameters = new HashMap<String, String>();
// Constant.FACEBOOK.mFacebook = new Facebook(Constant.FACEBOOK.FB_ID);
}
private void Set_Values() {
System.out.println("module name :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, ""));
int previus_round = Integer.parseInt(mSharedPreferences_Read.getString(Constant.SHARED_KEY.ROUND_NO, ""));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_TURN)) {
previus_round = previus_round - 1;
}
txt_round_title.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.RESULTS_ROUND_TAG, "") + " " + String.valueOf(previus_round));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_TURN)) {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.START_THE_NEXT_ROUND_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab);
btnStartNext.setEnabled(true);
} else if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_OPPONENT)) {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.WAITING_FOR_OPPONENTS_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab_selected);
btnStartNext.setEnabled(false);
} else if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.PUSHNOTIFICATION_ALERT_ACTIVITY)) {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.START_THE_NEXT_ROUND_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab);
btnStartNext.setEnabled(true);
} else {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.WAITING_FOR_OPPONENTS_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab_selected);
btnStartNext.setEnabled(false);
}
btn_back.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.HOME_TAG, ""));
btn_resign.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.RESIGN_TAG, ""));
btn_fb_share.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.SHARE_ON_FACEBOOK_TAG, ""));
}
@Override
protected void onResume() {
super.onResume();
runOnUiThread(new Runnable() {
@Override
public void run() {
Set_Values();
SoundEngine.sharedEngine().resumeSound(GetResultDetails.this);
SoundEngine.sharedEngine().playSound(GetResultDetails.this, R.raw.buzzoe, true);
}
});
}
@Override
protected void onStart() {
super.onStart();
new Start_Result_Details().execute("");
}
private class Start_Result_Details extends AsyncTask<String, String, String> {
@Override
protected String doInBackground(String... params) {
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE || Constant.FLURRY.FLURRY_AD_VISIBLE) {
FlurryAgent.onStartSession(GetResultDetails.this, Constant.FLURRY.getAPI_KEY());
}
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE) {
FlurryAgent.setLogEnabled(true);
FlurryAgent.setLogLevel(Log.VERBOSE);
}
return "";
}
@Override
protected void onPostExecute(String result) {
if (Constant.FLURRY.FLURRY_AD_VISIBLE) {
if (FlurryAgent.isAdAvailable(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_BANNER, FlurryAdSize.BANNER_BOTTOM, 10000)) {
FlurryAgent.initializeAds(GetResultDetails.this);
FlurryAgent.getAd(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_BANNER, llresult, FlurryAdSize.BANNER_BOTTOM, 10000);
llresult.setVisibility(LinearLayout.VISIBLE);
}
Bundle mBundle = getIntent().getExtras();
if (mBundle != null) {
if (mBundle.getBoolean("show", false)) {
if (Constant.FULL_FLURRY) {
if (FlurryAgent.isAdAvailable(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_FULL_BANNER, FlurryAdSize.FULLSCREEN, 10000)) {
FlurryAgent.initializeAds(GetResultDetails.this);
FlurryAgent.getAd(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_FULL_BANNER, lnr_full, FlurryAdSize.FULLSCREEN, 10000);
Constant.FULL_FLURRY = false;
lnr_full.setVisibility(LinearLayout.VISIBLE);
}
}
}
}
}
super.onPostExecute(result);
}
}
@Override
protected void onStop() {
super.onStop();
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE || Constant.FLURRY.FLURRY_AD_VISIBLE) {
FlurryAgent.onEndSession(this);
}
}
private void FaceBook_Flurry_Event() {
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE) {
Log.d("Flurry", "Share on FB ResultDetails Session");
parameters.put(Constant.FLURRY.SHARE_ON_FB_RESULT_DETAILS_KEY, Constant.FLURRY.SHARE_ON_FB_RESULT_DETAILS);
FlurryAgent.logEvent(Constant.FLURRY.SHARE_ON_FB_RESULT_DETAILS_EVENT, parameters);
}
}
@Override
protected void onPause() {
SoundEngine.sharedEngine().pauseSound();
super.onPause();
}
public class SampleAuthListener implements AuthListener {
public void onAuthSucceed() {
}
public void onAuthFail(String error) {
// mText.setText("Login Failed: " + error);
}
}
public class SampleLogoutListener implements LogoutListener {
public void onLogoutBegin() {
// mText.setText("Logging out...");
}
public void onLogoutFinish() {
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
finish();
}
return super.onKeyDown(keyCode, event);
}
public class GetResultDetail extends AsyncTask<String, String, String> {
private String SOAP_NAMESPACE = null;
private String SOAP_URL = null;
private String SOAP_ACTION = null;
private String SOAP_METHOD = null;
private ProcessDialog mProcessDialog = null;
@Override
protected void onPreExecute() {
mProcessDialog = new ProcessDialog(GetResultDetails.this, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""), mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG, ""), false);
SOAP_URL = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
SOAP_ACTION = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
SOAP_NAMESPACE = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
SOAP_METHOD = Constant.GET_RESULT_DETAILS.SOAP_METHOD;
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
SOAPService mSOAPService = new SOAPService(SOAP_URL, SOAP_ACTION, SOAP_NAMESPACE, SOAP_METHOD);
String keyName[] = { Constant.GET_RESULT_DETAILS.INPUT_KEY.USER_ID, Constant.GET_RESULT_DETAILS.INPUT_KEY.GAME_ID, Constant.GET_RESULT_DETAILS.INPUT_KEY.ROUND_NO, Constant.GET_RESULT_DETAILS.INPUT_KEY.CODE };
int previus_round = Integer.parseInt(mSharedPreferences_Read.getString(Constant.SHARED_KEY.ROUND_NO, ""));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_TURN)) {
previus_round = previus_round - 1;
}
String keyValue[] = { mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, ""), mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID, ""), String.valueOf(previus_round), mSharedPreferences_Read.getString(Constant.SHARED_KEY.DEFAULT_LANGUAGE_CODE, "") };
System.out.println("get result details --------------> " + "login user id :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, "") + " game id :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID, "") + " " + " round no :" + String.valueOf(previus_round) + " " + " lang code :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.DEFAULT_LANGUAGE_CODE, ""));
return mSOAPService.getSoapData(keyName, keyValue);
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
if (mProcessDialog != null)
if (mProcessDialog.isShowing()) {
mProcessDialog.dismiss();
}
if (result != null) {
System.out.println("getResultDetails:- " + result);
String strSuccess;
try {
ArrayList<ExpandListGroup> mExpandListGroup = new ArrayList<ExpandListGroup>();
ArrayList<ExpandListChild> mExLChild = null;
JSONObject mJsonObject = new JSONObject(result);
if (mJsonObject != null) {
String PlayWithComp = "";
if (mJsonObject.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.PLAYWITHCOMP)) {
PlayWithComp = mJsonObject.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.PLAYWITHCOMP).toString();
if (PlayWithComp.equalsIgnoreCase(Constant.GET_RESULT_DETAILS.OBJECT_VALUE.PLAYWITHCOMP_TRUE)) {
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, Constant.GET_RESULT_DETAILS.OBJECT_VALUE.PLAYWITHCOMP_TRUE);
editor.commit();
alert_msg();
} else {
ArrayList<Boolean> Array_Not_Zero = new ArrayList<Boolean>();
strSuccess = mJsonObject.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.RESULT).toString();
if (strSuccess.equals(Constant.GET_RESULT_DETAILS.OBJECT_VALUE.SUCCESS)) {
JSONArray jArray_Users = mJsonObject.getJSONArray(Constant.GET_RESULT_DETAILS.OBJECT_KEY.USERS);
if (jArray_Users.length() <= 1) {
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, Constant.GET_RESULT_DETAILS.OBJECT_VALUE.PLAYWITHCOMP_TRUE);
editor.commit();
alert_msg();
} else {
if (jArray_Users != null) {
for (int i = 0; i < jArray_Users.length(); i++) {
JSONObject jobresult = jArray_Users.getJSONObject(i);
ExpandListGroup gru1 = new ExpandListGroup();
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ID)) {
gru1.setId(jobresult.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ID).toString().trim());
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.NAME)) {
gru1.setName(jobresult.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.NAME).toString().trim());
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.RIGHTQUSTIONS)) {
gru1.setRightQustions(jobresult.getInt(Constant.GET_RESULT_DETAILS.OBJECT_KEY.RIGHTQUSTIONS));
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALQUSTIONS)) {
gru1.setTotalQustions(jobresult.getInt(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALQUSTIONS));
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALTIMETAKEN)) {
gru1.setTotalTimeTaken(jobresult.getInt(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALTIMETAKEN));
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.STAR)) {
gru1.setStar(jobresult.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.STAR).toString().trim());
}
JSONArray jArrayQueston = null;
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTIONS)) {
jArrayQueston = jobresult.getJSONArray(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTIONS);
}
if (jArrayQueston != null) {
mExLChild = new ArrayList<ExpandListChild>();
if (jArrayQueston.length() > 0) {
Array_Not_Zero.add(true);
} else {
Array_Not_Zero.add(false);
}
for (int j = 0; j < jArrayQueston.length(); j++) {
JSONObject jsonObjectQuestions = jArrayQueston.getJSONObject(j);
ExpandListChild ch1_1 = new ExpandListChild();
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ANSWER)) {
ch1_1.setAnswer(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ANSWER).toString().trim());
}
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.IS_TRUE)) {
ch1_1.setIs_true(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.IS_TRUE).toString().trim());
}
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTION)) {
ch1_1.setQuestion(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTION).toString().trim());
}
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TIME_TAKEN)) {
ch1_1.setTime_taken(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TIME_TAKEN).toString().trim());
}
mExLChild.add(ch1_1);
}
gru1.setChildItems(mExLChild);
}
mExpandListGroup.add(gru1);
}
}
}
}
String Round_over = "0";
if (mJsonObject.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ROUND_OVER)) {
Round_over = mJsonObject.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ROUND_OVER).toString();
}
ExpAdapter = new ExpandListAdapter(GetResultDetails.this, mExpandListGroup, Round_over, Array_Not_Zero);
ExpandList.setAdapter(ExpAdapter);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
private class ResignUserFromGame_GetWebData extends AsyncTask<String, String, String> {
private String SOAP_URL = null;
private String SOAP_NAMESPACE = null;
private String SOAP_ACTION = null;
private String SOAP_METHOD = null;
private ProcessDialog mProcessDialog = null;
@Override
protected void onPreExecute() {
SOAP_URL = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
SOAP_NAMESPACE = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
SOAP_ACTION = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
SOAP_METHOD = Constant.RESIGN_USER_FROM_GAME.SOAP_METHOD;
mProcessDialog = new ProcessDialog(GetResultDetails.this, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""), mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG, ""), false);
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
SOAPService mSoapService = new SOAPService(SOAP_URL, SOAP_ACTION, SOAP_NAMESPACE, SOAP_METHOD);
String keyName[] = { Constant.RESIGN_USER_FROM_GAME.INPUT_KEY.GAME_ID, Constant.RESIGN_USER_FROM_GAME.INPUT_KEY.USER_ID };
// System.out.println("gameid :"+mBundle.getString("game_id")
// +" userid:"+mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID,""));
String keyValue[] = { mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID, ""), mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, "") };
return mSoapService.getSoapData(keyName, keyValue);
}
@Override
protected void onPostExecute(String result) {
if (mProcessDialog != null)
if (mProcessDialog.isShowing()) {
mProcessDialog.cancel();
}
if (result != null) {
System.out.println(result);
if (!mSharedPreferences_Read.getString(Constant.SHARED_KEY.PLAY_WITH_COMP, "").equalsIgnoreCase("true")) {
alert_success_resign_msg();
} else {
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, "false");
editor.commit();
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
finish();
}
} else {
Toast.makeText(GetResultDetails.this, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_INTERNET_CONNECTION_FOUND_TO_PLAY_BUZZOE_YOU_NEED_CONNECTION_TO_THE_INTERNET_TAG, ""), Toast.LENGTH_LONG).show();
}
super.onPostExecute(result);
}
}
private void alert_success_resign_msg() {
SharedPreferences mSharedPreferences_Read = getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""));
String msg = mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YOU_HAVE_SUCCESSFULLY_RESIGNED_FROM_THE_GAME_TAG, "");
msg = String.format(msg, mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_NAME, ""));
alertDialogBuilder.setMessage(msg).setCancelable(false).setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.OK_C_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
startActivity(in);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
finish();
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
// private class getHomeScreenDetails_GetWebData extends AsyncTask<String,
// String, String> {
//
// private String SOAP_URL = null;
// private String SOAP_NAMESPACE = null;
// private String SOAP_ACTION = null;
// private String SOAP_METHOD = null;
// private ProcessDialog mProcessDialog = null;
//
// @Override
// protected void onPreExecute() {
// mProcessDialog = new ProcessDialog(GetResultDetails.this,
// mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG,
// ""),
// mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG,
// ""), false);
// SOAP_URL = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
// SOAP_NAMESPACE = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
// SOAP_ACTION = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
// SOAP_METHOD = Constant.GET_HOMESCREEN_DETAILS.SOAP_METHOD;
// super.onPreExecute();
// }
//
// @Override
// protected String doInBackground(String... params) {
//
// SOAPService mSOAPService = new SOAPService(SOAP_URL, SOAP_ACTION,
// SOAP_NAMESPACE, SOAP_METHOD);
// String keyName[] = { Constant.GET_HOMESCREEN_DETAILS.INPUT_KEY.USER_ID };
// String keyValue[] = {
// mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, "")
// };
// return mSOAPService.getSoapData(keyName, keyValue);
// }
//
// @Override
// protected void onPostExecute(String result) {
// if(mProcessDialog!=null)
// if(mProcessDialog.isShowing()){
// mProcessDialog.cancel();
// }
//
// JSONObject mJSON_Result = null, mJSON_Yourturn = null;
// JSONArray mJSON_Yourturn_Array = null;
// int turn_count = 0;
//
// if (result != null) {
// try {
// System.out.println("getHomeScreenDetails_GetWebData response:=" +
// result);
// mJSON_Result = new JSONObject(result);
//
// if (mJSON_Result.getString("result").equals("success")) {
// mJSON_Yourturn_Array = new
// JSONArray(mJSON_Result.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.YOUR_TURN));
// turn_count = mJSON_Yourturn_Array.length();
// //
// System.out.println("getHomeScreenDetails_GetWebData turn count:="+turn_count);
// //
// System.out.println("getHomeScreenDetails_GetWebData Shared Game ID :="+mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID,
// // ""));
//
// for (int i = 0; i < turn_count; i++) {
// mJSON_Yourturn = new JSONObject(mJSON_Yourturn_Array.getString(i));
// //
// System.out.println("getHomeScreenDetails_GetWebData GameID :="+mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.GAME_ID));
//
// if
// (mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.GAME_ID).equalsIgnoreCase(mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID,
// ""))) {
//
// //
// System.out.println("getHomeScreenDetails_GetWebData Game ID Compare True ");
// //
// System.out.println("getHomeScreenDetails_GetWebData PlayWithComp "+mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.PLAYWITHCOMP));
// if
// (mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.PLAYWITHCOMP).equalsIgnoreCase("true"))
// {
//
// //
// System.out.println("getHomeScreenDetails_GetWebData PlayWithComp Compare True ");
//
// Editor editor = mSharedPreferences_Write.edit();
// editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, "true");
// editor.commit();
//
// alert_msg();
// }
// }
// }
//
// }
//
// // System.out.println("result :" +
// // mJSON_Result.getString("result"));
// // System.out.println("YourTurn :" +
// // mJSON_Result.getString("YourTurn"));
// //
// // System.out.println("Waiting :" +
// // mJSON_Result.getString("Waiting"));
//
// } catch (Exception e) {
// e.printStackTrace();
// }
// } else {
// Toast.makeText(GetResultDetails.this,
// mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_INTERNET_CONNECTION_FOUND_TO_PLAY_BUZZOE_YOU_NEED_CONNECTION_TO_THE_INTERNET_TAG,""),
// Toast.LENGTH_LONG).show();
// }
// super.onPostExecute(result);
// }
// }
private void alert_msg() {
System.out.println("getHomeScreenDetails_GetWebData Alert ");
SharedPreferences mSharedPreferences_Read = getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""));
alertDialogBuilder.setMessage(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.ALL_THE_OTHER_PLAYERS_HAVE_RESIGNED_FROM_THE_GAME_TAG, "")).setCancelable(false).setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.OK_C_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (mCommonClass.CheckNetwork(GetResultDetails.this)) {
new ResignUserFromGame_GetWebData().execute("");
}
// Intent mIntent = new Intent(GetResultDetails.this, Main_Activity.class);
// mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// finish();
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
}
2)create package drc.krs.expandListView.Adapter
==============================
1)ExpandListAdapter.java
=================
package drc.krs.expandListView.Adapter;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.AsyncTask;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.buzzoe.android.Constant;
import com.buzzoe.android.ProcessDialog;
import com.buzzoe.android.R;
import com.buzzoe.android.SOAPService;
import drc.krs.expandListView.Classes.ExpandListChild;
import drc.krs.expandListView.Classes.ExpandListGroup;
import drc.krs.xmlread.Dict_Language_Constant;
public class ExpandListAdapter extends BaseExpandableListAdapter {
private Context context;
private ArrayList<ExpandListGroup> groups;
private String Round_over="";
private ArrayList<Boolean> Array_Not_Zero=new ArrayList<Boolean>();
private String Green_Color="#39b708";
private SharedPreferences mSharedPreferences_Read=null;
public ExpandListAdapter(Context context, ArrayList<ExpandListGroup> groups,String Round_over,ArrayList<Boolean> Array_Not_Zero) {
this.context = context;
this.groups = groups;
this.Round_over=Round_over;
this.Array_Not_Zero=Array_Not_Zero;
mSharedPreferences_Read=context.getSharedPreferences(Constant.SHAREDPREFERENCES, context.MODE_WORLD_READABLE);
}
// public void addItem(ExpandListChild item, ExpandListGroup group) {
// if (!groups.contains(group)) {
// groups.add(group);
// }
// int index = groups.indexOf(group);
// ArrayList<ExpandListChild> ch = groups.get(index).getItems();
// ch.add(item);
// groups.get(index).setItems(ch);
// }
public Object getChild(int groupPosition, int childPosition) {
ArrayList<ExpandListChild> chList = groups.get(groupPosition).getChildItems();
return chList.get(childPosition);
}
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertview, ViewGroup parent) {
ExpandListChild child = (ExpandListChild) getChild(groupPosition, childPosition);
ChildHolder childHolder;
if (convertview == null) {
LayoutInflater infalInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertview = infalInflater.inflate(R.layout.xresult_child_row, null);
childHolder=new ChildHolder();
childHolder.txt_queindex = (TextView) convertview.findViewById(R.id.txt_queindex);
childHolder.txt_questions = (TextView) convertview.findViewById(R.id.txt_questions);
childHolder.txt_time = (TextView) convertview.findViewById(R.id.txt_time);
childHolder.txt_answer = (TextView) convertview.findViewById(R.id.txt_answer);
convertview.setTag(childHolder);
}
else {
childHolder = (ChildHolder) convertview.getTag();
}
childHolder.txt_queindex.setText(String.valueOf(childPosition + 1));
childHolder.txt_questions.setText(child.getQuestion());
childHolder.txt_time.setText(child.getTime_taken() + " sec");
if(child.getIs_true().toString().trim().equals("1")){
childHolder.txt_answer.setTextColor(Color.parseColor(Green_Color));
}
else{
childHolder.txt_answer.setTextColor(Color.RED);
}
childHolder.txt_answer.setText(child.getAnswer());
return convertview;
}
class ChildHolder {
TextView txt_queindex,txt_questions,txt_time,txt_answer;
}
public int getChildrenCount(int groupPosition) {
ArrayList<ExpandListChild> chList = groups.get(groupPosition).getChildItems();
System.out.println("chList===" +chList);
return chList.size();
}
public Object getGroup(int groupPosition) {
return groups.get(groupPosition);
}
public int getGroupCount() {
return groups.size();
}
public long getGroupId(int groupPosition) {
return groupPosition;
}
public View getGroupView(int groupPosition, boolean isLastChild, View convertview,ViewGroup parent) {
ExpandListGroup group = (ExpandListGroup)getGroup(groupPosition);
GroupHolder groupHolder;
if (convertview == null) {
LayoutInflater mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertview = mLayoutInflater.inflate(R.layout.xresult_group_row, null);
groupHolder = new GroupHolder();
groupHolder.img_star = (ImageView) convertview.findViewById(R.id.img_star);
groupHolder.img_invisible_star = (ImageView)convertview.findViewById(R.id.img_invisible_star);
groupHolder.txt_Name = (TextView)convertview.findViewById(R.id.txt_Name);
groupHolder.result_progressbar = (TextProgressBar)convertview.findViewById(R.id.result_progressbar);
groupHolder.txt_Pending = (TextView)convertview.findViewById(R.id.txt_Pending);
groupHolder.txt_Pending.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.PENDING_TAG, ""));
groupHolder.img_Arrow = (ImageView)convertview.findViewById(R.id.img_Arrow);
groupHolder.img_Nudge = (Button)convertview.findViewById(R.id.img_Nudge);
groupHolder.img_Nudge.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NUDGE_TAG, ""));
groupHolder.img_Nudge.setTag(group.getId());
groupHolder.img_Nudge.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
alert_lang_change(v.getTag().toString());
}
});
convertview.setTag(groupHolder);
}
else {
groupHolder = (GroupHolder) convertview.getTag();
}
setStarImage(group.getStar(),groupHolder.img_star);
groupHolder.txt_Name.setText(group.getName());
groupHolder.result_progressbar.setMax(group.getTotalQustions());
groupHolder.result_progressbar.setMinutes(group.getTotalTimeTaken());
groupHolder.result_progressbar.setProgress(group.getRightQustions());
groupHolder.result_progressbar.Update_UI();
if(Array_Not_Zero.get(groupPosition)){
groupHolder.img_invisible_star.setVisibility(ImageView.GONE);
groupHolder.txt_Pending.setVisibility(TextView.GONE);
groupHolder.img_Nudge.setVisibility(ImageView.GONE);
groupHolder.result_progressbar.setVisibility(TextProgressBar.VISIBLE);
groupHolder.img_Arrow.setVisibility(ImageView.VISIBLE);
}
else{
if(Round_over.equals("0")){
groupHolder.img_invisible_star.setVisibility(ImageView.INVISIBLE);
groupHolder.txt_Pending.setVisibility(TextView.VISIBLE);
groupHolder.img_Nudge.setVisibility(ImageView.VISIBLE);
groupHolder.result_progressbar.setVisibility(TextProgressBar.GONE);
groupHolder.img_Arrow.setVisibility(ImageView.GONE);
}
else{
groupHolder.img_invisible_star.setVisibility(ImageView.GONE);
groupHolder.txt_Pending.setVisibility(TextView.VISIBLE);
groupHolder.img_Nudge.setVisibility(ImageView.GONE);
groupHolder.result_progressbar.setVisibility(TextProgressBar.GONE);
groupHolder.img_Arrow.setVisibility(ImageView.GONE);
}
}
return convertview;
}
private void alert_lang_change(final String view_tag)
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG,""))
.setMessage(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.ARE_YOU_SURE_YOU_WANT_TO_NUDGE_THE_USER_TAG,""))
.setCancelable(false)
.setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_TAG,""),new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
dialog.cancel();
}
})
.setNegativeButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YES_SURE_TAG,""),new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
new nudgeUserFromGame_GetWebData().execute(view_tag);
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
class GroupHolder {
ImageView img_star,img_invisible_star,img_Arrow;
TextView txt_Name ,txt_Pending;
TextProgressBar result_progressbar;
Button img_Nudge ;
}
/**This function use for set star*/
private void setStarImage(String str_star,ImageView img_star){
if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.GREEN))
{
img_star.setImageResource(R.drawable.green);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.WHITE))
{
img_star.setImageResource(R.drawable.white);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BLACK))
{
img_star.setImageResource(R.drawable.black);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BLUE))
{
img_star.setImageResource(R.drawable.blue);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.GOLD))
{
img_star.setImageResource(R.drawable.gold);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.ORANGE))
{
img_star.setImageResource(R.drawable.orange);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.PURPLE))
{
img_star.setImageResource(R.drawable.purple);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.RED))
{
img_star.setImageResource(R.drawable.red);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.YELLOW))
{
img_star.setImageResource(R.drawable.yellow);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BRONZE))
{
img_star.setImageResource(R.drawable.bronze);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BROWN))
{
img_star.setImageResource(R.drawable.brown);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.PINK))
{
img_star.setImageResource(R.drawable.pink);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.DIAMOND))
{
img_star.setImageResource(R.drawable.diamond);
}
}
public boolean hasStableIds() {
return true;
}
public boolean isChildSelectable(int arg0, int arg1) {
return true;
}
private class nudgeUserFromGame_GetWebData extends AsyncTask<String, String, String>
{
private String SOAP_URL=null;
private String SOAP_NAMESPACE=null;
private String SOAP_ACTION=null;
private String SOAP_METHOD=null;
private ProcessDialog mProcessDialog=null;
@Override
protected void onPreExecute() {
SOAP_URL=Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
SOAP_NAMESPACE=Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
SOAP_ACTION=Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
SOAP_METHOD=Constant.NUDGE_USER_FROM_GAME.SOAP_METHOD;
mProcessDialog=new ProcessDialog(context, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG,""), mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG,""),false);
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
SOAPService mSoapService=new SOAPService(SOAP_URL, SOAP_ACTION, SOAP_NAMESPACE, SOAP_METHOD);
String keyName[]={Constant.NUDGE_USER_FROM_GAME.INPUT_KEY.GAME_ID,Constant.NUDGE_USER_FROM_GAME.INPUT_KEY.USER_ID,Constant.NUDGE_USER_FROM_GAME.INPUT_KEY.FRIEND_USER_ID};
String keyValue[]={mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID,""),mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID,""),params[0]};
return mSoapService.getSoapData(keyName, keyValue);
}
@Override
protected void onPostExecute(String result) {
if(mProcessDialog!=null)
if(mProcessDialog.isShowing()){
mProcessDialog.cancel();
}
if(result!=null)
{
try
{
JSONObject mJsonObject=new JSONObject(result);
if(mJsonObject.getString("result").equalsIgnoreCase("success"))
{
//message(mJsonObject.getString("message"));
String msg=mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YOU_HAVE_SUCCESFULLY_NUDGED_THE_USER_TAG,"");
message(msg);
}
else if(mJsonObject.getString("result").equalsIgnoreCase("failed"))
{
String msg=mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YOU_HAVE_ALREADY_NUDGED_THE_USER_TAG,"");
message(msg);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
super.onPostExecute(result);
}
}
public void message(String str)
{
Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
}
}
2)TextProgressBar.java
package drc.krs.expandListView.Adapter;
import com.buzzoe.android.Constant;
import drc.krs.xmlread.Dict_Language_Constant;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.ProgressBar;
public class TextProgressBar extends ProgressBar {
private SharedPreferences mSharedPreferences_Read=null;
private String outof ="";
private String minutes = "";
private Paint textPaint;
private int max = 15 , progress = 0;
public TextProgressBar(Context context) {
super(context);
mSharedPreferences_Read=context.getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setAntiAlias(true);
textPaint.setTextSize(18);
}
public TextProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
mSharedPreferences_Read=context.getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setAntiAlias(true);
textPaint.setTextSize(18);
}
@Override
public void setMax(int max) {
super.setMax(max);
this.max=max;
}
public void setMinutes(int Seconds) {
this.minutes=Second_To_Minutes(Seconds);
}
private String Second_To_Minutes(int Seconds) {
int mMinutes = Seconds / 60;
int mFractionMinute = Seconds % 60;
return ("" + mMinutes + ":" + mFractionMinute + mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.M_TAG, ""));
}
public void Update_UI(){
drawableStateChanged();
invalidate();
}
@Override
public void setProgress(int progress) {
super.setProgress(progress);
this.progress=progress;
}
public TextProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
textPaint = new Paint();
textPaint.setAntiAlias(true);
textPaint.setColor(Color.WHITE);
textPaint.setTextSize(18);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
outof= "%s "+mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.OUT_OF_TAG, "")+" %s";
String left= String.format(outof,String.valueOf(progress),String.valueOf(max));
Rect bounds1 = new Rect();
textPaint.getTextBounds(left, 0, left.length(), bounds1);
int x = getWidth() / 4 - bounds1.centerX();
int y = getHeight() / 2 - bounds1.centerY();
canvas.drawText(left, x, y, textPaint);
Rect bounds2 = new Rect();
textPaint.getTextBounds(minutes, 0, minutes.length(), bounds2);
x = (int) (getWidth() / (1.3) - bounds2.centerX());
y = getHeight() / 2 - bounds2.centerY();
canvas.drawText(minutes, x, y, textPaint);
super.setProgress(progress);
}
public void setTextColor(int color) {
textPaint.setColor(color);
drawableStateChanged();
}
}
===========================================
Create new package drc.krs.expandListView.Classes.java
1)ExpandListChild.java
==============
package drc.krs.expandListView.Classes;
public class ExpandListChild {
private String answer="",time_taken="",is_true="",question="";
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getTime_taken() {
return time_taken;
}
public void setTime_taken(String time_taken) {
this.time_taken = time_taken;
}
public String getIs_true() {
return is_true;
}
public void setIs_true(String is_true) {
this.is_true = is_true;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
}
===================================
2)ExpandListGroup.java
===============
package drc.krs.expandListView.Classes;
import java.util.ArrayList;
public class ExpandListGroup{
private String star="",id="",name="";
private Integer totalTimeTaken=0,TotalQustions=0,rightQustions=0;
/**it for total qustion and answer*/
private ArrayList<ExpandListChild> alst_expandlistchild;
public ArrayList<ExpandListChild> getChildItems() {
return alst_expandlistchild;
}
public void setChildItems(ArrayList<ExpandListChild> alst_expandlistchild) {
this.alst_expandlistchild = alst_expandlistchild;
}
public String getStar() {
return star;
}
public void setStar(String star) {
this.star = star;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getTotalTimeTaken() {
return totalTimeTaken;
}
public void setTotalTimeTaken(Integer totalTimeTaken) {
this.totalTimeTaken = totalTimeTaken;
}
public Integer getTotalQustions() {
return TotalQustions;
}
public void setTotalQustions(Integer TotalQustions) {
this.TotalQustions = TotalQustions;
}
public Integer getRightQustions() {
return rightQustions;
}
public void setRightQustions(Integer rightQustions) {
this.rightQustions = rightQustions;
}
}
==============================================
1)xresult_group_r0w
=============
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:background="@drawable/setting_middle_bg">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="@+id/img_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txt_Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:gravity="left"
android:text="Ravi"
android:singleLine="true"
android:textSize="18dip"
android:textStyle="bold"
android:textColor="#30809b" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="horizontal"
android:gravity="left">
<drc.krs.expandListView.Adapter.TextProgressBar
android:id="@+id/result_progressbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="15"
android:progressDrawable="@drawable/progressbar"
style="?android:attr/progressBarStyleHorizontal"
/>
<ImageView
android:id="@+id/img_invisible_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<TextView
android:id="@+id/txt_Pending"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:text="Pending..."
android:layout_marginLeft="10dip"
android:textSize="18dip"
android:textStyle="bold"
android:visibility="gone"
android:singleLine="true"
android:textColor="@color/Black" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/img_Arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow" />
<Button
android:id="@+id/img_Nudge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:singleLine="true"
android:text="Nudge"
android:textColor="@android:color/white"
android:background="@drawable/btn_blue_bg_s"
/>
</LinearLayout>
=======================================
2)xresult_child_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/questionbackcolor">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_queindex"
android:text="1"
android:textSize="14dip"
android:textColor="@color/Black"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/txt_questions"
android:focusable="false"
android:textSize="14dip"
android:textColor="@color/Black"
android:gravity="left"
android:text="What is the capital of Maxico?"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/txt_time"
android:textSize="14dip"
android:text="7 sec"
android:textColor="@color/Black"
android:singleLine="true"
android:gravity="right"
android:layout_marginRight="5dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_queindex"
android:text="1"
android:textSize="14dip"
android:textColor="@color/Black"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:gravity="left"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/txt_answer"
android:textSize="14dip"
android:layout_weight="1"
android:text="Mexico City"
android:layout_marginLeft="5dip"
android:textColor="@color/greenMid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
==================================
3)xresult.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/main_background"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/toptab"
android:gravity="center_vertical"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:background="@drawable/btnback"
android:gravity="center"
android:singleLine="true"
android:text="@string/back_button"
android:textColor="@color/White"
android:textSize="16dip" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/logo_banner" />
<Button
android:id="@+id/btn_resign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dip"
android:background="@drawable/btn_blue_bg_s"
android:gravity="center_vertical|center"
android:text="Resign"
android:textColor="@android:color/white"
android:textSize="14dip" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_margin="5dip"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/blue_top_bg"
android:gravity="left|center_vertical" >
<TextView
android:id="@+id/txt_round_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:text="Result round 1"
android:textColor="@android:color/white"
android:textSize="12dip" />
</LinearLayout>
<ExpandableListView
android:id="@+id/ExpList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:childDivider="@color/questionbackcolor"
android:divider="@android:color/transparent"
android:groupIndicator="@null" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical" >
<Button
android:id="@+id/btn_fb_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dip"
android:background="@drawable/btn_login_with_facebook"
android:textColor="@color/White" />
<LinearLayout
android:id="@+id/llresult"
android:layout_width="fill_parent"
android:visibility="gone"
android:layout_height="50dip" />
<Button
android:id="@+id/btnStartNext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bottom_tab"
android:textColor="@color/White"
android:textSize="20dip"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/lnr_full"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
=================================
manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.buzzoe.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<permission
android:name="com.buzzoe.android.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.buzzoe.android.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
<application
android:icon="@drawable/buzzoe_icon"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@android:style/Theme.Black"
android:vmSafeMode="true" >
<receiver
android:name="com.ovte.gcm.C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="com.buzzoe.android" />
</intent-filter>
</receiver>
<receiver
android:name="com.ovte.gcm.C2DMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="com.buzzoe.android" />
</intent-filter>
</receiver>
<!-- admob advertise code start -->
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<meta-data
android:name="com.flurry.admob.MY_AD_UNIT_ID"
android:value="@string/appSpot_admob_apikey" />
<meta-data
android:name="com.flurry.admob.test"
android:value="false" />
<!-- admob advertise code end -->
<activity
android:name="com.flurry.android.FlurryFullscreenTakeoverActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" >
</activity>
<activity
android:name=".Splash_Screen_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Upgrade_Star"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Display_Result_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".GetResultDetails"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="drc.krs.facebook_integrate.Share_On_Facebook"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".CountDown_Timer_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Examination_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Game_Play_List_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Get_Contact_List_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Your_Turn_Details_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Search_Friends_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Display_Friends_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Share_On_Twitter"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Forgot_Password_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Login_Account_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Main_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Create_Account_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".NewGame_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Settings_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Statistics_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".How_To_Play_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".About_Buzzoe_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Nationality_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Account_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="PushNotification_Alert_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
6)constant.java
===========
package com.buzzoe.android;
import android.location.LocationManager;
import drc.krs.facebook.android.Facebook;
/**
* class for declaration Variables which are used in whole Application
*/
public class Constant {
/**
* Flurry Api Key, 16 Flurry Event Logs , 7 Flurry Ads , set Cookies , Set
* Location
*/
public static class FLURRY {
// if FLURRY_EVENT_VISIBLE true then 16 event log is visible otherwise
// invisible
public static final Boolean FLURRY_EVENT_VISIBLE = true;
// if FLURRY_AD_VISIBLE true then 7 Ads are visible otherwise invisible
public static final Boolean FLURRY_AD_VISIBLE = true;
// Flurry API Key
public static final String API_KEY_PAID="MG2XXTTNN85PW48P82NZ";
public static final String API_KEY_FREE="9XFTGCCZH6N96YBWY4SW";
public static final String getAPI_KEY(){
if(FLURRY_AD_VISIBLE){
return API_KEY_FREE;
}
else{
return API_KEY_PAID;
}
}
public static final int DISPLAY_ADS_SCREEN_HEIGHT =50;
// 7 Flurry Ads
public static final String MAINPAGE_BANNER ="1. Mainpage Banner";
public static final String CREATE_GAME_BANNER="2. Create Game banner";
public static final String SELECT_FRIENDS_BANNER ="3. Select Friends Banner";
public static final String START_GAME_BANNER ="4. Start Game Banner";
public static final String RESULT_PAGE_BANNER ="5. Result Page Banner";
public static final String SETTINGS_PAGE_BANNER="6. Settings Page Banner";
public static final String RESULT_PAGE_FULL_BANNER="7. Full Page Free Game/Video";
// set Cookies
public static final String USER_ID = "user_id";
public static final String USER_NAME = "user_name";
public static final String LANGUAGE_CODE = "language_code";
// 16 Event Log
// 1 User Login Event Log
public static final String LOGIN_USER_KEY_ID = "login_user_key_id";
public static final String USER_LOGIN_EVENT = "user_login_event";
// 2 User Facebook With Login Event Log
public static final String FACEBOOK_LOGIN_USER_KEY_ID = "facebook_login_user_key_id";
public static final String USER_FACEBOOK_LOGIN_EVENT = "user_facebook_login_event";
// 3 Create New Game
public static final String CREATE_NEW_GAME_KEY = "create_new_game_key";
public static final String CREATE_A_GAME = "create_a_game";
public static final String CREATE_NEW_GAME_EVENT = "create_new_game_event";
// 4 When User Start the Game to Play
public static final String START_GAME_KEY = "start_game_key";
public static final String START_GAME = "start_game";
public static final String START_GAME_EVENT = "start_game_event";
// 5 When User go to Statistic Page
public static final String STATISTICS_KEY = "statistics_key";
public static final String STATISTICS = "statistics";
public static final String STATISTICS_EVENT = "statistics_event";
// 6 When User go to Setting Page
public static final String SETTINGS_KEY = "settings_key";
public static final String SETTINGS = "settings";
public static final String SETTINGS_EVENT = "settings_event";
// 7 When User go to display friends Activity
public static final String FRIENDS_KEY = "friends_key";
public static final String FRIENDS = "friends";
public static final String FRIENDS_EVENT = "friends_event";
// 8 When User Generate Random Game in NewGame Activity
public static final String RANDOM_KEY = "random_key";
public static final String RANDOM = "random";
public static final String RANDOM_EVENT = "random_event";
// 9 When User go to Facebook Friend Activity to send or add request
public static final String FB_FRIENDS_KEY = "fb_friends_key";
public static final String FB_FRIENDS = "fb_friends";
public static final String FB_FRIENDS_EVENT = "fb_friends_event";
// 10 When User go to 'Search By UserName' in NewGame Activity
public static final String SEARCH_BY_USERNAME_KEY = "search_by_username_key";
public static final String SEARCH_BY_USERNAME = "search_by_username";
public static final String SEARCH_BY_USERNAME_EVENT = "search_by_username_event";
// 11 When User go to 'Search from your contact list' in NewGame
// Activity
public static final String SEARCH_FROM_YOUR_CONTACTLIST_KEY = "search_from_your_contactlist_key";
public static final String SEARCH_FROM_YOUR_CONTACTLIST = "search_from_your_contactlist";
public static final String SEARCH_FROM_YOUR_CONTACTLIST_EVENT = "search_from_your_contactlist_event";
// 12 When User go to 'Search By Email' in NewGame Activity
public static final String SEARCH_BY_EMAIL_KEY = "search_by_email_key";
public static final String SEARCH_BY_EMAIL = "search_by_email";
public static final String SEARCH_BY_EMAIL_EVENT = "search_by_email_event";
// 13 Purchase Event Log in NewGame Activity
public static final String PURCHASE_KEY = "purchase_key";
public static final String PURCHASE = "purchase";
public static final String PURCHASE_EVENT = "purchase_event";
// 14 Share on Facebook Log Event in GetResultDetails file
public static final String SHARE_ON_FB_RESULT_DETAILS_KEY = "share_on_fb_result_details_key";
public static final String SHARE_ON_FB_RESULT_DETAILS = "share_on_fb_result_details";
public static final String SHARE_ON_FB_RESULT_DETAILS_EVENT = "share_on_fb_result_details_events";
// 15 Share on Facebook Log Event in upgrade star screen
public static final String SHARE_ON_FB_UPGRADE_STAR_KEY = "share_on_fb_upgrade_star_key";
public static final String SHARE_ON_FB_UPGRADE_STAR = "share_on_fb_upgrade_star";
public static final String SHARE_ON_FB_UPGRADE_STAR_EVENT = "share_on_fb_upgrade_star_events";
// 16 Share on Facebook Log Event in Display Result Activity
public static final String SHARE_ON_FB_DISPLAY_RESULT_KEY = "share_on_fb_display_result_key";
public static final String SHARE_ON_FB_DISPLAY_RESULT = "share_on_fb_display_result";
public static final String SHARE_ON_FB_DISPLAY_RESULT_EVENT = "share_on_fb_display_result_events";
}
// public static final String PROVIDER = LocationManager.GPS_PROVIDER;
// public static final String
// LOCATION_PROVIDER_DISABLED="GPS Location Provider Is Disabled";
// public static final String
// LOCATION_PROVIDER_ENABLE="GPS Location Provider Is Enable";
// Flurry Set Location
public static final String PROVIDER = LocationManager.NETWORK_PROVIDER;
public static final String LOCATION_PROVIDER_DISABLED = "Network Location Provider Is Disabled";
public static final String LOCATION_PROVIDER_ENABLE = "Network Location Provider Is Enable";
// Device Type for android Mobile
public static final String DEFAULT_DEVICE_TYPE = "2";
// Default Values
public static final String DEFAULT_VALUE = "0";
public static final String DEFAULT_VALUE_Q_TYPE = "1";
public static final String DEFAULT_ROUND = "1";
public static final String BUZZOE = "Buzzoe";
public static final String DEFAULT_LANGUAGE_ID = "3";
public static final String NUMBER_OF_QUESTIONS = "15";
public static final String GOOGLE_PLAY = "https://play.google.com/store";
public static final int EXAMINATION_DEFAULT_FLAG_VALUE = 0;
public static final int LANGUAGE_DEFAULT_POSITION = 2;
public static final int LANGUAGE_DEFAULT_VALUE = -1;
public static final int FIRST_ROUND = 1;
public static final long PROGRESS_TIME = 15000;
public static Boolean INIT_SOUND = false;
public static Boolean FULL_FLURRY = true;
public static String[] mID = null;
// Colour Name to display star image
public static final class COLOR_NAME {
public static final String GREEN = "green";
public static final String WHITE = "white";
public static final String BLACK = "black";
public static final String BLUE = "blue";
public static final String GOLD = "gold";
public static final String ORANGE = "orange";
public static final String PURPLE = "purple";
public static final String RED = "red";
public static final String DIAMOND = "diamond";
public static final String YELLOW = "yellow";
public static final String BRONZE = "bronze";
public static final String BROWN = "brown";
public static final String PINK = "pink";
}
/** Variables used For Facebook Integration */
public static final class FACEBOOK {
public static Facebook mFacebook = null;
public static final String FBAPP_ID = "335513426526276"; //iphone app id
public static final String PERMISSION[] = { Constant.FACEBOOK.PUBLISH_STREAM_PERMISSIONS, Constant.FACEBOOK.READ_STREAM_PERMISSIONS, Constant.FACEBOOK.OFFLINE_ACCESS_PERMISSIONS, Constant.FACEBOOK.EMAIL };
public static final String FACEBOOK_GOOGLE_PLAY = "market://details?id=com.facebook.katana";
public static final String INSTALL_FACEBOOK_FROM_PLAY_STORE = "Install Facebook from Play Store ";
public static final String ERROR_OCCUR_WHILE_OPENNING_PLAY_STORE_TO_INSTALL_FACEBOOK = "Error occur while openning Play Store to Install Facebook";
public static final String ImageURL = "http://180.211.110.195/php-projects/buzzoe/images/big_logo.png";
public static final String FB_URL = "https://www.facebook.com/BuZZoe";
public static final String AUTHORIZING = "Authorizing";
public static final String SOMETHING_WENT_WRONG_PLEASE_TRY_AGAIN = "Something went wrong. Please try again.";
public static final String FB_SHARE_URL = "FB_SHARE_URL";
public static final String FB_SHARE_MSG = "FB_SHARE_MSG";
public static final String FB_DATA_PARSH_MSG = "FB_DATA_PARSH_MSG";
public static final String FB_DATA_PARSH_URL = "FB_DATA_PARSH_URL";
public static final String FB_IMAGE = "ImagePath";
public static final String FB_WALL = "DisplayText";
public static final String FB_SUCESS = "Successfully";
public static final String FB_ = "Delete";
public static final String FB_DATA = "data";
public static final String FB_INSTALLED = "installed";
public static final String FB_ID = "id";
public static final String PUBLISH_STREAM_PERMISSIONS = "publish_stream";
public static final String READ_STREAM_PERMISSIONS = "read_stream";
public static final String OFFLINE_ACCESS_PERMISSIONS = "offline_access";
public static final String EMAIL = "email";
public static final String STREAM_PUBLISH = "stream.publish";
public static final String URL_GOOGLE = "http://www.google.com";
public static final String URL_PLAY = "https://play.google.com";
public static final String FB_FRIEND_REQUEST = "me/friends";
public static final String FB_INSTALLED_REQUEST_1 = "/me/friends?fields=installed&access_token=";
public static final String FB_INSTALLED_REQUEST_2 = "&sdk=android&format=json";
public static final String ACTION_CANCELED = "Action Canceled";
/*
* GRAPH API used for post to friend wall
*/
public static final class GRAPH_API_INPUT_KEY {
public static final String MESSAGE = "message";
public static final String NAME = "name";
public static final String HREF = "href";
public static final String SRC = "src";
public static final String ATTACHMENT = "attachment";
public static final String METHOD = "method";
public static final String CAPTION = "caption";
public static final String DESCRIPTION = "description";
}
public static final class GRAPH_API_INPUT_VALUE {
public static final String BUZZOE = "Buzzoe";
public static final String STREAM_PUBLISH = "stream.publish";
public static final String ACTOR_JUST_POSTED = "{*actor*} just posted a secret message.";
public static final String MESSAGE_DECODE = "A secret message is waiting for you. Click the link to decode it.";
public static final String SECRETE_MESSAGE = "A Secret Message For You";
}
// object keys to get facebook friends
public static final class Get_FBFriendsList_OBJECT_KEY {
public static final String DATA = "data";
public static final String ID = "id";
public static final String NAME = "name";
public static final String POST_ID = "post_id";
}
// Facebook Dialog Parameter values while Sharing
public static final class DIALOG_PARAMETER
{
public static final class Object_Key
{
public static final String NAME = "name";
public static final String DESCRIPTION = "description";
public static final String TYPE = "type";
public static final String SRC = "src";
public static final String MEDIA = "media";
public static final String HREF = "href";
public static final String ATTACHMENT = "attachment";
public static final String TARGET_ID = "target_id";
}
public static final class Object_Value
{
public static final String BUZZOE_APP="Buzzoe App";
public static final String IMAGE="image";
// if image not found then go to this link
public static final String PLAY_URL="http://www.play.google.com";
}
}
}
// Soap Webservice to add facebook friend to play game
public static final class FB_FRIENDS_ADD {
public static final String SOAP_METHOD = "AddToFriendListUsingFbId";
public static final String LOGIN_USER_ID = "id";
public static final String FB_FRD_ID = "fbId";
public static final String RESULT = "result";
public static final String MESSAGE = "message";
public static final String OK = "OK";
}
// Variables for Twitter Sharing
public static final class TWITTER {
public static final String TWITTER_CONSUMER_KEY = "ycwLejracx4aChmINat1Q";
public static final String TWITTER_SECRET_KEY = "T7sBuUJzAM5SRXtajiqzA495hAmNLhzJGCHWZs78";
public static final String TWITTER_URL = "http://twitter.com/GameBuZZoe";
public static final String TWITTER_COULD_NOT_POST = "could not Post";
public static final int TWITTER_MSG_LENGTH = 140;
}
// Variables for create account validation
public static final class CREATE_ACCOUNT_VALIDATION {
public static final String ENTER_PASSWORD = "Enter_Password";
public static final String ENTER_VALID_PASSWORD = "Enter Valid Password";
public static final String PASSWORD_NOT_MATCH = "Password not match";
public static final String EMAIL_VALIDATION_PATTERN = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
public static final String REPEAT_PASSWORD = ".....";
}
/** Soap web_service constant values */
public static final class SOAP_WEBSERVICE_CONSTANT {
// local test url
//public static final String SOAP_URL = "http://180.211.110.195/php-projects/buzzoe/webservices/actions?ws=1";
// live url
public static final String SOAP_URL="http://nl.buzzoe.com/webservices/actions?ws=1";
public static final String SOAP_NAMESPACE = "WebservicesControllerwsdl";
public static final String SOAP_ACTION = "WebservicesControllerwsdl";
}
// shared preference object name
public static final String SHAREDPREFERENCES = "sharedpreferences_buzzoe";
/** shared preferences object key for setting and getting values */
public static final class SHARED_KEY {
public static final String LOGIN_USERID = "login_userid_sp";
public static final String USERNAME = "username_sp";
public static final String PASSWORD = "password_sp";
public static final String DEFAULT_LANGUAGE_NAME = "default_lang_name_sp";
public static final String DEFAULT_LANGUAGE_CODE = "default_lang_code_sp";
public static final String DEFAULT_LANGUAGE_ID = "default_lang_id_sp";
public static final String DEFAULT_LANGUAGE_POSITION = "default_language_position_sp";
public static final String MODULE_NAME = "module_name_sp";
// public static final String ARR_INDEX_="arr_index_sp";
public static final String SELECTED_ID_ = "selected_id_sp";
public static final String GAME_ID = "game_id_sp";
public static final String ROUND_NO = "round_no_sp";
public static final String GAME_NAME = "game_name_sp";
public static final String DEVICE_TOKEN = "device_token_sp";
public static final String SOUND_SETTING = "sound_setting_sp";
// public static final String RANDOM_FLAGE="random_flag_sp";
public static final String PLACE = "place_sp";
public static final String FACEBOOK_ID = "Facebook_ID";
public static final String KEY = "key_sp";
public static final String USERNAME_PUSH = "username_push_sp";
public static final String FB_EMAIL = "FB_Email";
public static final String FB_UNAME = "FB_UserName";
public static final String PLAY_WITH_COMP = "playwithcomp_sp";
public static final String MESSAGE = "message_sp";
public static final String PN_GAME_ID = "pn_game_id_sp";
public static final String PN_GAME_NAME = "pn_game_name_sp";
public static final String PN_PLACE = "pn_place_sp";
public static final String PN_ROUND_NO = "pn_round_no_sp";
public static final String PN_KEY = "pn_key_sp";
public static final String PN_USER_NAME = "pn_user_name_sp";
public static final String PN_MESSAGE = "pn_message_sp";
public static final String PN_MESSAGE_KEY = "pn_message_key_sp";
public static final String PN_NUDGE = "pn_nudge_sp";
}
// shared preference object constant values
public static final class SHARED_VALUES {
public static final String FIND_FRIENDS = "find_friends";
public static final String CREATE_GAME = "create_game";
public static final String DISPLAY_FRIENDS_ACTIVITY = "Display_Friends_Activity";
public static final String MAIN_YOUR_OPPONENT = "Main_Your_Opponent";
public static final String MAIN_YOUR_TURN = "Main_Your_Turn";
public static final String MAIN_ACTIVITY = "Main_Activity";
public static final String YOUR_TURN_DETAILS_ACTIVITY = "Your_Turn_Details_Activity";
public static final String PRACTICE = "practice";
public static final String PUSHNOTIFICATION_ALERT_ACTIVITY = "PushNotification_Alert_Activity";
public static final String YES = "yes";
public static final String NO = "no";
public static final String NUDGE = "NUDGE";
public static final String WON = "won";
public static final String PLACED = "placed";
public static final String UPGRADED = "upgraded";
}
/** top tab bar constant values */
public static final class top_tabbar {
public static final String CANCEL = "";
}
/** language change alert dialog constant values */
public static final class DIALOG {
public static final class LANGUAGE_CHANGE {
public static final String TITLE = "Message";
public static final String MESSAGE1 = "Your Default Language is ";
public static final String MESSAGE2 = "\nWould You Want to Change ?";
public static final String YES = "Yes Please";
public static final String NO = "No Thanks";
}
}
/** intent constant keys and values */
public static final class INTENT {
public static final class KEY {
public static final String CREATE_ACCOUNT_KEY = "create_account_key";
public static final String SEARCH_BY = "search_by";
public static final String PUSH_MSG = "push_msg";
}
public static final class VALUES {
public static final String USERNAME = "username";
public static final String EMAIL = "email";
public static final String CREATE_ACCOUNT_VALUE = "create_account_value";
}
}
// Soap web-service for request random game to other player
public static final class REQUEST_RANDOM_PLAY {
public static final String SOAP_METHOD = "requestRandomPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
// Soap Web-Service that check request for random game to play
public static final class CHECK_REQUEST_RANDOM_PLAY {
public static final String SOAP_METHOD = "checkRequestRandomPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String FAILED = "failed";
public static final String SUCCESS = "success";
}
}
// soap webservice for cancel random play
public static final class CANCEL_RANDOM_PLAY {
public static final String SOAP_METHOD = "cancelRandomPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String FAILED = "failed";
public static final String SUCCESS = "success";
}
}
// Soap web-service to get details result of game in getResultDetails
public static final class GET_RESULT_DETAILS {
public static final String SOAP_METHOD = "getResultDetails";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String ROUND_NO = "round_no";
public static final String CODE = "code";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String ROUND_OVER = "ROUND_OVER";
public static final String RESULT = "result";
public static final String USERS = "Users";
public static final String ID = "id";
public static final String NAME = "name";
public static final String RIGHTQUSTIONS = "rightQustions";
public static final String TOTALQUSTIONS = "TotalQustions";
public static final String TOTALTIMETAKEN = "totalTimeTaken";
public static final String STAR = "star";
public static final String QUESTIONS = "Questions";
public static final String ANSWER = "answer";
public static final String IS_TRUE = "is_true";
public static final String QUESTION = "question";
public static final String TIME_TAKEN = "time_taken";
public static final String PLAYWITHCOMP = "PlayWithComp";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String PLAYWITHCOMP_TRUE = "true";
}
}
//Soap Web-Service to get user position in round in display_result_activity.java
public static final class GET_USER_POISTION_IN_ROUND {
public static final String SOAP_METHOD = "getUserPoistioninRound";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String ROUND_NO = "round_no";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "resule";
public static final String MESSAGE = "message";
public static final String KEY = "key";
public static final String PLACE = "place";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String PLACED = "placed";
}
}
// soap web-service for practice game
public static final class PRACTICE_PLAY {
public static final String SOAP_METHOD = "practicePlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String Q_TYPE = "q_type";
public static final String Q_ID = "q_id";
public static final String ANSWER = "answer";
public static final String CODE = "code";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String ID = "ID";
public static final String QUESTION = "QUESTION";
public static final String OPTION1 = "OPTION1";
public static final String OPTION2 = "OPTION2";
public static final String OPTION3 = "OPTION3";
public static final String OPTION4 = "OPTION4";
public static final String TYPE = "TYPE";
public static final String IMAGE = "IMAGE";
}
public static final class OBJECT_VALUE {
public static final String TEXT_TEXT = "Text-Text";
public static final String IMAGE_TEXT = "Image-Text";
public static final String TEXT_IMAGE = "Text-Image";
public static final String FAILED = "Failed";
public static final String SUCCESS = "Success";
}
}
// soap web-service to get questions for game in real examination
public static final class GET_QUESTIONS {
public static final String SOAP_METHOD = "GetQuestions";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String CODE = "code";
public static final String Q_TYPE = "q_type";
public static final String ROUND_NO = "round_no";
public static final String Q_ID = "q_id";
public static final String ANSWER = "answer";
public static final String Q_NO = "q_no";
public static final String TIME_TAKEN = "time_taken";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String ROUND_NO = "round_no";
public static final String Q_NO = "q_no";
public static final String ID = "ID";
public static final String TOTALQUESTION = "TOTALQUESTION";
public static final String QUESTION = "QUESTION";
public static final String OPTION1 = "OPTION1";
public static final String OPTION2 = "OPTION2";
public static final String OPTION3 = "OPTION3";
public static final String OPTION4 = "OPTION4";
public static final String TYPE = "TYPE";
public static final String IMAGE = "IMAGE";
public static final String POINTS = "points";
public static final String RESULT = "result";
public static final String ROUND_COMPLETE = "ROUND_COMPLETE";
}
public static final class OBJECT_VALUE {
public static final String YES = "YES";
public static final String TEXT_TEXT = "Text-Text";
public static final String TEXT_IMAGE = "Text-Image";
public static final String IMAGE_TEXT = "Image-Text";
}
}
public static final class GET_USER_STATISTICS {
public static final String SOAP_METHOD = "getUserStatistics";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String USERNAME = "USERNAME";
public static final String TOTAL_POINTS = "TOTAL_POINTS";
public static final String HIGHEST_ROUND_TOTAL = "HIGHEST_ROUND_TOTAL";
public static final String HIGHEST_GAMES_TOTAL = "HIGHEST_GAMES_TOTAL";
public static final String NO_OF_GAMES = "NO_OF_GAMES";
public static final String NO_OF_WINS = "NO_OF_WINS";
public static final String NO_OF_LOOSE = "NO_OF_LOOSE";
public static final String STAR = "STAR";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
/** update account web_services constant values define in Account.java */
public static final class UpdateAccount {
public static final String SOAP_METHOD = "UpdateAccount";
public static final class INPUT_KEY {
public static final String EMAIL = "email";
public static final String PASSWORD = "password";
public static final String ID = "id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String MESSAGE = "message";
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
/** get_emailID web_services constant values define in Account.java */
public static final class GET_EMAILID {
public static final String SOAP_METHOD = "GetEmailId";
public static final class INPUT_KEY {
public static final String ID = "id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String NAME = "name";
public static final String EMAIL = "email";
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
/**
* registerFromApp web_services constant values define in
* Create_account.java
*/
public static final class REGISTER_FROM_APP {
public static final String SOAP_METHOD = "registerFromApp";
public static final class INPUT_KEY {
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String EMAIL = "email";
public static final String FBID = "fbid";
public static final String PHONE_NO = "phone_no";
public static final String DEVICE_TYPE = "device_type";
public static final String DEVICE_TOKEN = "device_token";
public static final String NATIONALITY_ID = "nationality_id";
}
public static final class INPUT_VALUE {
public static final String FBID = "";
public static final String NATIONALITY_ID = "3";
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USERNAME = "username";
public static final String ERROR = "error";
public static final String ID = "id";
public static final String NATIONALITY_ID = "nationality_id";
public static final String NATIONALITY_NAME = "nationality_name";
public static final String CODE = "CODE";
public static final String EMAIL = "email";
public static final String PHONE_NO = "phone_no";
public static final String NAME = "name";
public static final String MESSAGE = "message";
public static final String FB_ID = "fb_id";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String ERROR = "error";
}
}
public static final class RECOVER_ACCOUNT {
public static final String SOAP_METHOD = "recoverAccount";
public class INPUT_KEY {
public static final String EMAIL = "email";
}
public class INPUT_VALUE {
}
public class OBJECT_KEY {
public static final String MESSAGE = "message";
public static final String RESULT = "result";
}
public class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
public static final class LOGIN_FROM_APP {
public static final String SOAP_METHOD = "loginFromApp";
public static final class INPUT_KEY {
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String DEVICE_TYPE = "device_type";
public static final String DEVICE_TOKEN = "device_token";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USER_ID = "userid";
public static final String NATIONALITY_ID = "nationality_id";
public static final String UNAME = "uname";
public static final String NATIONALITY_NAME = "nationality_name";
public static final String CODE = "CODE";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
// public static final class GetNationality
// {
// public static final String SOAP_METHOD="GetNationality";
// public static String PREDEFINE_LANGUAGE_NAME="English";
// public static String PREDEFINE_LANGUAGE_CODE="en";
// public static String PREDEFINE_LANGUAGE_ID="3";
//
// public static final class INPUT_KEY
// {
//
// }
//
// public static final class INPUT_VALUE
// {
//
// }
//
// public static final class OBJECT_KEY
// {
// public static final String NATIONALITY="NATIONALITY";
// public static final String ID="ID";
// public static final String NAME="NAME";
// public static final String CODE="CODE";
//
//
// }
//
// public static final class OBJECT_VALUE
// {
//
// }
// }
public static final class UPDATE_NATIONALITY {
public static final String SOAP_METHOD = "UpdateNationality";
public static String PREDEFINE_LANGUAGE_NAME = "English";
public static String PREDEFINE_LANGUAGE_CODE = "en";
public static String PREDEFINE_LANGUAGE_ID = "3";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String NATIONALITY_ID = "nationality_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
public static final String NATIONALITY_ID = "nationality_id";
public static final String NATIONALITY_NAME = "nationality_name";
public static final String CODE = "CODE";
}
public static final class OBJECT_VALUE {
}
}
public static final class GET_HOMESCREEN_DETAILS {
public static final String SOAP_METHOD = "getHomeScreenDetails";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String YOUR_TURN = "YourTurn";
public static final String WAITING = "Waiting";
public static final String GAME_ID = "game_id";
public static final String GAME_NAME = "game_name";
public static final String ROUND_NO = "round_no";
public static final String PLAYWITHCOMP = "PlayWithComp";
}
public static final class OBJECT_VALUE {
}
}
public static final class UPDATE_FB_ID {
public static final String SOAP_METHOD = "UpdateFbId";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String FBID = "fbid";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String result = "result";
public static final String userid = "userid";
public static final String message = "message";
public static final String nationality_id = "nationality_id";
public static final String uname = "uname";
public static final String nationality_name = "nationality_name";
public static final String CODE = "CODE";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
public static final class CHECK_FBID_EMAILID {
public static final String SOAP_METHOD = "CheckFbId_EmailId";
public static final class INPUT_KEY {
public static final String FBID = "fbId";
public static final String EMAIL = "email";
public static final String FACEBOOK_ME = "me";
public static final String FACEBOOK_ID = "id";
public static final String FACEBOOK_EMAIL = "email";
public static final String FACEBOOK_USERNAME = "username";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String result = "result";
public static final String userid = "userid";
public static final String message = "message";
public static final String nationality_id = "nationality_id";
public static final String uname = "uname";
public static final String nationality_name = "nationality_name";
public static final String CODE = "CODE";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String ERROR = "error";
}
}
public static final class HOW_TO_PLAY {
public static final String SOAP_METHOD = "HowToPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String HTML = "HTML";
public static final String MIME = "text/html";
public static final String ENCODING = "utf-8";
}
public static final class OBJECT_VALUE {
}
}
public static final class DISPLAY_FRIENDLIST {
public static final String SOAP_METHOD = "DisplayFriendList";
public static final class INPUT_KEY {
public static final String ID = "id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String FRIENDS = "FRIENDS";
public static final String ID = "ID";
public static final String NAME = "NAME";
public static final String EMAIL = "EMAIL";
public static final String PHONENO = "PHONENO";
public static final String TOTAL_POINTS = "total_points";
public static final String STAR = "star";
}
public static final class OBJECT_VALUE {
}
}
public static final class ALL_FRIENDS_NEW_VERSION {
public static final String SOAP_METHOD = "AllFriendsNewVersion";
// public static final class INPUT_KEY {
// public static final String ID = "id";
// }
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String FRIENDS = "FRIENDS";
public static final String ID = "ID";
public static final String PHONENO = "PHONENO";
public static final String FBID = "FBID";
}
public static final class OBJECT_VALUE {
}
}
public static final class SEARCH_FRIENDS
{
public static final String SOAP_METHOD = "searchFriends";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String TYPE = "type";
public static final String SEARCHSTRING = "searchString";
}
public static final class INPUT_VALUE {
public static int TYPE = 1;
}
public static final class OBJECT_KEY {
public static final String ID = "ID";
public static final String NAME = "NAME";
public static final String EMAIL = "EMAIL";
public static final String PHONENO = "PHONENO";
public static final String FLAG = "FLAG";
public static final String SUCCESS = "Success";
public static final String FRIENDS = "FRIENDS";
}
}
public static final class ADD_TO_FRIENDLIST {
public static final String SOAP_METHOD = "AddToFriendList";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String FRIEND_ID = "friendId";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String FRIENDS = "FRIENDS";
public static final String ID = "ID";
public static final String NAME = "NAME";
public static final String EMAIL = "EMAIL";
public static final String PHONENO = "PHONENO";
public static final String TOTAL_POINTS = "total_points";
public static final String STAR = "star";
}
public static final class OBJECT_VALUE {
}
}
public static final class GET_ROUND_DETAILS {
public static final String SOAP_METHOD = "getRoundDetails";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String ROUND_NO = "round_no";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USERS = "Users";
public static final String PLAYWITHCOMP = "PlayWithComp";
public static final String ROUND_NO = "round_no";
public static final String NAME = "name";
public static final String TOTAL_POINTS = "total_points";
public static final String STAR = "star";
}
public static final class OBJECT_VALUE {
public static final String PLAYWITHCOMP_TRUE = "true";
}
}
public static final class RESIGN_USER_FROM_GAME {
public static final String SOAP_METHOD = "resignUserFromGame";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
}
public static final class OBJECT_VALUE {
}
}
public static final class CREATE_GAME {
public static final String SOAP_METHOD = "CreateGame";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String GAME_NAME = "game_name";
public static final String NATIONALITY_ID = "nationality_id";
public static final String NO_OF_QUESTIONS = "no_of_questions";
public static final String FRIEND_LIST = "friend_list";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "RESULT";
public static final String GAME_ID = "GAME_ID";
public static final String CREATED_GAME = "CREATED_GAME";
public static final String ID = "ID";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "Success";
}
}
public static final class UPDATE_DEVICE_TOKEN {
public static final String SOAP_METHOD = "updateDeviceToken";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String DEVICE_TYPE = "device_type";
public static final String DEVICE_TOKEN = "device_token";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
public static final class NUDGE_USER_FROM_GAME {
public static final String SOAP_METHOD = "nudgeUserFromGame";
public static final class INPUT_KEY {
public static final String GAME_ID = "game_id";
public static final String USER_ID = "user_id";
public static final String FRIEND_USER_ID = "friend_user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String FAILED = "failed";
}
}
public static final class CHECK_CONTACT_NUMBER {
public static final String SOAP_METHOD = "checkContactNumber";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String PHONE_NO = "phone_no";
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USERID = "userID";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String FAILED = "failed";
}
}
}
=================
package com.buzzoe.android;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.flurry.android.FlurryAdSize;
import com.flurry.android.FlurryAgent;
import drc.krs.expandListView.Adapter.ExpandListAdapter;
import drc.krs.expandListView.Classes.ExpandListChild;
import drc.krs.expandListView.Classes.ExpandListGroup;
import drc.krs.facebook.android.AsyncFacebookRunner;
import drc.krs.facebook.android.AsyncFacebookRunner.RequestListener;
import drc.krs.facebook.android.DialogError;
import drc.krs.facebook.android.Facebook;
import drc.krs.facebook.android.Facebook.DialogListener;
import drc.krs.facebook.android.FacebookError;
import drc.krs.facebook.android.SessionEvents;
import drc.krs.facebook.android.SessionEvents.AuthListener;
import drc.krs.facebook.android.SessionEvents.LogoutListener;
import drc.krs.facebook.android.SessionStore;
import drc.krs.facebook.android.Util;
import drc.krs.xmlread.Dict_Language_Constant;
public class GetResultDetails extends Activity {
/** Called when the activity is first created. */
private ExpandListAdapter ExpAdapter;
private ExpandableListView ExpandList;
private SharedPreferences mSharedPreferences_Read = null, mSharedPreferences_Write = null;
private Button btn_back = null, btn_resign = null, btnStartNext = null, btn_fb_share = null;
private TextView txt_round_title = null;
private LinearLayout llresult = null, lnr_full = null;
// private Facebook facebook = null;
private CommonClass mCommonClass = null;
private HashMap<String, String> parameters = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.xresult);
Memory_Alloc();
if (mCommonClass.CheckNetwork(this)) {
new GetResultDetail().execute("");
}
btn_back.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
finish();
}
});
btn_resign.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {
if (mCommonClass.CheckNetwork(getBaseContext())) {
alert_lang_change();
}
}
});
btnStartNext.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
int round_no = Integer.parseInt(mSharedPreferences_Read.getString(Constant.SHARED_KEY.ROUND_NO, ""));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.PUSHNOTIFICATION_ALERT_ACTIVITY)) {
round_no = round_no + 1;
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.ROUND_NO, String.valueOf(round_no));
editor.commit();
}
Intent mIntent = new Intent(GetResultDetails.this, Your_Turn_Details_Activity.class);
mIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(mIntent);
finish();
}
});
btn_fb_share.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
FaceBook_Flurry_Event();
if (Constant.FACEBOOK.mFacebook == null) {
Constant.FACEBOOK.mFacebook = new Facebook(Constant.FACEBOOK.FBAPP_ID);
}
System.out.println("GetResult activity session :" + Constant.FACEBOOK.mFacebook.isSessionValid());
if (Constant.FACEBOOK.mFacebook.isSessionValid()) {
String FB_str = String.format(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.PLAYED_BUZZOE_TAG, ""), mSharedPreferences_Read.getString(Constant.SHARED_KEY.USERNAME, ""));
Constant.FACEBOOK.mFacebook.setText(FB_str);
int Type = 1;
Constant.FACEBOOK.mFacebook.dialog(GetResultDetails.this, Type, Constant.FACEBOOK.STREAM_PUBLISH, new TestUiServerListener());
} else {
Constant.FACEBOOK.mFacebook.authorize(GetResultDetails.this, Constant.FACEBOOK.FBAPP_ID, Constant.FACEBOOK.PERMISSION, new LoginDialogListener());
}
}
});
// if (mCommonClass.CheckNetwork(this)) {
// new getHomeScreenDetails_GetWebData().execute("");
// }
}
public class TestUiServerListener implements DialogListener {
public void onComplete(Bundle values) {
final String postId = values.getString("post_id");
if (postId != null) {
Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
new AsyncFacebookRunner(Constant.FACEBOOK.mFacebook).request(postId, new TestPostRequestListener());
} else {
GetResultDetails.this.runOnUiThread(new Runnable() {
public void run() {
System.out.println("Fail");
}
});
}
}
public void onCancel() {
}
public void onError(DialogError e) {
e.printStackTrace();
}
public void onFacebookError(FacebookError e) {
e.printStackTrace();
}
}
public class TestPostRequestListener implements RequestListener {
public void onComplete(final String response) {
Log.d("Tests", "Got response: " + response);
try {
org.json.JSONObject json = Util.parseJson(response);
// final String message = json.getString("message");
String postId = json.getString("id");
GetResultDetails.this.runOnUiThread(new Runnable() {
public void run() {
System.out.println("Wall Success");
}
});
Log.d("Tests", "Testing wall post delete");
} catch (Throwable e) {
e.printStackTrace();
GetResultDetails.this.runOnUiThread(new Runnable() {
public void run() {
System.out.println("Wall Fail");
}
});
}
}
public void onFacebookError(FacebookError e) {
e.printStackTrace();
}
public void onFileNotFoundException(FileNotFoundException e) {
e.printStackTrace();
}
public void onIOException(IOException e) {
e.printStackTrace();
}
public void onMalformedURLException(MalformedURLException e) {
e.printStackTrace();
}
@Override
public void onComplete(String response, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onIOException(IOException e, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onFileNotFoundException(FileNotFoundException e, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onMalformedURLException(MalformedURLException e, Object state) {
// TODO Auto-generated method stub
}
@Override
public void onFacebookError(FacebookError e, Object state) {
// TODO Auto-generated method stub
}
}
private void alert_lang_change() {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(GetResultDetails.this);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, "")).setMessage(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.ARE_YOU_SURE_YOU_WANT_TO_RESIGN_FROM_THE_GAME_TAG, "")).setCancelable(false).setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).setNegativeButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YES_SURE_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (mCommonClass.CheckNetwork(GetResultDetails.this)) {
new ResignUserFromGame_GetWebData().execute("");
}
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
private final class LoginDialogListener implements DialogListener {
public void onComplete(Bundle values) {
SessionEvents.onLoginSuccess();
}
public void onFacebookError(FacebookError error) {
SessionEvents.onLoginError(error.getMessage());
}
public void onError(DialogError error) {
SessionEvents.onLoginError(error.getMessage());
}
public void onCancel() {
SessionEvents.onLoginError("Action Canceled");
}
}
private void Memory_Alloc() {
mSharedPreferences_Read = getSharedPreferences(Constant.SHAREDPREFERENCES, MODE_WORLD_READABLE);
mSharedPreferences_Write = getSharedPreferences(Constant.SHAREDPREFERENCES, MODE_WORLD_WRITEABLE);
ExpandList = (ExpandableListView) findViewById(R.id.ExpList);
btn_back = (Button) findViewById(R.id.btn_back);
btn_resign = (Button) findViewById(R.id.btn_resign);
btnStartNext = (Button) findViewById(R.id.btnStartNext);
btn_fb_share = (Button) findViewById(R.id.btn_fb_share);
txt_round_title = (TextView) findViewById(R.id.txt_round_title);
llresult = (LinearLayout) findViewById(R.id.llresult);
llresult.setLayoutParams(new LinearLayout.LayoutParams(getResources().getDisplayMetrics().widthPixels, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, Constant.FLURRY.DISPLAY_ADS_SCREEN_HEIGHT, getResources().getDisplayMetrics())));
lnr_full = (LinearLayout) findViewById(R.id.lnr_full);
if (Constant.FACEBOOK.mFacebook == null) {
Constant.FACEBOOK.mFacebook = new Facebook(Constant.FACEBOOK.FBAPP_ID);
}
if (!Constant.FACEBOOK.mFacebook.isSessionValid()) {
SessionStore.restore(Constant.FACEBOOK.mFacebook, this);
}
SessionEvents.addAuthListener(new SampleAuthListener());
SessionEvents.addLogoutListener(new SampleLogoutListener());
mCommonClass = new CommonClass();
parameters = new HashMap<String, String>();
// Constant.FACEBOOK.mFacebook = new Facebook(Constant.FACEBOOK.FB_ID);
}
private void Set_Values() {
System.out.println("module name :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, ""));
int previus_round = Integer.parseInt(mSharedPreferences_Read.getString(Constant.SHARED_KEY.ROUND_NO, ""));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_TURN)) {
previus_round = previus_round - 1;
}
txt_round_title.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.RESULTS_ROUND_TAG, "") + " " + String.valueOf(previus_round));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_TURN)) {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.START_THE_NEXT_ROUND_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab);
btnStartNext.setEnabled(true);
} else if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_OPPONENT)) {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.WAITING_FOR_OPPONENTS_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab_selected);
btnStartNext.setEnabled(false);
} else if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.PUSHNOTIFICATION_ALERT_ACTIVITY)) {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.START_THE_NEXT_ROUND_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab);
btnStartNext.setEnabled(true);
} else {
btnStartNext.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.WAITING_FOR_OPPONENTS_TAG, ""));
btnStartNext.setBackgroundResource(R.drawable.bottom_tab_selected);
btnStartNext.setEnabled(false);
}
btn_back.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.HOME_TAG, ""));
btn_resign.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.RESIGN_TAG, ""));
btn_fb_share.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.SHARE_ON_FACEBOOK_TAG, ""));
}
@Override
protected void onResume() {
super.onResume();
runOnUiThread(new Runnable() {
@Override
public void run() {
Set_Values();
SoundEngine.sharedEngine().resumeSound(GetResultDetails.this);
SoundEngine.sharedEngine().playSound(GetResultDetails.this, R.raw.buzzoe, true);
}
});
}
@Override
protected void onStart() {
super.onStart();
new Start_Result_Details().execute("");
}
private class Start_Result_Details extends AsyncTask<String, String, String> {
@Override
protected String doInBackground(String... params) {
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE || Constant.FLURRY.FLURRY_AD_VISIBLE) {
FlurryAgent.onStartSession(GetResultDetails.this, Constant.FLURRY.getAPI_KEY());
}
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE) {
FlurryAgent.setLogEnabled(true);
FlurryAgent.setLogLevel(Log.VERBOSE);
}
return "";
}
@Override
protected void onPostExecute(String result) {
if (Constant.FLURRY.FLURRY_AD_VISIBLE) {
if (FlurryAgent.isAdAvailable(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_BANNER, FlurryAdSize.BANNER_BOTTOM, 10000)) {
FlurryAgent.initializeAds(GetResultDetails.this);
FlurryAgent.getAd(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_BANNER, llresult, FlurryAdSize.BANNER_BOTTOM, 10000);
llresult.setVisibility(LinearLayout.VISIBLE);
}
Bundle mBundle = getIntent().getExtras();
if (mBundle != null) {
if (mBundle.getBoolean("show", false)) {
if (Constant.FULL_FLURRY) {
if (FlurryAgent.isAdAvailable(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_FULL_BANNER, FlurryAdSize.FULLSCREEN, 10000)) {
FlurryAgent.initializeAds(GetResultDetails.this);
FlurryAgent.getAd(GetResultDetails.this, Constant.FLURRY.RESULT_PAGE_FULL_BANNER, lnr_full, FlurryAdSize.FULLSCREEN, 10000);
Constant.FULL_FLURRY = false;
lnr_full.setVisibility(LinearLayout.VISIBLE);
}
}
}
}
}
super.onPostExecute(result);
}
}
@Override
protected void onStop() {
super.onStop();
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE || Constant.FLURRY.FLURRY_AD_VISIBLE) {
FlurryAgent.onEndSession(this);
}
}
private void FaceBook_Flurry_Event() {
if (Constant.FLURRY.FLURRY_EVENT_VISIBLE) {
Log.d("Flurry", "Share on FB ResultDetails Session");
parameters.put(Constant.FLURRY.SHARE_ON_FB_RESULT_DETAILS_KEY, Constant.FLURRY.SHARE_ON_FB_RESULT_DETAILS);
FlurryAgent.logEvent(Constant.FLURRY.SHARE_ON_FB_RESULT_DETAILS_EVENT, parameters);
}
}
@Override
protected void onPause() {
SoundEngine.sharedEngine().pauseSound();
super.onPause();
}
public class SampleAuthListener implements AuthListener {
public void onAuthSucceed() {
}
public void onAuthFail(String error) {
// mText.setText("Login Failed: " + error);
}
}
public class SampleLogoutListener implements LogoutListener {
public void onLogoutBegin() {
// mText.setText("Logging out...");
}
public void onLogoutFinish() {
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
finish();
}
return super.onKeyDown(keyCode, event);
}
public class GetResultDetail extends AsyncTask<String, String, String> {
private String SOAP_NAMESPACE = null;
private String SOAP_URL = null;
private String SOAP_ACTION = null;
private String SOAP_METHOD = null;
private ProcessDialog mProcessDialog = null;
@Override
protected void onPreExecute() {
mProcessDialog = new ProcessDialog(GetResultDetails.this, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""), mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG, ""), false);
SOAP_URL = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
SOAP_ACTION = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
SOAP_NAMESPACE = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
SOAP_METHOD = Constant.GET_RESULT_DETAILS.SOAP_METHOD;
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
SOAPService mSOAPService = new SOAPService(SOAP_URL, SOAP_ACTION, SOAP_NAMESPACE, SOAP_METHOD);
String keyName[] = { Constant.GET_RESULT_DETAILS.INPUT_KEY.USER_ID, Constant.GET_RESULT_DETAILS.INPUT_KEY.GAME_ID, Constant.GET_RESULT_DETAILS.INPUT_KEY.ROUND_NO, Constant.GET_RESULT_DETAILS.INPUT_KEY.CODE };
int previus_round = Integer.parseInt(mSharedPreferences_Read.getString(Constant.SHARED_KEY.ROUND_NO, ""));
if (mSharedPreferences_Read.getString(Constant.SHARED_KEY.MODULE_NAME, "").equalsIgnoreCase(Constant.SHARED_VALUES.MAIN_YOUR_TURN)) {
previus_round = previus_round - 1;
}
String keyValue[] = { mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, ""), mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID, ""), String.valueOf(previus_round), mSharedPreferences_Read.getString(Constant.SHARED_KEY.DEFAULT_LANGUAGE_CODE, "") };
System.out.println("get result details --------------> " + "login user id :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, "") + " game id :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID, "") + " " + " round no :" + String.valueOf(previus_round) + " " + " lang code :" + mSharedPreferences_Read.getString(Constant.SHARED_KEY.DEFAULT_LANGUAGE_CODE, ""));
return mSOAPService.getSoapData(keyName, keyValue);
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
if (mProcessDialog != null)
if (mProcessDialog.isShowing()) {
mProcessDialog.dismiss();
}
if (result != null) {
System.out.println("getResultDetails:- " + result);
String strSuccess;
try {
ArrayList<ExpandListGroup> mExpandListGroup = new ArrayList<ExpandListGroup>();
ArrayList<ExpandListChild> mExLChild = null;
JSONObject mJsonObject = new JSONObject(result);
if (mJsonObject != null) {
String PlayWithComp = "";
if (mJsonObject.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.PLAYWITHCOMP)) {
PlayWithComp = mJsonObject.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.PLAYWITHCOMP).toString();
if (PlayWithComp.equalsIgnoreCase(Constant.GET_RESULT_DETAILS.OBJECT_VALUE.PLAYWITHCOMP_TRUE)) {
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, Constant.GET_RESULT_DETAILS.OBJECT_VALUE.PLAYWITHCOMP_TRUE);
editor.commit();
alert_msg();
} else {
ArrayList<Boolean> Array_Not_Zero = new ArrayList<Boolean>();
strSuccess = mJsonObject.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.RESULT).toString();
if (strSuccess.equals(Constant.GET_RESULT_DETAILS.OBJECT_VALUE.SUCCESS)) {
JSONArray jArray_Users = mJsonObject.getJSONArray(Constant.GET_RESULT_DETAILS.OBJECT_KEY.USERS);
if (jArray_Users.length() <= 1) {
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, Constant.GET_RESULT_DETAILS.OBJECT_VALUE.PLAYWITHCOMP_TRUE);
editor.commit();
alert_msg();
} else {
if (jArray_Users != null) {
for (int i = 0; i < jArray_Users.length(); i++) {
JSONObject jobresult = jArray_Users.getJSONObject(i);
ExpandListGroup gru1 = new ExpandListGroup();
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ID)) {
gru1.setId(jobresult.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ID).toString().trim());
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.NAME)) {
gru1.setName(jobresult.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.NAME).toString().trim());
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.RIGHTQUSTIONS)) {
gru1.setRightQustions(jobresult.getInt(Constant.GET_RESULT_DETAILS.OBJECT_KEY.RIGHTQUSTIONS));
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALQUSTIONS)) {
gru1.setTotalQustions(jobresult.getInt(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALQUSTIONS));
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALTIMETAKEN)) {
gru1.setTotalTimeTaken(jobresult.getInt(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TOTALTIMETAKEN));
}
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.STAR)) {
gru1.setStar(jobresult.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.STAR).toString().trim());
}
JSONArray jArrayQueston = null;
if (jobresult.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTIONS)) {
jArrayQueston = jobresult.getJSONArray(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTIONS);
}
if (jArrayQueston != null) {
mExLChild = new ArrayList<ExpandListChild>();
if (jArrayQueston.length() > 0) {
Array_Not_Zero.add(true);
} else {
Array_Not_Zero.add(false);
}
for (int j = 0; j < jArrayQueston.length(); j++) {
JSONObject jsonObjectQuestions = jArrayQueston.getJSONObject(j);
ExpandListChild ch1_1 = new ExpandListChild();
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ANSWER)) {
ch1_1.setAnswer(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ANSWER).toString().trim());
}
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.IS_TRUE)) {
ch1_1.setIs_true(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.IS_TRUE).toString().trim());
}
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTION)) {
ch1_1.setQuestion(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.QUESTION).toString().trim());
}
if (jsonObjectQuestions.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TIME_TAKEN)) {
ch1_1.setTime_taken(jsonObjectQuestions.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.TIME_TAKEN).toString().trim());
}
mExLChild.add(ch1_1);
}
gru1.setChildItems(mExLChild);
}
mExpandListGroup.add(gru1);
}
}
}
}
String Round_over = "0";
if (mJsonObject.has(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ROUND_OVER)) {
Round_over = mJsonObject.getString(Constant.GET_RESULT_DETAILS.OBJECT_KEY.ROUND_OVER).toString();
}
ExpAdapter = new ExpandListAdapter(GetResultDetails.this, mExpandListGroup, Round_over, Array_Not_Zero);
ExpandList.setAdapter(ExpAdapter);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
private class ResignUserFromGame_GetWebData extends AsyncTask<String, String, String> {
private String SOAP_URL = null;
private String SOAP_NAMESPACE = null;
private String SOAP_ACTION = null;
private String SOAP_METHOD = null;
private ProcessDialog mProcessDialog = null;
@Override
protected void onPreExecute() {
SOAP_URL = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
SOAP_NAMESPACE = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
SOAP_ACTION = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
SOAP_METHOD = Constant.RESIGN_USER_FROM_GAME.SOAP_METHOD;
mProcessDialog = new ProcessDialog(GetResultDetails.this, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""), mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG, ""), false);
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
SOAPService mSoapService = new SOAPService(SOAP_URL, SOAP_ACTION, SOAP_NAMESPACE, SOAP_METHOD);
String keyName[] = { Constant.RESIGN_USER_FROM_GAME.INPUT_KEY.GAME_ID, Constant.RESIGN_USER_FROM_GAME.INPUT_KEY.USER_ID };
// System.out.println("gameid :"+mBundle.getString("game_id")
// +" userid:"+mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID,""));
String keyValue[] = { mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID, ""), mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, "") };
return mSoapService.getSoapData(keyName, keyValue);
}
@Override
protected void onPostExecute(String result) {
if (mProcessDialog != null)
if (mProcessDialog.isShowing()) {
mProcessDialog.cancel();
}
if (result != null) {
System.out.println(result);
if (!mSharedPreferences_Read.getString(Constant.SHARED_KEY.PLAY_WITH_COMP, "").equalsIgnoreCase("true")) {
alert_success_resign_msg();
} else {
Editor editor = mSharedPreferences_Write.edit();
editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, "false");
editor.commit();
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(in);
finish();
}
} else {
Toast.makeText(GetResultDetails.this, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_INTERNET_CONNECTION_FOUND_TO_PLAY_BUZZOE_YOU_NEED_CONNECTION_TO_THE_INTERNET_TAG, ""), Toast.LENGTH_LONG).show();
}
super.onPostExecute(result);
}
}
private void alert_success_resign_msg() {
SharedPreferences mSharedPreferences_Read = getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""));
String msg = mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YOU_HAVE_SUCCESSFULLY_RESIGNED_FROM_THE_GAME_TAG, "");
msg = String.format(msg, mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_NAME, ""));
alertDialogBuilder.setMessage(msg).setCancelable(false).setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.OK_C_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent in = new Intent(GetResultDetails.this, Main_Activity.class);
startActivity(in);
in.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
finish();
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
// private class getHomeScreenDetails_GetWebData extends AsyncTask<String,
// String, String> {
//
// private String SOAP_URL = null;
// private String SOAP_NAMESPACE = null;
// private String SOAP_ACTION = null;
// private String SOAP_METHOD = null;
// private ProcessDialog mProcessDialog = null;
//
// @Override
// protected void onPreExecute() {
// mProcessDialog = new ProcessDialog(GetResultDetails.this,
// mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG,
// ""),
// mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG,
// ""), false);
// SOAP_URL = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
// SOAP_NAMESPACE = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
// SOAP_ACTION = Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
// SOAP_METHOD = Constant.GET_HOMESCREEN_DETAILS.SOAP_METHOD;
// super.onPreExecute();
// }
//
// @Override
// protected String doInBackground(String... params) {
//
// SOAPService mSOAPService = new SOAPService(SOAP_URL, SOAP_ACTION,
// SOAP_NAMESPACE, SOAP_METHOD);
// String keyName[] = { Constant.GET_HOMESCREEN_DETAILS.INPUT_KEY.USER_ID };
// String keyValue[] = {
// mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID, "")
// };
// return mSOAPService.getSoapData(keyName, keyValue);
// }
//
// @Override
// protected void onPostExecute(String result) {
// if(mProcessDialog!=null)
// if(mProcessDialog.isShowing()){
// mProcessDialog.cancel();
// }
//
// JSONObject mJSON_Result = null, mJSON_Yourturn = null;
// JSONArray mJSON_Yourturn_Array = null;
// int turn_count = 0;
//
// if (result != null) {
// try {
// System.out.println("getHomeScreenDetails_GetWebData response:=" +
// result);
// mJSON_Result = new JSONObject(result);
//
// if (mJSON_Result.getString("result").equals("success")) {
// mJSON_Yourturn_Array = new
// JSONArray(mJSON_Result.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.YOUR_TURN));
// turn_count = mJSON_Yourturn_Array.length();
// //
// System.out.println("getHomeScreenDetails_GetWebData turn count:="+turn_count);
// //
// System.out.println("getHomeScreenDetails_GetWebData Shared Game ID :="+mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID,
// // ""));
//
// for (int i = 0; i < turn_count; i++) {
// mJSON_Yourturn = new JSONObject(mJSON_Yourturn_Array.getString(i));
// //
// System.out.println("getHomeScreenDetails_GetWebData GameID :="+mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.GAME_ID));
//
// if
// (mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.GAME_ID).equalsIgnoreCase(mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID,
// ""))) {
//
// //
// System.out.println("getHomeScreenDetails_GetWebData Game ID Compare True ");
// //
// System.out.println("getHomeScreenDetails_GetWebData PlayWithComp "+mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.PLAYWITHCOMP));
// if
// (mJSON_Yourturn.getString(Constant.GET_HOMESCREEN_DETAILS.OBJECT_KEY.PLAYWITHCOMP).equalsIgnoreCase("true"))
// {
//
// //
// System.out.println("getHomeScreenDetails_GetWebData PlayWithComp Compare True ");
//
// Editor editor = mSharedPreferences_Write.edit();
// editor.putString(Constant.SHARED_KEY.PLAY_WITH_COMP, "true");
// editor.commit();
//
// alert_msg();
// }
// }
// }
//
// }
//
// // System.out.println("result :" +
// // mJSON_Result.getString("result"));
// // System.out.println("YourTurn :" +
// // mJSON_Result.getString("YourTurn"));
// //
// // System.out.println("Waiting :" +
// // mJSON_Result.getString("Waiting"));
//
// } catch (Exception e) {
// e.printStackTrace();
// }
// } else {
// Toast.makeText(GetResultDetails.this,
// mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_INTERNET_CONNECTION_FOUND_TO_PLAY_BUZZOE_YOU_NEED_CONNECTION_TO_THE_INTERNET_TAG,""),
// Toast.LENGTH_LONG).show();
// }
// super.onPostExecute(result);
// }
// }
private void alert_msg() {
System.out.println("getHomeScreenDetails_GetWebData Alert ");
SharedPreferences mSharedPreferences_Read = getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG, ""));
alertDialogBuilder.setMessage(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.ALL_THE_OTHER_PLAYERS_HAVE_RESIGNED_FROM_THE_GAME_TAG, "")).setCancelable(false).setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.OK_C_TAG, ""), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (mCommonClass.CheckNetwork(GetResultDetails.this)) {
new ResignUserFromGame_GetWebData().execute("");
}
// Intent mIntent = new Intent(GetResultDetails.this, Main_Activity.class);
// mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// finish();
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
}
2)create package drc.krs.expandListView.Adapter
==============================
1)ExpandListAdapter.java
=================
package drc.krs.expandListView.Adapter;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.AsyncTask;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.buzzoe.android.Constant;
import com.buzzoe.android.ProcessDialog;
import com.buzzoe.android.R;
import com.buzzoe.android.SOAPService;
import drc.krs.expandListView.Classes.ExpandListChild;
import drc.krs.expandListView.Classes.ExpandListGroup;
import drc.krs.xmlread.Dict_Language_Constant;
public class ExpandListAdapter extends BaseExpandableListAdapter {
private Context context;
private ArrayList<ExpandListGroup> groups;
private String Round_over="";
private ArrayList<Boolean> Array_Not_Zero=new ArrayList<Boolean>();
private String Green_Color="#39b708";
private SharedPreferences mSharedPreferences_Read=null;
public ExpandListAdapter(Context context, ArrayList<ExpandListGroup> groups,String Round_over,ArrayList<Boolean> Array_Not_Zero) {
this.context = context;
this.groups = groups;
this.Round_over=Round_over;
this.Array_Not_Zero=Array_Not_Zero;
mSharedPreferences_Read=context.getSharedPreferences(Constant.SHAREDPREFERENCES, context.MODE_WORLD_READABLE);
}
// public void addItem(ExpandListChild item, ExpandListGroup group) {
// if (!groups.contains(group)) {
// groups.add(group);
// }
// int index = groups.indexOf(group);
// ArrayList<ExpandListChild> ch = groups.get(index).getItems();
// ch.add(item);
// groups.get(index).setItems(ch);
// }
public Object getChild(int groupPosition, int childPosition) {
ArrayList<ExpandListChild> chList = groups.get(groupPosition).getChildItems();
return chList.get(childPosition);
}
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertview, ViewGroup parent) {
ExpandListChild child = (ExpandListChild) getChild(groupPosition, childPosition);
ChildHolder childHolder;
if (convertview == null) {
LayoutInflater infalInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertview = infalInflater.inflate(R.layout.xresult_child_row, null);
childHolder=new ChildHolder();
childHolder.txt_queindex = (TextView) convertview.findViewById(R.id.txt_queindex);
childHolder.txt_questions = (TextView) convertview.findViewById(R.id.txt_questions);
childHolder.txt_time = (TextView) convertview.findViewById(R.id.txt_time);
childHolder.txt_answer = (TextView) convertview.findViewById(R.id.txt_answer);
convertview.setTag(childHolder);
}
else {
childHolder = (ChildHolder) convertview.getTag();
}
childHolder.txt_queindex.setText(String.valueOf(childPosition + 1));
childHolder.txt_questions.setText(child.getQuestion());
childHolder.txt_time.setText(child.getTime_taken() + " sec");
if(child.getIs_true().toString().trim().equals("1")){
childHolder.txt_answer.setTextColor(Color.parseColor(Green_Color));
}
else{
childHolder.txt_answer.setTextColor(Color.RED);
}
childHolder.txt_answer.setText(child.getAnswer());
return convertview;
}
class ChildHolder {
TextView txt_queindex,txt_questions,txt_time,txt_answer;
}
public int getChildrenCount(int groupPosition) {
ArrayList<ExpandListChild> chList = groups.get(groupPosition).getChildItems();
System.out.println("chList===" +chList);
return chList.size();
}
public Object getGroup(int groupPosition) {
return groups.get(groupPosition);
}
public int getGroupCount() {
return groups.size();
}
public long getGroupId(int groupPosition) {
return groupPosition;
}
public View getGroupView(int groupPosition, boolean isLastChild, View convertview,ViewGroup parent) {
ExpandListGroup group = (ExpandListGroup)getGroup(groupPosition);
GroupHolder groupHolder;
if (convertview == null) {
LayoutInflater mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertview = mLayoutInflater.inflate(R.layout.xresult_group_row, null);
groupHolder = new GroupHolder();
groupHolder.img_star = (ImageView) convertview.findViewById(R.id.img_star);
groupHolder.img_invisible_star = (ImageView)convertview.findViewById(R.id.img_invisible_star);
groupHolder.txt_Name = (TextView)convertview.findViewById(R.id.txt_Name);
groupHolder.result_progressbar = (TextProgressBar)convertview.findViewById(R.id.result_progressbar);
groupHolder.txt_Pending = (TextView)convertview.findViewById(R.id.txt_Pending);
groupHolder.txt_Pending.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.PENDING_TAG, ""));
groupHolder.img_Arrow = (ImageView)convertview.findViewById(R.id.img_Arrow);
groupHolder.img_Nudge = (Button)convertview.findViewById(R.id.img_Nudge);
groupHolder.img_Nudge.setText(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NUDGE_TAG, ""));
groupHolder.img_Nudge.setTag(group.getId());
groupHolder.img_Nudge.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
alert_lang_change(v.getTag().toString());
}
});
convertview.setTag(groupHolder);
}
else {
groupHolder = (GroupHolder) convertview.getTag();
}
setStarImage(group.getStar(),groupHolder.img_star);
groupHolder.txt_Name.setText(group.getName());
groupHolder.result_progressbar.setMax(group.getTotalQustions());
groupHolder.result_progressbar.setMinutes(group.getTotalTimeTaken());
groupHolder.result_progressbar.setProgress(group.getRightQustions());
groupHolder.result_progressbar.Update_UI();
if(Array_Not_Zero.get(groupPosition)){
groupHolder.img_invisible_star.setVisibility(ImageView.GONE);
groupHolder.txt_Pending.setVisibility(TextView.GONE);
groupHolder.img_Nudge.setVisibility(ImageView.GONE);
groupHolder.result_progressbar.setVisibility(TextProgressBar.VISIBLE);
groupHolder.img_Arrow.setVisibility(ImageView.VISIBLE);
}
else{
if(Round_over.equals("0")){
groupHolder.img_invisible_star.setVisibility(ImageView.INVISIBLE);
groupHolder.txt_Pending.setVisibility(TextView.VISIBLE);
groupHolder.img_Nudge.setVisibility(ImageView.VISIBLE);
groupHolder.result_progressbar.setVisibility(TextProgressBar.GONE);
groupHolder.img_Arrow.setVisibility(ImageView.GONE);
}
else{
groupHolder.img_invisible_star.setVisibility(ImageView.GONE);
groupHolder.txt_Pending.setVisibility(TextView.VISIBLE);
groupHolder.img_Nudge.setVisibility(ImageView.GONE);
groupHolder.result_progressbar.setVisibility(TextProgressBar.GONE);
groupHolder.img_Arrow.setVisibility(ImageView.GONE);
}
}
return convertview;
}
private void alert_lang_change(final String view_tag)
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
alertDialogBuilder.setTitle(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG,""))
.setMessage(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.ARE_YOU_SURE_YOU_WANT_TO_NUDGE_THE_USER_TAG,""))
.setCancelable(false)
.setPositiveButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.NO_TAG,""),new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
dialog.cancel();
}
})
.setNegativeButton(mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YES_SURE_TAG,""),new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
new nudgeUserFromGame_GetWebData().execute(view_tag);
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
class GroupHolder {
ImageView img_star,img_invisible_star,img_Arrow;
TextView txt_Name ,txt_Pending;
TextProgressBar result_progressbar;
Button img_Nudge ;
}
/**This function use for set star*/
private void setStarImage(String str_star,ImageView img_star){
if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.GREEN))
{
img_star.setImageResource(R.drawable.green);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.WHITE))
{
img_star.setImageResource(R.drawable.white);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BLACK))
{
img_star.setImageResource(R.drawable.black);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BLUE))
{
img_star.setImageResource(R.drawable.blue);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.GOLD))
{
img_star.setImageResource(R.drawable.gold);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.ORANGE))
{
img_star.setImageResource(R.drawable.orange);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.PURPLE))
{
img_star.setImageResource(R.drawable.purple);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.RED))
{
img_star.setImageResource(R.drawable.red);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.YELLOW))
{
img_star.setImageResource(R.drawable.yellow);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BRONZE))
{
img_star.setImageResource(R.drawable.bronze);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.BROWN))
{
img_star.setImageResource(R.drawable.brown);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.PINK))
{
img_star.setImageResource(R.drawable.pink);
}
else if(str_star.equalsIgnoreCase(Constant.COLOR_NAME.DIAMOND))
{
img_star.setImageResource(R.drawable.diamond);
}
}
public boolean hasStableIds() {
return true;
}
public boolean isChildSelectable(int arg0, int arg1) {
return true;
}
private class nudgeUserFromGame_GetWebData extends AsyncTask<String, String, String>
{
private String SOAP_URL=null;
private String SOAP_NAMESPACE=null;
private String SOAP_ACTION=null;
private String SOAP_METHOD=null;
private ProcessDialog mProcessDialog=null;
@Override
protected void onPreExecute() {
SOAP_URL=Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_URL;
SOAP_NAMESPACE=Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_NAMESPACE;
SOAP_ACTION=Constant.SOAP_WEBSERVICE_CONSTANT.SOAP_ACTION;
SOAP_METHOD=Constant.NUDGE_USER_FROM_GAME.SOAP_METHOD;
mProcessDialog=new ProcessDialog(context, mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.MESSAGE_TAG,""), mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.LOADING_TAG,""),false);
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
SOAPService mSoapService=new SOAPService(SOAP_URL, SOAP_ACTION, SOAP_NAMESPACE, SOAP_METHOD);
String keyName[]={Constant.NUDGE_USER_FROM_GAME.INPUT_KEY.GAME_ID,Constant.NUDGE_USER_FROM_GAME.INPUT_KEY.USER_ID,Constant.NUDGE_USER_FROM_GAME.INPUT_KEY.FRIEND_USER_ID};
String keyValue[]={mSharedPreferences_Read.getString(Constant.SHARED_KEY.GAME_ID,""),mSharedPreferences_Read.getString(Constant.SHARED_KEY.LOGIN_USERID,""),params[0]};
return mSoapService.getSoapData(keyName, keyValue);
}
@Override
protected void onPostExecute(String result) {
if(mProcessDialog!=null)
if(mProcessDialog.isShowing()){
mProcessDialog.cancel();
}
if(result!=null)
{
try
{
JSONObject mJsonObject=new JSONObject(result);
if(mJsonObject.getString("result").equalsIgnoreCase("success"))
{
//message(mJsonObject.getString("message"));
String msg=mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YOU_HAVE_SUCCESFULLY_NUDGED_THE_USER_TAG,"");
message(msg);
}
else if(mJsonObject.getString("result").equalsIgnoreCase("failed"))
{
String msg=mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.YOU_HAVE_ALREADY_NUDGED_THE_USER_TAG,"");
message(msg);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
super.onPostExecute(result);
}
}
public void message(String str)
{
Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
}
}
2)TextProgressBar.java
package drc.krs.expandListView.Adapter;
import com.buzzoe.android.Constant;
import drc.krs.xmlread.Dict_Language_Constant;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.ProgressBar;
public class TextProgressBar extends ProgressBar {
private SharedPreferences mSharedPreferences_Read=null;
private String outof ="";
private String minutes = "";
private Paint textPaint;
private int max = 15 , progress = 0;
public TextProgressBar(Context context) {
super(context);
mSharedPreferences_Read=context.getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setAntiAlias(true);
textPaint.setTextSize(18);
}
public TextProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
mSharedPreferences_Read=context.getSharedPreferences(Constant.SHAREDPREFERENCES, Context.MODE_WORLD_READABLE);
textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setAntiAlias(true);
textPaint.setTextSize(18);
}
@Override
public void setMax(int max) {
super.setMax(max);
this.max=max;
}
public void setMinutes(int Seconds) {
this.minutes=Second_To_Minutes(Seconds);
}
private String Second_To_Minutes(int Seconds) {
int mMinutes = Seconds / 60;
int mFractionMinute = Seconds % 60;
return ("" + mMinutes + ":" + mFractionMinute + mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.M_TAG, ""));
}
public void Update_UI(){
drawableStateChanged();
invalidate();
}
@Override
public void setProgress(int progress) {
super.setProgress(progress);
this.progress=progress;
}
public TextProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
textPaint = new Paint();
textPaint.setAntiAlias(true);
textPaint.setColor(Color.WHITE);
textPaint.setTextSize(18);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
outof= "%s "+mSharedPreferences_Read.getString(Dict_Language_Constant.DICT_LANG_TAG.OUT_OF_TAG, "")+" %s";
String left= String.format(outof,String.valueOf(progress),String.valueOf(max));
Rect bounds1 = new Rect();
textPaint.getTextBounds(left, 0, left.length(), bounds1);
int x = getWidth() / 4 - bounds1.centerX();
int y = getHeight() / 2 - bounds1.centerY();
canvas.drawText(left, x, y, textPaint);
Rect bounds2 = new Rect();
textPaint.getTextBounds(minutes, 0, minutes.length(), bounds2);
x = (int) (getWidth() / (1.3) - bounds2.centerX());
y = getHeight() / 2 - bounds2.centerY();
canvas.drawText(minutes, x, y, textPaint);
super.setProgress(progress);
}
public void setTextColor(int color) {
textPaint.setColor(color);
drawableStateChanged();
}
}
===========================================
Create new package drc.krs.expandListView.Classes.java
1)ExpandListChild.java
==============
package drc.krs.expandListView.Classes;
public class ExpandListChild {
private String answer="",time_taken="",is_true="",question="";
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getTime_taken() {
return time_taken;
}
public void setTime_taken(String time_taken) {
this.time_taken = time_taken;
}
public String getIs_true() {
return is_true;
}
public void setIs_true(String is_true) {
this.is_true = is_true;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
}
===================================
2)ExpandListGroup.java
===============
package drc.krs.expandListView.Classes;
import java.util.ArrayList;
public class ExpandListGroup{
private String star="",id="",name="";
private Integer totalTimeTaken=0,TotalQustions=0,rightQustions=0;
/**it for total qustion and answer*/
private ArrayList<ExpandListChild> alst_expandlistchild;
public ArrayList<ExpandListChild> getChildItems() {
return alst_expandlistchild;
}
public void setChildItems(ArrayList<ExpandListChild> alst_expandlistchild) {
this.alst_expandlistchild = alst_expandlistchild;
}
public String getStar() {
return star;
}
public void setStar(String star) {
this.star = star;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getTotalTimeTaken() {
return totalTimeTaken;
}
public void setTotalTimeTaken(Integer totalTimeTaken) {
this.totalTimeTaken = totalTimeTaken;
}
public Integer getTotalQustions() {
return TotalQustions;
}
public void setTotalQustions(Integer TotalQustions) {
this.TotalQustions = TotalQustions;
}
public Integer getRightQustions() {
return rightQustions;
}
public void setRightQustions(Integer rightQustions) {
this.rightQustions = rightQustions;
}
}
==============================================
1)xresult_group_r0w
=============
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:background="@drawable/setting_middle_bg">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="@+id/img_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txt_Name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:gravity="left"
android:text="Ravi"
android:singleLine="true"
android:textSize="18dip"
android:textStyle="bold"
android:textColor="#30809b" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:orientation="horizontal"
android:gravity="left">
<drc.krs.expandListView.Adapter.TextProgressBar
android:id="@+id/result_progressbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="15"
android:progressDrawable="@drawable/progressbar"
style="?android:attr/progressBarStyleHorizontal"
/>
<ImageView
android:id="@+id/img_invisible_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<TextView
android:id="@+id/txt_Pending"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:text="Pending..."
android:layout_marginLeft="10dip"
android:textSize="18dip"
android:textStyle="bold"
android:visibility="gone"
android:singleLine="true"
android:textColor="@color/Black" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/img_Arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow" />
<Button
android:id="@+id/img_Nudge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:singleLine="true"
android:text="Nudge"
android:textColor="@android:color/white"
android:background="@drawable/btn_blue_bg_s"
/>
</LinearLayout>
=======================================
2)xresult_child_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/questionbackcolor">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_queindex"
android:text="1"
android:textSize="14dip"
android:textColor="@color/Black"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/txt_questions"
android:focusable="false"
android:textSize="14dip"
android:textColor="@color/Black"
android:gravity="left"
android:text="What is the capital of Maxico?"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/txt_time"
android:textSize="14dip"
android:text="7 sec"
android:textColor="@color/Black"
android:singleLine="true"
android:gravity="right"
android:layout_marginRight="5dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_queindex"
android:text="1"
android:textSize="14dip"
android:textColor="@color/Black"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:gravity="left"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/txt_answer"
android:textSize="14dip"
android:layout_weight="1"
android:text="Mexico City"
android:layout_marginLeft="5dip"
android:textColor="@color/greenMid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
==================================
3)xresult.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/main_background"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/toptab"
android:gravity="center_vertical"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:background="@drawable/btnback"
android:gravity="center"
android:singleLine="true"
android:text="@string/back_button"
android:textColor="@color/White"
android:textSize="16dip" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/logo_banner" />
<Button
android:id="@+id/btn_resign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dip"
android:background="@drawable/btn_blue_bg_s"
android:gravity="center_vertical|center"
android:text="Resign"
android:textColor="@android:color/white"
android:textSize="14dip" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_margin="5dip"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/blue_top_bg"
android:gravity="left|center_vertical" >
<TextView
android:id="@+id/txt_round_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:singleLine="true"
android:text="Result round 1"
android:textColor="@android:color/white"
android:textSize="12dip" />
</LinearLayout>
<ExpandableListView
android:id="@+id/ExpList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:childDivider="@color/questionbackcolor"
android:divider="@android:color/transparent"
android:groupIndicator="@null" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical" >
<Button
android:id="@+id/btn_fb_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dip"
android:background="@drawable/btn_login_with_facebook"
android:textColor="@color/White" />
<LinearLayout
android:id="@+id/llresult"
android:layout_width="fill_parent"
android:visibility="gone"
android:layout_height="50dip" />
<Button
android:id="@+id/btnStartNext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bottom_tab"
android:textColor="@color/White"
android:textSize="20dip"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/lnr_full"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>
=================================
manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.buzzoe.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<permission
android:name="com.buzzoe.android.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.buzzoe.android.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
<application
android:icon="@drawable/buzzoe_icon"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@android:style/Theme.Black"
android:vmSafeMode="true" >
<receiver
android:name="com.ovte.gcm.C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="com.buzzoe.android" />
</intent-filter>
</receiver>
<receiver
android:name="com.ovte.gcm.C2DMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="com.buzzoe.android" />
</intent-filter>
</receiver>
<!-- admob advertise code start -->
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<meta-data
android:name="com.flurry.admob.MY_AD_UNIT_ID"
android:value="@string/appSpot_admob_apikey" />
<meta-data
android:name="com.flurry.admob.test"
android:value="false" />
<!-- admob advertise code end -->
<activity
android:name="com.flurry.android.FlurryFullscreenTakeoverActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" >
</activity>
<activity
android:name=".Splash_Screen_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Upgrade_Star"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Display_Result_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".GetResultDetails"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="drc.krs.facebook_integrate.Share_On_Facebook"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".CountDown_Timer_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Examination_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Game_Play_List_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Get_Contact_List_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Your_Turn_Details_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Search_Friends_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Display_Friends_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="Share_On_Twitter"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Forgot_Password_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Login_Account_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Main_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Create_Account_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".NewGame_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Settings_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Statistics_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".How_To_Play_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".About_Buzzoe_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Nationality_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Account_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="PushNotification_Alert_Activity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
6)constant.java
===========
package com.buzzoe.android;
import android.location.LocationManager;
import drc.krs.facebook.android.Facebook;
/**
* class for declaration Variables which are used in whole Application
*/
public class Constant {
/**
* Flurry Api Key, 16 Flurry Event Logs , 7 Flurry Ads , set Cookies , Set
* Location
*/
public static class FLURRY {
// if FLURRY_EVENT_VISIBLE true then 16 event log is visible otherwise
// invisible
public static final Boolean FLURRY_EVENT_VISIBLE = true;
// if FLURRY_AD_VISIBLE true then 7 Ads are visible otherwise invisible
public static final Boolean FLURRY_AD_VISIBLE = true;
// Flurry API Key
public static final String API_KEY_PAID="MG2XXTTNN85PW48P82NZ";
public static final String API_KEY_FREE="9XFTGCCZH6N96YBWY4SW";
public static final String getAPI_KEY(){
if(FLURRY_AD_VISIBLE){
return API_KEY_FREE;
}
else{
return API_KEY_PAID;
}
}
public static final int DISPLAY_ADS_SCREEN_HEIGHT =50;
// 7 Flurry Ads
public static final String MAINPAGE_BANNER ="1. Mainpage Banner";
public static final String CREATE_GAME_BANNER="2. Create Game banner";
public static final String SELECT_FRIENDS_BANNER ="3. Select Friends Banner";
public static final String START_GAME_BANNER ="4. Start Game Banner";
public static final String RESULT_PAGE_BANNER ="5. Result Page Banner";
public static final String SETTINGS_PAGE_BANNER="6. Settings Page Banner";
public static final String RESULT_PAGE_FULL_BANNER="7. Full Page Free Game/Video";
// set Cookies
public static final String USER_ID = "user_id";
public static final String USER_NAME = "user_name";
public static final String LANGUAGE_CODE = "language_code";
// 16 Event Log
// 1 User Login Event Log
public static final String LOGIN_USER_KEY_ID = "login_user_key_id";
public static final String USER_LOGIN_EVENT = "user_login_event";
// 2 User Facebook With Login Event Log
public static final String FACEBOOK_LOGIN_USER_KEY_ID = "facebook_login_user_key_id";
public static final String USER_FACEBOOK_LOGIN_EVENT = "user_facebook_login_event";
// 3 Create New Game
public static final String CREATE_NEW_GAME_KEY = "create_new_game_key";
public static final String CREATE_A_GAME = "create_a_game";
public static final String CREATE_NEW_GAME_EVENT = "create_new_game_event";
// 4 When User Start the Game to Play
public static final String START_GAME_KEY = "start_game_key";
public static final String START_GAME = "start_game";
public static final String START_GAME_EVENT = "start_game_event";
// 5 When User go to Statistic Page
public static final String STATISTICS_KEY = "statistics_key";
public static final String STATISTICS = "statistics";
public static final String STATISTICS_EVENT = "statistics_event";
// 6 When User go to Setting Page
public static final String SETTINGS_KEY = "settings_key";
public static final String SETTINGS = "settings";
public static final String SETTINGS_EVENT = "settings_event";
// 7 When User go to display friends Activity
public static final String FRIENDS_KEY = "friends_key";
public static final String FRIENDS = "friends";
public static final String FRIENDS_EVENT = "friends_event";
// 8 When User Generate Random Game in NewGame Activity
public static final String RANDOM_KEY = "random_key";
public static final String RANDOM = "random";
public static final String RANDOM_EVENT = "random_event";
// 9 When User go to Facebook Friend Activity to send or add request
public static final String FB_FRIENDS_KEY = "fb_friends_key";
public static final String FB_FRIENDS = "fb_friends";
public static final String FB_FRIENDS_EVENT = "fb_friends_event";
// 10 When User go to 'Search By UserName' in NewGame Activity
public static final String SEARCH_BY_USERNAME_KEY = "search_by_username_key";
public static final String SEARCH_BY_USERNAME = "search_by_username";
public static final String SEARCH_BY_USERNAME_EVENT = "search_by_username_event";
// 11 When User go to 'Search from your contact list' in NewGame
// Activity
public static final String SEARCH_FROM_YOUR_CONTACTLIST_KEY = "search_from_your_contactlist_key";
public static final String SEARCH_FROM_YOUR_CONTACTLIST = "search_from_your_contactlist";
public static final String SEARCH_FROM_YOUR_CONTACTLIST_EVENT = "search_from_your_contactlist_event";
// 12 When User go to 'Search By Email' in NewGame Activity
public static final String SEARCH_BY_EMAIL_KEY = "search_by_email_key";
public static final String SEARCH_BY_EMAIL = "search_by_email";
public static final String SEARCH_BY_EMAIL_EVENT = "search_by_email_event";
// 13 Purchase Event Log in NewGame Activity
public static final String PURCHASE_KEY = "purchase_key";
public static final String PURCHASE = "purchase";
public static final String PURCHASE_EVENT = "purchase_event";
// 14 Share on Facebook Log Event in GetResultDetails file
public static final String SHARE_ON_FB_RESULT_DETAILS_KEY = "share_on_fb_result_details_key";
public static final String SHARE_ON_FB_RESULT_DETAILS = "share_on_fb_result_details";
public static final String SHARE_ON_FB_RESULT_DETAILS_EVENT = "share_on_fb_result_details_events";
// 15 Share on Facebook Log Event in upgrade star screen
public static final String SHARE_ON_FB_UPGRADE_STAR_KEY = "share_on_fb_upgrade_star_key";
public static final String SHARE_ON_FB_UPGRADE_STAR = "share_on_fb_upgrade_star";
public static final String SHARE_ON_FB_UPGRADE_STAR_EVENT = "share_on_fb_upgrade_star_events";
// 16 Share on Facebook Log Event in Display Result Activity
public static final String SHARE_ON_FB_DISPLAY_RESULT_KEY = "share_on_fb_display_result_key";
public static final String SHARE_ON_FB_DISPLAY_RESULT = "share_on_fb_display_result";
public static final String SHARE_ON_FB_DISPLAY_RESULT_EVENT = "share_on_fb_display_result_events";
}
// public static final String PROVIDER = LocationManager.GPS_PROVIDER;
// public static final String
// LOCATION_PROVIDER_DISABLED="GPS Location Provider Is Disabled";
// public static final String
// LOCATION_PROVIDER_ENABLE="GPS Location Provider Is Enable";
// Flurry Set Location
public static final String PROVIDER = LocationManager.NETWORK_PROVIDER;
public static final String LOCATION_PROVIDER_DISABLED = "Network Location Provider Is Disabled";
public static final String LOCATION_PROVIDER_ENABLE = "Network Location Provider Is Enable";
// Device Type for android Mobile
public static final String DEFAULT_DEVICE_TYPE = "2";
// Default Values
public static final String DEFAULT_VALUE = "0";
public static final String DEFAULT_VALUE_Q_TYPE = "1";
public static final String DEFAULT_ROUND = "1";
public static final String BUZZOE = "Buzzoe";
public static final String DEFAULT_LANGUAGE_ID = "3";
public static final String NUMBER_OF_QUESTIONS = "15";
public static final String GOOGLE_PLAY = "https://play.google.com/store";
public static final int EXAMINATION_DEFAULT_FLAG_VALUE = 0;
public static final int LANGUAGE_DEFAULT_POSITION = 2;
public static final int LANGUAGE_DEFAULT_VALUE = -1;
public static final int FIRST_ROUND = 1;
public static final long PROGRESS_TIME = 15000;
public static Boolean INIT_SOUND = false;
public static Boolean FULL_FLURRY = true;
public static String[] mID = null;
// Colour Name to display star image
public static final class COLOR_NAME {
public static final String GREEN = "green";
public static final String WHITE = "white";
public static final String BLACK = "black";
public static final String BLUE = "blue";
public static final String GOLD = "gold";
public static final String ORANGE = "orange";
public static final String PURPLE = "purple";
public static final String RED = "red";
public static final String DIAMOND = "diamond";
public static final String YELLOW = "yellow";
public static final String BRONZE = "bronze";
public static final String BROWN = "brown";
public static final String PINK = "pink";
}
/** Variables used For Facebook Integration */
public static final class FACEBOOK {
public static Facebook mFacebook = null;
public static final String FBAPP_ID = "335513426526276"; //iphone app id
public static final String PERMISSION[] = { Constant.FACEBOOK.PUBLISH_STREAM_PERMISSIONS, Constant.FACEBOOK.READ_STREAM_PERMISSIONS, Constant.FACEBOOK.OFFLINE_ACCESS_PERMISSIONS, Constant.FACEBOOK.EMAIL };
public static final String FACEBOOK_GOOGLE_PLAY = "market://details?id=com.facebook.katana";
public static final String INSTALL_FACEBOOK_FROM_PLAY_STORE = "Install Facebook from Play Store ";
public static final String ERROR_OCCUR_WHILE_OPENNING_PLAY_STORE_TO_INSTALL_FACEBOOK = "Error occur while openning Play Store to Install Facebook";
public static final String ImageURL = "http://180.211.110.195/php-projects/buzzoe/images/big_logo.png";
public static final String FB_URL = "https://www.facebook.com/BuZZoe";
public static final String AUTHORIZING = "Authorizing";
public static final String SOMETHING_WENT_WRONG_PLEASE_TRY_AGAIN = "Something went wrong. Please try again.";
public static final String FB_SHARE_URL = "FB_SHARE_URL";
public static final String FB_SHARE_MSG = "FB_SHARE_MSG";
public static final String FB_DATA_PARSH_MSG = "FB_DATA_PARSH_MSG";
public static final String FB_DATA_PARSH_URL = "FB_DATA_PARSH_URL";
public static final String FB_IMAGE = "ImagePath";
public static final String FB_WALL = "DisplayText";
public static final String FB_SUCESS = "Successfully";
public static final String FB_ = "Delete";
public static final String FB_DATA = "data";
public static final String FB_INSTALLED = "installed";
public static final String FB_ID = "id";
public static final String PUBLISH_STREAM_PERMISSIONS = "publish_stream";
public static final String READ_STREAM_PERMISSIONS = "read_stream";
public static final String OFFLINE_ACCESS_PERMISSIONS = "offline_access";
public static final String EMAIL = "email";
public static final String STREAM_PUBLISH = "stream.publish";
public static final String URL_GOOGLE = "http://www.google.com";
public static final String URL_PLAY = "https://play.google.com";
public static final String FB_FRIEND_REQUEST = "me/friends";
public static final String FB_INSTALLED_REQUEST_1 = "/me/friends?fields=installed&access_token=";
public static final String FB_INSTALLED_REQUEST_2 = "&sdk=android&format=json";
public static final String ACTION_CANCELED = "Action Canceled";
/*
* GRAPH API used for post to friend wall
*/
public static final class GRAPH_API_INPUT_KEY {
public static final String MESSAGE = "message";
public static final String NAME = "name";
public static final String HREF = "href";
public static final String SRC = "src";
public static final String ATTACHMENT = "attachment";
public static final String METHOD = "method";
public static final String CAPTION = "caption";
public static final String DESCRIPTION = "description";
}
public static final class GRAPH_API_INPUT_VALUE {
public static final String BUZZOE = "Buzzoe";
public static final String STREAM_PUBLISH = "stream.publish";
public static final String ACTOR_JUST_POSTED = "{*actor*} just posted a secret message.";
public static final String MESSAGE_DECODE = "A secret message is waiting for you. Click the link to decode it.";
public static final String SECRETE_MESSAGE = "A Secret Message For You";
}
// object keys to get facebook friends
public static final class Get_FBFriendsList_OBJECT_KEY {
public static final String DATA = "data";
public static final String ID = "id";
public static final String NAME = "name";
public static final String POST_ID = "post_id";
}
// Facebook Dialog Parameter values while Sharing
public static final class DIALOG_PARAMETER
{
public static final class Object_Key
{
public static final String NAME = "name";
public static final String DESCRIPTION = "description";
public static final String TYPE = "type";
public static final String SRC = "src";
public static final String MEDIA = "media";
public static final String HREF = "href";
public static final String ATTACHMENT = "attachment";
public static final String TARGET_ID = "target_id";
}
public static final class Object_Value
{
public static final String BUZZOE_APP="Buzzoe App";
public static final String IMAGE="image";
// if image not found then go to this link
public static final String PLAY_URL="http://www.play.google.com";
}
}
}
// Soap Webservice to add facebook friend to play game
public static final class FB_FRIENDS_ADD {
public static final String SOAP_METHOD = "AddToFriendListUsingFbId";
public static final String LOGIN_USER_ID = "id";
public static final String FB_FRD_ID = "fbId";
public static final String RESULT = "result";
public static final String MESSAGE = "message";
public static final String OK = "OK";
}
// Variables for Twitter Sharing
public static final class TWITTER {
public static final String TWITTER_CONSUMER_KEY = "ycwLejracx4aChmINat1Q";
public static final String TWITTER_SECRET_KEY = "T7sBuUJzAM5SRXtajiqzA495hAmNLhzJGCHWZs78";
public static final String TWITTER_URL = "http://twitter.com/GameBuZZoe";
public static final String TWITTER_COULD_NOT_POST = "could not Post";
public static final int TWITTER_MSG_LENGTH = 140;
}
// Variables for create account validation
public static final class CREATE_ACCOUNT_VALIDATION {
public static final String ENTER_PASSWORD = "Enter_Password";
public static final String ENTER_VALID_PASSWORD = "Enter Valid Password";
public static final String PASSWORD_NOT_MATCH = "Password not match";
public static final String EMAIL_VALIDATION_PATTERN = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
public static final String REPEAT_PASSWORD = ".....";
}
/** Soap web_service constant values */
public static final class SOAP_WEBSERVICE_CONSTANT {
// local test url
//public static final String SOAP_URL = "http://180.211.110.195/php-projects/buzzoe/webservices/actions?ws=1";
// live url
public static final String SOAP_URL="http://nl.buzzoe.com/webservices/actions?ws=1";
public static final String SOAP_NAMESPACE = "WebservicesControllerwsdl";
public static final String SOAP_ACTION = "WebservicesControllerwsdl";
}
// shared preference object name
public static final String SHAREDPREFERENCES = "sharedpreferences_buzzoe";
/** shared preferences object key for setting and getting values */
public static final class SHARED_KEY {
public static final String LOGIN_USERID = "login_userid_sp";
public static final String USERNAME = "username_sp";
public static final String PASSWORD = "password_sp";
public static final String DEFAULT_LANGUAGE_NAME = "default_lang_name_sp";
public static final String DEFAULT_LANGUAGE_CODE = "default_lang_code_sp";
public static final String DEFAULT_LANGUAGE_ID = "default_lang_id_sp";
public static final String DEFAULT_LANGUAGE_POSITION = "default_language_position_sp";
public static final String MODULE_NAME = "module_name_sp";
// public static final String ARR_INDEX_="arr_index_sp";
public static final String SELECTED_ID_ = "selected_id_sp";
public static final String GAME_ID = "game_id_sp";
public static final String ROUND_NO = "round_no_sp";
public static final String GAME_NAME = "game_name_sp";
public static final String DEVICE_TOKEN = "device_token_sp";
public static final String SOUND_SETTING = "sound_setting_sp";
// public static final String RANDOM_FLAGE="random_flag_sp";
public static final String PLACE = "place_sp";
public static final String FACEBOOK_ID = "Facebook_ID";
public static final String KEY = "key_sp";
public static final String USERNAME_PUSH = "username_push_sp";
public static final String FB_EMAIL = "FB_Email";
public static final String FB_UNAME = "FB_UserName";
public static final String PLAY_WITH_COMP = "playwithcomp_sp";
public static final String MESSAGE = "message_sp";
public static final String PN_GAME_ID = "pn_game_id_sp";
public static final String PN_GAME_NAME = "pn_game_name_sp";
public static final String PN_PLACE = "pn_place_sp";
public static final String PN_ROUND_NO = "pn_round_no_sp";
public static final String PN_KEY = "pn_key_sp";
public static final String PN_USER_NAME = "pn_user_name_sp";
public static final String PN_MESSAGE = "pn_message_sp";
public static final String PN_MESSAGE_KEY = "pn_message_key_sp";
public static final String PN_NUDGE = "pn_nudge_sp";
}
// shared preference object constant values
public static final class SHARED_VALUES {
public static final String FIND_FRIENDS = "find_friends";
public static final String CREATE_GAME = "create_game";
public static final String DISPLAY_FRIENDS_ACTIVITY = "Display_Friends_Activity";
public static final String MAIN_YOUR_OPPONENT = "Main_Your_Opponent";
public static final String MAIN_YOUR_TURN = "Main_Your_Turn";
public static final String MAIN_ACTIVITY = "Main_Activity";
public static final String YOUR_TURN_DETAILS_ACTIVITY = "Your_Turn_Details_Activity";
public static final String PRACTICE = "practice";
public static final String PUSHNOTIFICATION_ALERT_ACTIVITY = "PushNotification_Alert_Activity";
public static final String YES = "yes";
public static final String NO = "no";
public static final String NUDGE = "NUDGE";
public static final String WON = "won";
public static final String PLACED = "placed";
public static final String UPGRADED = "upgraded";
}
/** top tab bar constant values */
public static final class top_tabbar {
public static final String CANCEL = "";
}
/** language change alert dialog constant values */
public static final class DIALOG {
public static final class LANGUAGE_CHANGE {
public static final String TITLE = "Message";
public static final String MESSAGE1 = "Your Default Language is ";
public static final String MESSAGE2 = "\nWould You Want to Change ?";
public static final String YES = "Yes Please";
public static final String NO = "No Thanks";
}
}
/** intent constant keys and values */
public static final class INTENT {
public static final class KEY {
public static final String CREATE_ACCOUNT_KEY = "create_account_key";
public static final String SEARCH_BY = "search_by";
public static final String PUSH_MSG = "push_msg";
}
public static final class VALUES {
public static final String USERNAME = "username";
public static final String EMAIL = "email";
public static final String CREATE_ACCOUNT_VALUE = "create_account_value";
}
}
// Soap web-service for request random game to other player
public static final class REQUEST_RANDOM_PLAY {
public static final String SOAP_METHOD = "requestRandomPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
// Soap Web-Service that check request for random game to play
public static final class CHECK_REQUEST_RANDOM_PLAY {
public static final String SOAP_METHOD = "checkRequestRandomPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String FAILED = "failed";
public static final String SUCCESS = "success";
}
}
// soap webservice for cancel random play
public static final class CANCEL_RANDOM_PLAY {
public static final String SOAP_METHOD = "cancelRandomPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String FAILED = "failed";
public static final String SUCCESS = "success";
}
}
// Soap web-service to get details result of game in getResultDetails
public static final class GET_RESULT_DETAILS {
public static final String SOAP_METHOD = "getResultDetails";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String ROUND_NO = "round_no";
public static final String CODE = "code";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String ROUND_OVER = "ROUND_OVER";
public static final String RESULT = "result";
public static final String USERS = "Users";
public static final String ID = "id";
public static final String NAME = "name";
public static final String RIGHTQUSTIONS = "rightQustions";
public static final String TOTALQUSTIONS = "TotalQustions";
public static final String TOTALTIMETAKEN = "totalTimeTaken";
public static final String STAR = "star";
public static final String QUESTIONS = "Questions";
public static final String ANSWER = "answer";
public static final String IS_TRUE = "is_true";
public static final String QUESTION = "question";
public static final String TIME_TAKEN = "time_taken";
public static final String PLAYWITHCOMP = "PlayWithComp";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String PLAYWITHCOMP_TRUE = "true";
}
}
//Soap Web-Service to get user position in round in display_result_activity.java
public static final class GET_USER_POISTION_IN_ROUND {
public static final String SOAP_METHOD = "getUserPoistioninRound";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String ROUND_NO = "round_no";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "resule";
public static final String MESSAGE = "message";
public static final String KEY = "key";
public static final String PLACE = "place";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String PLACED = "placed";
}
}
// soap web-service for practice game
public static final class PRACTICE_PLAY {
public static final String SOAP_METHOD = "practicePlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String Q_TYPE = "q_type";
public static final String Q_ID = "q_id";
public static final String ANSWER = "answer";
public static final String CODE = "code";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String ID = "ID";
public static final String QUESTION = "QUESTION";
public static final String OPTION1 = "OPTION1";
public static final String OPTION2 = "OPTION2";
public static final String OPTION3 = "OPTION3";
public static final String OPTION4 = "OPTION4";
public static final String TYPE = "TYPE";
public static final String IMAGE = "IMAGE";
}
public static final class OBJECT_VALUE {
public static final String TEXT_TEXT = "Text-Text";
public static final String IMAGE_TEXT = "Image-Text";
public static final String TEXT_IMAGE = "Text-Image";
public static final String FAILED = "Failed";
public static final String SUCCESS = "Success";
}
}
// soap web-service to get questions for game in real examination
public static final class GET_QUESTIONS {
public static final String SOAP_METHOD = "GetQuestions";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String CODE = "code";
public static final String Q_TYPE = "q_type";
public static final String ROUND_NO = "round_no";
public static final String Q_ID = "q_id";
public static final String ANSWER = "answer";
public static final String Q_NO = "q_no";
public static final String TIME_TAKEN = "time_taken";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String ROUND_NO = "round_no";
public static final String Q_NO = "q_no";
public static final String ID = "ID";
public static final String TOTALQUESTION = "TOTALQUESTION";
public static final String QUESTION = "QUESTION";
public static final String OPTION1 = "OPTION1";
public static final String OPTION2 = "OPTION2";
public static final String OPTION3 = "OPTION3";
public static final String OPTION4 = "OPTION4";
public static final String TYPE = "TYPE";
public static final String IMAGE = "IMAGE";
public static final String POINTS = "points";
public static final String RESULT = "result";
public static final String ROUND_COMPLETE = "ROUND_COMPLETE";
}
public static final class OBJECT_VALUE {
public static final String YES = "YES";
public static final String TEXT_TEXT = "Text-Text";
public static final String TEXT_IMAGE = "Text-Image";
public static final String IMAGE_TEXT = "Image-Text";
}
}
public static final class GET_USER_STATISTICS {
public static final String SOAP_METHOD = "getUserStatistics";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String USERNAME = "USERNAME";
public static final String TOTAL_POINTS = "TOTAL_POINTS";
public static final String HIGHEST_ROUND_TOTAL = "HIGHEST_ROUND_TOTAL";
public static final String HIGHEST_GAMES_TOTAL = "HIGHEST_GAMES_TOTAL";
public static final String NO_OF_GAMES = "NO_OF_GAMES";
public static final String NO_OF_WINS = "NO_OF_WINS";
public static final String NO_OF_LOOSE = "NO_OF_LOOSE";
public static final String STAR = "STAR";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
/** update account web_services constant values define in Account.java */
public static final class UpdateAccount {
public static final String SOAP_METHOD = "UpdateAccount";
public static final class INPUT_KEY {
public static final String EMAIL = "email";
public static final String PASSWORD = "password";
public static final String ID = "id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String MESSAGE = "message";
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
/** get_emailID web_services constant values define in Account.java */
public static final class GET_EMAILID {
public static final String SOAP_METHOD = "GetEmailId";
public static final class INPUT_KEY {
public static final String ID = "id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String NAME = "name";
public static final String EMAIL = "email";
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
/**
* registerFromApp web_services constant values define in
* Create_account.java
*/
public static final class REGISTER_FROM_APP {
public static final String SOAP_METHOD = "registerFromApp";
public static final class INPUT_KEY {
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String EMAIL = "email";
public static final String FBID = "fbid";
public static final String PHONE_NO = "phone_no";
public static final String DEVICE_TYPE = "device_type";
public static final String DEVICE_TOKEN = "device_token";
public static final String NATIONALITY_ID = "nationality_id";
}
public static final class INPUT_VALUE {
public static final String FBID = "";
public static final String NATIONALITY_ID = "3";
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USERNAME = "username";
public static final String ERROR = "error";
public static final String ID = "id";
public static final String NATIONALITY_ID = "nationality_id";
public static final String NATIONALITY_NAME = "nationality_name";
public static final String CODE = "CODE";
public static final String EMAIL = "email";
public static final String PHONE_NO = "phone_no";
public static final String NAME = "name";
public static final String MESSAGE = "message";
public static final String FB_ID = "fb_id";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String ERROR = "error";
}
}
public static final class RECOVER_ACCOUNT {
public static final String SOAP_METHOD = "recoverAccount";
public class INPUT_KEY {
public static final String EMAIL = "email";
}
public class INPUT_VALUE {
}
public class OBJECT_KEY {
public static final String MESSAGE = "message";
public static final String RESULT = "result";
}
public class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
public static final class LOGIN_FROM_APP {
public static final String SOAP_METHOD = "loginFromApp";
public static final class INPUT_KEY {
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String DEVICE_TYPE = "device_type";
public static final String DEVICE_TOKEN = "device_token";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USER_ID = "userid";
public static final String NATIONALITY_ID = "nationality_id";
public static final String UNAME = "uname";
public static final String NATIONALITY_NAME = "nationality_name";
public static final String CODE = "CODE";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
// public static final class GetNationality
// {
// public static final String SOAP_METHOD="GetNationality";
// public static String PREDEFINE_LANGUAGE_NAME="English";
// public static String PREDEFINE_LANGUAGE_CODE="en";
// public static String PREDEFINE_LANGUAGE_ID="3";
//
// public static final class INPUT_KEY
// {
//
// }
//
// public static final class INPUT_VALUE
// {
//
// }
//
// public static final class OBJECT_KEY
// {
// public static final String NATIONALITY="NATIONALITY";
// public static final String ID="ID";
// public static final String NAME="NAME";
// public static final String CODE="CODE";
//
//
// }
//
// public static final class OBJECT_VALUE
// {
//
// }
// }
public static final class UPDATE_NATIONALITY {
public static final String SOAP_METHOD = "UpdateNationality";
public static String PREDEFINE_LANGUAGE_NAME = "English";
public static String PREDEFINE_LANGUAGE_CODE = "en";
public static String PREDEFINE_LANGUAGE_ID = "3";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String NATIONALITY_ID = "nationality_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
public static final String NATIONALITY_ID = "nationality_id";
public static final String NATIONALITY_NAME = "nationality_name";
public static final String CODE = "CODE";
}
public static final class OBJECT_VALUE {
}
}
public static final class GET_HOMESCREEN_DETAILS {
public static final String SOAP_METHOD = "getHomeScreenDetails";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String YOUR_TURN = "YourTurn";
public static final String WAITING = "Waiting";
public static final String GAME_ID = "game_id";
public static final String GAME_NAME = "game_name";
public static final String ROUND_NO = "round_no";
public static final String PLAYWITHCOMP = "PlayWithComp";
}
public static final class OBJECT_VALUE {
}
}
public static final class UPDATE_FB_ID {
public static final String SOAP_METHOD = "UpdateFbId";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String FBID = "fbid";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String result = "result";
public static final String userid = "userid";
public static final String message = "message";
public static final String nationality_id = "nationality_id";
public static final String uname = "uname";
public static final String nationality_name = "nationality_name";
public static final String CODE = "CODE";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
public static final class CHECK_FBID_EMAILID {
public static final String SOAP_METHOD = "CheckFbId_EmailId";
public static final class INPUT_KEY {
public static final String FBID = "fbId";
public static final String EMAIL = "email";
public static final String FACEBOOK_ME = "me";
public static final String FACEBOOK_ID = "id";
public static final String FACEBOOK_EMAIL = "email";
public static final String FACEBOOK_USERNAME = "username";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String result = "result";
public static final String userid = "userid";
public static final String message = "message";
public static final String nationality_id = "nationality_id";
public static final String uname = "uname";
public static final String nationality_name = "nationality_name";
public static final String CODE = "CODE";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String ERROR = "error";
}
}
public static final class HOW_TO_PLAY {
public static final String SOAP_METHOD = "HowToPlay";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String HTML = "HTML";
public static final String MIME = "text/html";
public static final String ENCODING = "utf-8";
}
public static final class OBJECT_VALUE {
}
}
public static final class DISPLAY_FRIENDLIST {
public static final String SOAP_METHOD = "DisplayFriendList";
public static final class INPUT_KEY {
public static final String ID = "id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String FRIENDS = "FRIENDS";
public static final String ID = "ID";
public static final String NAME = "NAME";
public static final String EMAIL = "EMAIL";
public static final String PHONENO = "PHONENO";
public static final String TOTAL_POINTS = "total_points";
public static final String STAR = "star";
}
public static final class OBJECT_VALUE {
}
}
public static final class ALL_FRIENDS_NEW_VERSION {
public static final String SOAP_METHOD = "AllFriendsNewVersion";
// public static final class INPUT_KEY {
// public static final String ID = "id";
// }
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String FRIENDS = "FRIENDS";
public static final String ID = "ID";
public static final String PHONENO = "PHONENO";
public static final String FBID = "FBID";
}
public static final class OBJECT_VALUE {
}
}
public static final class SEARCH_FRIENDS
{
public static final String SOAP_METHOD = "searchFriends";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String TYPE = "type";
public static final String SEARCHSTRING = "searchString";
}
public static final class INPUT_VALUE {
public static int TYPE = 1;
}
public static final class OBJECT_KEY {
public static final String ID = "ID";
public static final String NAME = "NAME";
public static final String EMAIL = "EMAIL";
public static final String PHONENO = "PHONENO";
public static final String FLAG = "FLAG";
public static final String SUCCESS = "Success";
public static final String FRIENDS = "FRIENDS";
}
}
public static final class ADD_TO_FRIENDLIST {
public static final String SOAP_METHOD = "AddToFriendList";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String FRIEND_ID = "friendId";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String FRIENDS = "FRIENDS";
public static final String ID = "ID";
public static final String NAME = "NAME";
public static final String EMAIL = "EMAIL";
public static final String PHONENO = "PHONENO";
public static final String TOTAL_POINTS = "total_points";
public static final String STAR = "star";
}
public static final class OBJECT_VALUE {
}
}
public static final class GET_ROUND_DETAILS {
public static final String SOAP_METHOD = "getRoundDetails";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
public static final String ROUND_NO = "round_no";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USERS = "Users";
public static final String PLAYWITHCOMP = "PlayWithComp";
public static final String ROUND_NO = "round_no";
public static final String NAME = "name";
public static final String TOTAL_POINTS = "total_points";
public static final String STAR = "star";
}
public static final class OBJECT_VALUE {
public static final String PLAYWITHCOMP_TRUE = "true";
}
}
public static final class RESIGN_USER_FROM_GAME {
public static final String SOAP_METHOD = "resignUserFromGame";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String GAME_ID = "game_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
}
public static final class OBJECT_VALUE {
}
}
public static final class CREATE_GAME {
public static final String SOAP_METHOD = "CreateGame";
public static final class INPUT_KEY {
public static final String ID = "id";
public static final String GAME_NAME = "game_name";
public static final String NATIONALITY_ID = "nationality_id";
public static final String NO_OF_QUESTIONS = "no_of_questions";
public static final String FRIEND_LIST = "friend_list";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "RESULT";
public static final String GAME_ID = "GAME_ID";
public static final String CREATED_GAME = "CREATED_GAME";
public static final String ID = "ID";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "Success";
}
}
public static final class UPDATE_DEVICE_TOKEN {
public static final String SOAP_METHOD = "updateDeviceToken";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String DEVICE_TYPE = "device_type";
public static final String DEVICE_TOKEN = "device_token";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
}
}
public static final class NUDGE_USER_FROM_GAME {
public static final String SOAP_METHOD = "nudgeUserFromGame";
public static final class INPUT_KEY {
public static final String GAME_ID = "game_id";
public static final String USER_ID = "user_id";
public static final String FRIEND_USER_ID = "friend_user_id";
}
public static final class INPUT_VALUE {
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String MESSAGE = "message";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String FAILED = "failed";
}
}
public static final class CHECK_CONTACT_NUMBER {
public static final String SOAP_METHOD = "checkContactNumber";
public static final class INPUT_KEY {
public static final String USER_ID = "user_id";
public static final String PHONE_NO = "phone_no";
}
public static final class OBJECT_KEY {
public static final String RESULT = "result";
public static final String USERID = "userID";
}
public static final class OBJECT_VALUE {
public static final String SUCCESS = "success";
public static final String FAILED = "failed";
}
}
}
No comments:
Post a Comment