在双卡双待自动发送消息 [英] Sending message automatically in Dual Sim

查看:133
本文介绍了在双卡双待自动发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发,需要对硬件按钮preSS自动发送信息的应用程序。它是在单卡手机的工作不错,但不是在双SIM卡。那么,有没有办法设置默认的SIM卡,同时发送消息或进行语音呼叫编程方式使用双SIM卡手机时?


解决方案

  ContentValues​​ VAL =新ContentValues​​();
val.put(价值,在这里不用pferred SIM卡标识的$ P $);
。getContentResolver()更新(Uri.parse(内容://设置/系统),缬氨酸,NAME ='sms_sim_setting',NULL);

code的这部分为me.This工作很好的可扩展用于其他SIM卡的选择方案。设置缓存包含名称S,voice_call_sim_setting,gprs_connection_sim_setting,video_call_sim_setting etc.But它进入用户需要写权限的设置。 --from Janaka班达拉

I am developing an app that requires sending messages automatically for hardware button press. It is working nice in single SIM phone, but not in dual SIM. So is there any way to set the default SIM while sending message or making a voice call programmatically when using dual SIM phones?

解决方案

ContentValues val = new ContentValues();
val.put("value", "here goes the preferred SIM ID");
getContentResolver().update(Uri.parse("content://settings/system"), val, "name='sms_sim_setting'", null);

This portion of code is working nice for me.This can be extended for other SIM selection scenarios. Setting cache contains entry with name S, voice_call_sim_setting, gprs_connection_sim_setting, video_call_sim_setting etc.But it requires users permission to write settings. --from Janaka Bandara

这篇关于在双卡双待自动发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆