本文整理汇总了Java中cn.smssdk.SMSSDK.getCountry方法的典型用法代码示例。如果您正苦于以下问题:Java SMSSDK.getCountry方法的具体用法?Java SMSSDK.getCountry怎么用?Java SMSSDK.getCountry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.smssdk.SMSSDK
的用法示例。
在下文中一共展示了SMSSDK.getCountry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCurrentCountry
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
private String[] getCurrentCountry() {
String mcc = getMCC();
String[] country = null;
if (!TextUtils.isEmpty(mcc)) {
country = SMSSDK.getCountryByMCC(mcc);
}
if (country == null) {
SMSLog.getInstance().d("no country found by MCC: " + mcc);
country = SMSSDK.getCountry(DEFAULT_COUNTRY_ID);
}
return country;
}
示例2: onResult
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void onResult(HashMap<String, Object> data) {
if (data != null) {
int page = (Integer) data.get("page");
if (page == 1) {
// 国家列表返回
currentId = (String) data.get("id");
String[] country = SMSSDK.getCountry(currentId);
if (country != null) {
currentCode = country[1];
tvCountryNum.setText("+" + currentCode);
tvCountry.setText(country[0]);
}
} else if (page == 2) {
// 验证码校验返回
Object res = data.get("res");
//Object smart = data.get("smart");
HashMap<String, Object> phoneMap = (HashMap<String, Object>) data.get("phone");
if (res != null && phoneMap != null) {
int resId = ResHelper.getStringRes(activity, "smssdk_your_ccount_is_verified");
if (resId > 0) {
Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
}
if (callback != null) {
callback.afterEvent(
SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE,
SMSSDK.RESULT_COMPLETE, phoneMap);
}
finish();
}
}
}
}
示例3: getCurrentCountry
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
private String[] getCurrentCountry() {
String mcc = getMCC();
String[] country = null;
if (!TextUtils.isEmpty(mcc)) {
country = SMSSDK.getCountryByMCC(mcc);
}
if (country == null) {
Log.w("SMSSDK", "no country found by MCC: " + mcc);
country = SMSSDK.getCountry(DEFAULT_COUNTRY_ID);
}
return country;
}
示例4: getCurrentCountry
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
private String[] getCurrentCountry() {
String mcc = getMCC();
String[] country = null;
if (!TextUtils.isEmpty(mcc)) {
country = SMSSDK.getCountryByMCC(mcc);
}
if (country == null) {
Log.w("SMSSDK", "no country found by MCC: " + mcc);
country = SMSSDK.getCountry(DEFAULT_COUNTRY_ID);
}
return country;
}
示例5: onResult
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void onResult(HashMap<String, Object> data) {
if (data != null) {
int page = (Integer) data.get("page");
if (page == 1) {
// 国家列表返回
currentId = (String) data.get("id");
countryRules = (HashMap<String, String>) data.get("rules");
String[] country = SMSSDK.getCountry(currentId);
if (country != null) {
currentCode = country[1];
tvCountryNum.setText("+" + currentCode);
tvCountry.setText(country[0]);
}
} else if (page == 2) {
// 验证码校验返回
Object res = data.get("res");
//Object smart = data.get("smart");
HashMap<String, Object> phoneMap = (HashMap<String, Object>) data.get("phone");
if (res != null && phoneMap != null) {
int resId = getStringRes(activity, "smssdk_your_ccount_is_verified");
if (resId > 0) {
Toast.makeText(activity, resId, Toast.LENGTH_SHORT).show();
}
if (callback != null) {
callback.afterEvent(
SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE,
SMSSDK.RESULT_COMPLETE, phoneMap);
}
finish();
}
}
}
}
示例6: getCountry
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
/**根据国家id获取国家名称区号等信息*/
public static Country getCountry(String coutryId) {
return new Country(SMSSDK.getCountry(coutryId));
}
示例7: initData
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
@Override
public void initData() {
eventHandler = new SMSEvenHanlder();
SMSSDK.registerEventHandler(eventHandler);
String[] country = SMSSDK.getCountry(DEFAULT_COUNTRY_ID);
if (country != null) {
mTxtCountryCode.setText("+" + country[1]);
mTxtCountry.setText(country[0]);
}
}
示例8: onCreate
import cn.smssdk.SMSSDK; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reg);
ViewUtils.inject(this);
initToolBar();
SMSSDK.initSDK(this, ManifestUtil.getMetaDataValue(this, "mob_sms_appKey"),
ManifestUtil.getMetaDataValue(this,"mob_sms_appSecrect"));
evenHanlder = new SMSEvenHanlder();
SMSSDK.registerEventHandler(evenHanlder);
String[] country = SMSSDK.getCountry(DEFAULT_COUNTRY_ID);
if (country != null) {
mTxtCountryCode.setText("+"+country[1]);
mTxtCountry.setText(country[0]);
}
// SMSSDK.getSupportedCountries();
}