解决方案 »
- 关于ListView列表自由拖拽边界的一个问题
- android mms 更新时间格式(在setting中设置完时间格式的显示:mm/dd/yyy),短信或者mms中:信息的显示日期格式的更新机制是怎样的?
- 跪求源码!!!
- android显示图片怎么做????????????????????
- android中编写XML文件时候代码提示没有提示
- C语言调用java类方法中参数传递关于数组参数的问题?
- 关于Android kernel打印信息
- 在网上找了一个android蓝牙通信的例子程序,想利用例子与其他蓝牙设备进行串口同喜,程序能正常运行且搜索到周围设配,但不能配对和连接,请高手帮我看下
- Android通过联系人id查询联系人的分组
- Android怎么实现不断请求后台数据,一有数据在客户端跳出报警提示。
- 流化手机录制的视频,直接保存后不能播放,怎么解决格式问题?
- 大家能不能推荐几本比较好的android的书,顺便说一下怎么学习android
public void sendMessage(final String to,final String from,final String body)
{
new Thread(){
public void run() {
try {
Message msg=new Message();
msg.setTo(to+"@"+ApplicationData.instance.xmppServerName);
msg.setFrom(from+"@"+ApplicationData.instance.xmppServerName);
msg.setBody(body);
msg.setType(Type.chat);
//发给服务器加密
Message msgServer=new Message();
msgServer.setTo(to+"@"+ApplicationData.instance.xmppServerName);
msgServer.setFrom(from+"@"+ApplicationData.instance.xmppServerName);
byte[] data=body.getBytes();
for (int i=0;i<data.length;i++)
{
data[i]=Tools.enCrypt(data[i]);
}
String newBody=new String(data);
msgServer.setBody(newBody);
msgServer.setType(Type.chat);
ApplicationData.instance.xmppConnection.sendPacket(msgServer);
String strTo=to+"@"+ApplicationData.instance.xmppServerName;
PrivateChatMessageEntity.addMessage(strTo, msg);
//发广播
Intent intent=new Intent(ApplicationData.ACTION_SHOW_MESSAGE);
ApplicationData.instance.sendBroadcast(intent);