- 浏览: 7248635 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
在androidpn的客户端几个重要的类:
ServiceManager:管理消息服务和加载相关的配置。
ConnectivityReceiver:处理网络状态的广播。
NotificationReceiver:处理服务端发送的推送消息。
NotificationService:后台服务用户响应服务端的消息。需要在AndroidManifest.xml.注册。
NotificationSettingsActivity:推送信息设置页面。
PersistentConnectionListener:监控连接关闭和重连事件的监听。
PhoneStateChangeListener:监听手机状态的事件监听类。
ReconnectionThread:重连的线程类。
Notifier:客户端发送通知的类。
NotificationIQ:消息的数据包。
ServiceManager中获取属性信息的方法:
private Properties loadProperties() { // InputStream in = null; // Properties props = null; // try { // in = getClass().getResourceAsStream( // "/org/androidpn/client/client.properties"); // if (in != null) { // props = new Properties(); // props.load(in); // } else { // Log.e(LOGTAG, "Could not find the properties file."); // } // } catch (IOException e) { // Log.e(LOGTAG, "Could not find the properties file.", e); // } finally { // if (in != null) // try { // in.close(); // } catch (Throwable ignore) { // } // } // return props; Properties props = new Properties(); try { int id = context.getResources().getIdentifier("androidpn", "raw", context.getPackageName()); props.load(context.getResources().openRawResource(id)); } catch (Exception e) { Log.e(LOGTAG, "Could not find the properties file.", e); // e.printStackTrace(); } return props; }
SharedPreferences的使用:
sharedPrefs = context.getSharedPreferences( Constants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); Editor editor = sharedPrefs.edit(); editor.putString(Constants.API_KEY, apiKey); editor.putString(Constants.VERSION, version); editor.putString(Constants.XMPP_HOST, xmppHost); editor.putInt(Constants.XMPP_PORT, Integer.parseInt(xmppPort)); editor.putString(Constants.CALLBACK_ACTIVITY_PACKAGE_NAME, callbackActivityPackageName); editor.putString(Constants.CALLBACK_ACTIVITY_CLASS_NAME, callbackActivityClassName); editor.commit();
获取手机的设备id:
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); // wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); // connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); // Get deviceId deviceId = telephonyManager.getDeviceId();
Notifier中发送通知的方法:
// Notification Notification notification = new Notification(); notification.icon = getNotificationIcon(); notification.defaults = Notification.DEFAULT_LIGHTS; if (isNotificationSoundEnabled()) { notification.defaults |= Notification.DEFAULT_SOUND; } if (isNotificationVibrateEnabled()) { notification.defaults |= Notification.DEFAULT_VIBRATE; } notification.flags |= Notification.FLAG_AUTO_CANCEL; notification.when = System.currentTimeMillis(); notification.tickerText = message; // Intent intent; // if (uri != null // && uri.length() > 0 // && (uri.startsWith("http:") || uri.startsWith("https:") // || uri.startsWith("tel:") || uri.startsWith("geo:"))) { // intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); // } else { // String callbackActivityPackageName = sharedPrefs.getString( // Constants.CALLBACK_ACTIVITY_PACKAGE_NAME, ""); // String callbackActivityClassName = sharedPrefs.getString( // Constants.CALLBACK_ACTIVITY_CLASS_NAME, ""); // intent = new Intent().setClassName(callbackActivityPackageName, // callbackActivityClassName); // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); // } Intent intent = new Intent(context, NotificationDetailsActivity.class); intent.putExtra(Constants.NOTIFICATION_ID, notificationId); intent.putExtra(Constants.NOTIFICATION_API_KEY, apiKey); intent.putExtra(Constants.NOTIFICATION_TITLE, title); intent.putExtra(Constants.NOTIFICATION_MESSAGE, message); intent.putExtra(Constants.NOTIFICATION_URI, uri); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); notification.setLatestEventInfo(context, title, message, contentIntent); notificationManager.notify(random.nextInt(), notification);
androidpn用户名和密码来源:
XmppManager的注册任务(RegisterTask)中run方法:
if (!xmppManager.isRegistered()) {
final String newUsername = newRandomUUID();
final String newPassword = newRandomUUID();
Registration registration = new Registration();
PacketFilter packetFilter = new AndFilter(new PacketIDFilter(
registration.getPacketID()), new PacketTypeFilter(
IQ.class));
评论
国际移动用户识别码(IMSI:International Mobile SubscriberIdentification Number)是区别移动用户的标志,储存在SIM卡中,可用于区别移动用户的有效信息。其总长度不超过15位,同样使用0~9的数字。其中MCC是移动用户所属国家代号,占3位数字,中国的MCC规定为460;MNC是移动网号码,最多由两位数字组成,用于识别移动用户所归属的移动通信网;MSIN是移动用户识别码,用以识别某一移动通信网中的移动用户。
imsi的百科地址:
http://baike.baidu.com/view/715091.htm
发表评论
-
[转]年度最实用50款免费Android应用推荐
2012-11-08 16:39 3257据国外媒体报道,有人说Android应用市场比iPhone应用 ... -
MQTT的学习研究(十七)Mosquitto简要教程(安装&使用)
2012-10-23 16:34 19746Mosquitto是一个实现了MQTT3.1协议的代理服务器, ... -
MQTT的学习研究(十六) MQTT的Mosquitto的window安装部署
2012-10-23 16:28 38750在mqtt的官方网站,有许多mqtt, 其中: Mos ... -
GIS的学习(四十五)【转】Integration of the MBTiles format on Android
2012-10-22 17:13 2876转载自 http:/ ... -
MQTT的学习研究(十五) MQTT 和android整合文章
2012-10-22 17:06 5175详细参考: How to Implement Pu ... -
MQTT的学习研究(十四) MQTT moquette 的 Callback API 消息发布订阅的实现
2012-10-19 14:08 11850在moquette-mqtt中提供了回调callback ... -
MQTT的学习研究(十三) IBM MQTTV3 简单发布订阅实例
2012-10-19 13:51 12712使用IBM MQTTv3实现相关的发布订阅功能 MQTTv3 ... -
MQTT的学习研究(十二) MQTT moquette 的 Future API 消息发布订阅的实现
2012-10-19 13:38 7672基于Future 模式的 ... -
MQTT的学习研究(十一) IBM MQTT 简单发布订阅实例
2012-10-19 13:30 6276package com.etrip.push; impo ... -
MQTT的学习研究(十)【转】mosquitto——一个开源的mqtt代理
2012-10-19 13:21 13367MQTT(MQ Teleme ... -
MQTT的学习研究(九)基于HTTP GET MQTT 抓取消息服务端使用
2012-10-18 15:25 4987官方参看文档: HTTP GET 接收主题请求协议和响应协议 ... -
MQTT的学习研究(八)基于HTTP DELETE MQTT 订阅消息服务端使用
2012-10-18 15:20 4216参看官方文档 HTTP DELETE 订阅主题 ... -
MQTT的学习研究(七)基于HTTP POST MQTT 发布消息服务端使用
2012-10-18 15:11 7730参阅官方文档 http:// ... -
MQTT的学习研究(六) MQTT moquette 的 Blocking API 订阅消息客户端使用
2012-10-17 16:56 21864参阅官方文档: http://publib.boulder. ... -
MQTT的学习研究(五) MQTT moquette 的 Blocking API 发布消息服务端使用
2012-10-17 16:52 30637参看官方文档: http://publib.bould ... -
MQTT的学习研究(四)moquette-mqtt 的使用之mqtt Blocking API客户端订阅并接收主题信息
2012-10-16 15:51 14547在上面两篇关于mqtt的broker的启动和mqtt的服 ... -
MQTT的学习研究(三)moquette-mqtt 的使用之mqtt服务发布主题信息
2012-10-16 15:48 19735接着上一篇的moquette-mqtt 的使用之 ... -
MQTT的学习研究(二)moquette-mqtt 的使用之mqtt broker的启动
2012-10-16 15:42 36711在MQTT 官网 (http://mqtt.o ... -
MQTT的学习研究(一)MQTT学习网站
2012-10-16 15:21 11183MQTT的官方推荐网站: http://mqtt.org/s ... -
GIS的学习(四十四)osmdroid sdcard检查
2012-10-15 16:12 2274在许多应用中使用到sdcard的检查,在osmdro ...
相关推荐
首先, 我们需要下载androidpn-client-0.5.0.zip和androidpn-server-0.5.0-bin.zip。 下载地址:http://sourceforge.net/projects/Androidpn/ 解压两个包,Eclipse导入client,配置好目标平台,打开raw/...
androidpn-server-0.5.0-bin.zip解压后,打卡bin目录下run.bat运行,之后...将androidpn-client-0.5.0解压后导入Eclipse,修改/raw/androidpn.properties中的xmppHost=xxx.xxx.x.xxx,将其修改为PC端的IP,运行项目,OK
androidpn-client推送客户端
androidpn-client-0.5.0和androidpn-server-0.5.0-bin
androidpn-server-0.5.0-bin.zip、androidpn-client-0.5.0.zip、androidpn-demoapp-0.5.0.zip全给你们了,不用再去网站翻了
使用Apndroid Push Notification 实现android信息推送,AndroidPn项目是使用XMPP协议实现信息推送的一个开源项目。内涵服务端和客户端源码
androidpn-client-0.5.0 修改后的版本 修改原来的通知操作 为action配置 这样就可以定义自己的操作 action为: org.androidpn.client.NotificationProcess 请看文章: ...
这个是androidpn的客户端...............................
androidpn客户端文件,以及安装说明
androidPn client 自动重连 修改asmack源码
android推送,很不错的例子,下下来看看吧
androidpn-client.zip和androidpn-server-0.5.0-bin.zip, 解压两个包,Eclipse导入client,配置好目标平台,打开raw/androidpn.properties文件, apiKey=1234567890 xmppHost=10.0.2.2 xmppPort=5222 如果是...
为了测试androidpn 的服务端 写的模拟androidpn客户端的代码
真正的免费开源安卓推送demo,可以实现实时的web端推送安桌系统
androidpn-client-pc 版本方便压力测试 直接运行Bootstrap类就行了。启动参数 -Xss64k -Xms512M -Xmx512M 将线程数设置小些,这样可以开启很多线程
内含:配置方法一份、androidpn-server-0.5.0-bin.zip、androidpn-demoapp-0.5.0-bin.zip、androidpn-client-0.5.0-bin.zip。三个压缩包都是从官网下载http://sourceforge.net/projects/androidpn/,未做任何修改。...
androidpn client 消息推送 源码 直接用,可运行