Country code changes

parent c7afbbdb
...@@ -72,7 +72,7 @@ android { ...@@ -72,7 +72,7 @@ android {
vportal { vportal {
applicationId "com.vsoft.vera.vportal" applicationId "com.vsoft.vera.vportal"
versionCode 1 versionCode 1
versionName "0.1.7" versionName "0.1.9"
} }
} }
} }
......
...@@ -15,8 +15,10 @@ import android.os.Handler; ...@@ -15,8 +15,10 @@ import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
...@@ -69,6 +71,7 @@ import org.json.JSONObject; ...@@ -69,6 +71,7 @@ import org.json.JSONObject;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
...@@ -166,6 +169,7 @@ public class ADALActivity extends AppCompatActivity { ...@@ -166,6 +169,7 @@ public class ADALActivity extends AppCompatActivity {
} }
}); });
getCountryCode();
// CheckLoginValues(); // CheckLoginValues();
callGraphButton = (Button) findViewById(R.id.callGraph); callGraphButton = (Button) findViewById(R.id.callGraph);
signOutButton = (Button) findViewById(R.id.clearCache); signOutButton = (Button) findViewById(R.id.clearCache);
...@@ -233,6 +237,33 @@ public class ADALActivity extends AppCompatActivity { ...@@ -233,6 +237,33 @@ public class ADALActivity extends AppCompatActivity {
} }
} }
/*
* getCountryCode - To get the Country mobile code dynamically.
*
* @return void
* */
public void getCountryCode() {
try {
TelephonyManager telephonyManager =
(TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
if (telephonyManager != null) {
String countryName = telephonyManager.getNetworkCountryIso();
Log.e(TAG, "countryCode: "+countryName);
if(countryName.equalsIgnoreCase("us")) {
Constants.TWILIO_COUNTRY_CODE = "+1";
}
if(countryName.equalsIgnoreCase("in")) {
Constants.TWILIO_COUNTRY_CODE = "+91";
}
Log.e(TAG, "countryCode: "+Constants.TWILIO_COUNTRY_CODE);
}
} catch (Exception e) {
Constants.TWILIO_COUNTRY_CODE = "+1";
}
}
private void CheckLoginValues() { private void CheckLoginValues() {
String sysId = PrefManager.getSharedPref(ADALActivity.this, PrefManager.PREFERENCE_USER_SYS_ID); String sysId = PrefManager.getSharedPref(ADALActivity.this, PrefManager.PREFERENCE_USER_SYS_ID);
if (!TextUtils.isEmpty(sysId)) { if (!TextUtils.isEmpty(sysId)) {
......
...@@ -11,7 +11,7 @@ import com.vsoft.vera.api.interfaces.PendingApprovalsApi; ...@@ -11,7 +11,7 @@ import com.vsoft.vera.api.interfaces.PendingApprovalsApi;
public class Constants { public class Constants {
public static final String TAG = AppConfig.APP_INTERNAL_NAME; public static final String TAG = AppConfig.APP_INTERNAL_NAME;
public static final String TWILIO_COUNTRY_CODE = "+91"; public static String TWILIO_COUNTRY_CODE;// = "+91";
public static final String[] month = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; public static final String[] month = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
/** /**
......
The file could not be displayed because it is too large.
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.1.6","enabled":true,"outputFile":"app-vportal-staging.apk","fullName":"vportalStaging","baseName":"vportal-staging"},"path":"app-vportal-staging.apk","properties":{}}]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment