Strange BlackBerry log

匿名 (未验证) 提交于 2019-12-03 09:14:57

问题:

I am using the code below , as part of my push notifications implementation:

private static final String BPAS_URL = "http://pushapi.eval.blackberry.com"; private static final String APP_ID = "3582-M4687r9k9k836r980kO2395i32i66y11a34";  String registerUrl = formRegisterRequest(BPAS_URL, APP_ID, null) + ";deviceside=false;ConnectionType=mds-public";  System.out.println("\n\n\n !!msg registerBPAS URL is:  "+ registerUrl + "\n\n"); 

where :

private static String formRegisterRequest(String bpasUrl, String appId, String token) {     StringBuffer sb = new StringBuffer(bpasUrl);     sb.append("/mss/PD_subReg?");     sb.append("serviceid=").append(appId);     sb.append("&osversion=").append(DeviceInfo.getSoftwareVersion());     sb.append("&model=").append(DeviceInfo.getDeviceName());     if (token != null && token.length() > 0) {         sb.append("&").append(token);     }     return sb.toString(); } 

What i get printed is this :

!!msg registerBPAS URL is:  http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=3582-M4687r9[0.0] k9k836r980kO2395i32i66y11a34&osversion=5.0.0.669&model=9520;deviceside=false;ConnectionType=mds-publ[0.0] ic 

I cant understand why though. Why there are spaces " " in the URL and why is there a "[0.0]"

From the code above i cant explain this behavior.

What i would expect to be printed is this:

!!msg registerBPAS URL is:  http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=3582-M4687r9k9k836r980kO2395i32i66y11a34&osversion=5.0.0.669&model=9520;deviceside=false;ConnectionType=mds-public 

*I dont have BIS enabled if this is any help , but i dont think it matters as i am forming the URL locally.

回答1:

All you're seeing is an extra [0.0] in your log in a couple places.

This is normal ... your URL is fine.

Calling

System.out.println(""); 

does not give you exclusive, or atomic, access to stdout. In other words, while the log is printing out the String you passed to println(), you can also get these tokens printed to the log, and other messages from the BlackBerry OS, and they may/will be placed right in the middle of your log output.

It's annoying, but there's nothing wrong with your code.

If you want another option, look at the BlackBerry EventLogger API, which writes to a log that you can pull off the device, and search through for your messages, without the annoying [0.0].



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!