Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blackberry 黑莓推送通知,操作系统<;7.X_Blackberry_Push Notification_Push - Fatal编程技术网

Blackberry 黑莓推送通知,操作系统<;7.X

Blackberry 黑莓推送通知,操作系统<;7.X,blackberry,push-notification,push,Blackberry,Push Notification,Push,我正在开发BB OS 0&&args[0].equals(“BlackBerryCity”)){ System.out.println(“!!!!!!!!!!!!!!!!!!!我在里面如果”); //注册推送 按下主注册表按钮(); MyApp=新的MyApp(); app.enterEventDispatcher(); } //每次重启手机时,我们都会调用负责监听推送的后台进程 否则{ System.out.println(“!!!!!!!!!!!!!!!!!!!我在里面其他”); //应该把

我正在开发BB OS 0&&args[0].equals(“BlackBerryCity”)){ System.out.println(“!!!!!!!!!!!!!!!!!!!我在里面如果”); //注册推送 按下主注册表按钮(); MyApp=新的MyApp(); app.enterEventDispatcher(); } //每次重启手机时,我们都会调用负责监听推送的后台进程 否则{ System.out.println(“!!!!!!!!!!!!!!!!!!!我在里面其他”); //应该把背景课放在听推送的msgs:D上 BackgroundApplication backApp=新的BackgroundApplication(); backApp.setupBackgroundApplication(); backApp.enterEventDispatcher(); } } 公共MyApp() { 推屏(新的MyAppScreen()); } } 类MyAppScreen扩展了MainScreen { 公共MyAppScreen() { //这里有些东西。。 } } push_main.java

public类推送主机{
/**
*此应用程序的入口点
*@param args命令行参数(未使用)
*/
专用静态最终字符串寄存器\u SUCCESSFUL=“rc=200”;
私有静态最终字符串取消注册成功=注册成功;
私有静态最终字符串用户已订阅=“rc=10003”;
私有静态最终字符串已\u未被\u USER=“rc=10004”注册;
私有静态最终字符串已\u未被\u PROVIDER=“rc=10005”注册;
私有静态最终字符串PUSH_PORT=”“+“33387”;//PUSH端口
私有静态最终字符串BPAS_URL=”http://pushapi.eval.blackberry.com";
私有静态最终字符串APP_ID=”“+“3592-M4587f9s9k836r930kO2395i32i66y10a34”;//添加应用程序ID
私有静态字符串URL=“http://:”+“33397”//添加推送端口。
私有静态最终整块大小=256;
公共静态ListingThread\u ListingThread;
公共静态StreamConnectionNotifier\u notify;
专用静态最终长ID=0x954A603C081E0L;
公共push_main(){
如果(_listengThread==null)
{
System.out.println(“侦听线程1上的消息”);
_listeningThread=新建listeningThread();
System.out.println(“侦听线程2上的消息”);
_listingThread.start();
System.out.println(“列表线程3上的消息”);
}         
}
公共静态类ListingThread扩展线程
{
私有布尔值_-stop=false;
/**
*阻止线程侦听。
*/
私有同步的void stop()
{
_停止=真;
尝试
{
//关闭连接,使线程返回。
_notify.close();
} 
捕获(例外e)
{          
}          
}
/**
*侦听HTTP url中的数据。读取数据后,
*将数据渲染到屏幕上。
*@see java.lang.Runnable#run()
*/    
公开募捐
{    
StreamConnection-stream=null;
InputStream输入=null;
MDSPushInputStream pushInputStream=null;
而(!\u停止)
{
尝试
{    
//在这里同步,这样我们就不会创建一个永远不会关闭的连接。
已同步(此)
{
//打开连接一次(或者在IOException之后重新打开),这样我们就不会结束
//在竞速状态下,如果在连接之前进入,推力将丢失
//再次打开。我们使用一个参数打开url,该参数指示我们应该
//尝试连接时始终使用MDS。
System.out.println(“\n\n消息连接1”);
_notify=(StreamConnectionNotifier)Connector.open(URL);
System.out.println(“\n\n消息连接2”);
}
而(!\u停止)
{    
//注意:在收到数据之前,以下操作将被阻止。
System.out.println(“\n\n消息通知1”);
流=_notify.acceptendopen();
System.out.println(“\n\n msg 1”);
尝试
{
System.out.println(“\n\n msg 2”);
input=stream.openInputStream();
System.out.println(“\n\n msg 3”);
pushInputStream=新的MDSPushInputStream((HttpServerConnection)流,输入);
System.out.println(“\n\n msg 4”);
//从输入流中提取数据。
DataBuffer db=新的DataBuffer();
字节[]数据=新字节[块大小];
int chunk=0;
而(-1!=(chunk=input.read(data)))
{
db.write(数据,0,块);
}
更新消息(数据);
//调用此方法以接受推送。
pushInputStream.accept();
data=db.getArray();
} 
捕获(IOE1异常)
{
//但是,输入流出现问题,原始
//StreamConnectionNotifier仍然有效。
//errorDialog(e1.toString());
}
最后
{
如果(输入!=null)
{
尝试