02-14-2013 12:06 PM
Hi to all,
First, excuse me if this thread is not appropriated because there is a similar one. If there is, I have not found it.
I want to construct an push-enabled application with its server but i dont want to use the servlets and jar provided by the SDK push service.
I think the only thing I have to do in the server part is to mount the PAP message with the required parameter "address" (the device address) using low-level libraries.
However, i have a problem developing the application in the device. Using this code as reference:
http://docs.blackberry.com/en/developers/deliverab
I see that the parameter "address" is obtained in the method createByteSubscriptionMessage, but I cant see its implementation to obtain the parameter "address" (obtained in the subscription servlet) because it is a native method.
So,
1.- Seeing the API:
http://www.blackberry.com/developers/docs/7.0.0api
What is the parameter "address" obtained in the server part (subscription servlet)? The device ID? How i can retrieve it?
2.- Could I build the app-client just staying in step 6 and send the HTTP message on my way?
Someone can help me??
Thx to all.
Regards.
Solved! Go to Solution.
02-14-2013 12:24 PM
If I understand what you are trying to ask is how to get the address of the device back to your server-side push initiator application.
If so, you can see an example here:
https://developer.blackberry.com/java/documentatio
Basically you can see the sample code for the sample push-enabled application constructs an HTTP message to send to it's server-side application. While this sample does send the HTTP message in the format the SDK expects you don't need to use the SDK or the same format but you can follow the example to send a simple HTTP message to your own server to pass the information your server-side app needs. For example, the link above shows that to get the device address you can do this:
Integer.toHexString( DeviceInfo.getDeviceId() )
In your server-side application you should save that device address and then when you construct the push request message you use it as the device address if using the SDK low-level APIs (or insert that value in the address field of the PAP XML if not using the SDK).
02-15-2013 07:35 AM
thanks you very much