Re: [codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-11 Thread greensoter
Thanks!

It works for me now.

On Thursday, April 11, 2019 at 4:53:37 AM UTC+2, shannah wrote:
>
> There is also a WebSocket sample in the SampleRunner
> https://github.com/codenameone/CodenameOne/tree/master/Samples
>
> The sample (a chat app), should run out of the box. Just download the CN1 
> sources, open the Sample Runner (instructions at link above), and click 
> "Launch" next to the WebSocketSample.
>
> On Wed, Apr 10, 2019 at 7:14 PM Shai Almog  > wrote:
>
>> Here: https://github.com/shannah/cn1-websockets/
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "CodenameOne Discussions" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to codenameone-discussions+unsubscr...@googlegroups.com 
>> .
>> Visit this group at 
>> https://groups.google.com/group/codenameone-discussions.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/codenameone-discussions/e1a9b0d3-a28c-4fa9-a374-198eae7877f9%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Steve Hannah
> Web Lite Solutions Corp.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/b3d4a7d1-80ed-4119-9d30-9fb510bff450%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-11 Thread greensoter
Hi Shai,

I changed to Websocket, and it works perfectly for me now.

Thanks!

On Thursday, April 11, 2019 at 4:14:53 AM UTC+2, Shai Almog wrote:
>
> Here: https://github.com/shannah/cn1-websockets/
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/e8fbfdfb-c180-4f49-9ea7-30e232e89547%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-11 Thread greensoter

Hi Shai,

I am making a chat app, with PubNub latest library is working perfectly, 
the lib version is : pubnub-gson-4.22.0-beta-all.jar , it is very simple to 
connect to PubNub server to publish and subscribe message. So my question 
here is, can I directly generate cn1lib for that PubNub library then I 
don't need to use WebSocket.

I checked the WebSocket specification both the server and client, I found 
that only can send messages, but in my App one person can chat with 
multiple persons and also can subscribe from different chatters, in PubNub 
uses channel to handle it, that is very understandable, because if two 
chatters are in same channel then they can both publish and subscribe 
messages, say chatting.


On Thursday, April 11, 2019 at 4:14:53 AM UTC+2, Shai Almog wrote:
>
> Here: https://github.com/shannah/cn1-websockets/
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/cf70ca5a-cddc-4f00-bfd9-46b624cf90f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-10 Thread Steve Hannah
There is also a WebSocket sample in the SampleRunner
https://github.com/codenameone/CodenameOne/tree/master/Samples

The sample (a chat app), should run out of the box. Just download the CN1
sources, open the Sample Runner (instructions at link above), and click
"Launch" next to the WebSocketSample.

On Wed, Apr 10, 2019 at 7:14 PM Shai Almog  wrote:

> Here: https://github.com/shannah/cn1-websockets/
>
> --
> You received this message because you are subscribed to the Google Groups
> "CodenameOne Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to codenameone-discussions+unsubscr...@googlegroups.com.
> Visit this group at
> https://groups.google.com/group/codenameone-discussions.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/codenameone-discussions/e1a9b0d3-a28c-4fa9-a374-198eae7877f9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Steve Hannah
Web Lite Solutions Corp.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CABiRg%2BTgu7YPsFWq7_hmwRapQRyFU2yYcuBuxP0g8C4jjs%2B%3Dhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-10 Thread Shai Almog
Here: https://github.com/shannah/cn1-websockets/

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/e1a9b0d3-a28c-4fa9-a374-198eae7877f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-10 Thread greensoter
Where can I get the Websockets document and sample code? Then I can 
implement in my app as well, thanks!

On Wednesday, April 10, 2019 at 6:36:58 AM UTC+2, Shai Almog wrote:
>
> Hi,
> I think pubnub cut support for older libraries they implemented. I haven't 
> paid much attention since websockets proved to be a good substitute and 
> removed the need for solutions like that.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/d2102655-3f01-4770-a197-276a9810b3c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-09 Thread Shai Almog
Hi,
I think pubnub cut support for older libraries they implemented. I haven't 
paid much attention since websockets proved to be a good substitute and 
removed the need for solutions like that.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/dbaa0bf2-0309-46fe-b28f-92abe5784bb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-09 Thread greensoter
Hi Shai,

I used below code to receive the message, but it didn't come. Do I need to 
execute this subscribe somewhere like original PubNub needs to execute 
after subscribe.

public void subMessage() {

Pubnub pubnub = new Pubnub(publishKey, subscribeKey);

try {

String channel = "testChannel";
pubnub.subscribe(channel, new Callback() {
@Override
public void successCallback(String channel, Object message, 
String timetoken) {

System.out.println("Message is 
comming!!"+timetoken);
}
});

}catch(PubnubException err) {
Log.e(err);
Dialog.show("Error", "There was a communication error: " + err, 
"OK", null);
}

}

On Monday, April 8, 2019 at 4:00:37 AM UTC+2, Shai Almog wrote:
>
> This used to work fine. Make sure you included all the dependencies as 
> pubnub included other dependencies. Also make sure you installed the 
> library correctly.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/69a77c80-b55e-4cd1-8b0f-88e3b36e8948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Trying to use third party lib (PubNub) to handle messaging

2019-04-07 Thread Shai Almog
This used to work fine. Make sure you included all the dependencies as 
pubnub included other dependencies. Also make sure you installed the 
library correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/d9ffd389-f36d-4a85-bb12-0beded4da545%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.