How to implement push notifications using MQTT

Tutorials with advanced 'difficulty' and more Lines of Code.

How to implement push notifications using MQTT

Postby tokudu » Fri May 14, 2010 7:33 am

Hi all,
I wrote a short tutorial on how to implement push notifications for your Android app using MQTT.

http://tokudu.com/2010/how-to-implement ... r-android/

There is sample code included and a live demo.

Let me know what you guys think.
tokudu
Freshman
Freshman
 
Posts: 4
Joined: Fri May 14, 2010 7:30 am

Top

Postby padde » Fri May 14, 2010 9:29 am

It looks promising and the source is really easy to understand.
I will take a closer look and test everything this weekend.
Thanks for your work.. cant wait to test this :D

-- Edit --
After a while of messing around to get that PHP SAM thing working
i decided to give the mosquitto server a try... and that worked instantly.
After that i just needed to put your server side PhpMQTTClient in my xampp
and install the android app on my G1.. all without any problems.

It workes so far without any problem.. i will keep the service running on my phone
the hole night to check bandwidth usage and will send in a few hours some messages
to check if the service and the connection runs properly.

I just cant wait to put that push functionality into my next projects :]
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby tokudu » Sun May 16, 2010 2:15 am

I'm glad to hear it works for you.

Let me know if you run into any issues regarding the service getting into a weird state. There might be bug hiding somewhere there.

Cheers,
Anton
tokudu
Freshman
Freshman
 
Posts: 4
Joined: Fri May 14, 2010 7:30 am

MQTT

Postby yuvalkesten » Sun May 16, 2010 8:16 am

Hi guys,
I am working on a demo project, still unpublished, but I have implemented MQTT in my android app and it's great.
I am running the MOSQUITO broker on an Amazon EC2 server.
The latency is sometimes too long (4 sec) but it's due to the fact that my server is in the US and I am in Israel.
If someone needs any help contact me on this thread - I prefer not in private so others will enjoy like I am enjoying threads here daily...
Try MiKiZaZa... An interactive content player and editor. Transform youtube movies or your family movies to an android game with just a couple of clicks...
Search for MiKiZaZa @ market or go to http://mikizaza.wordpress.com
yuvalkesten
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jun 29, 2009 8:44 pm
Location: Tel Aviv

your link is not working

Postby glouzaille » Sun May 16, 2010 12:24 pm

hello, can you check your link, apparently, it's not working. thanks
glouzaille
Freshman
Freshman
 
Posts: 5
Joined: Mon Nov 23, 2009 2:32 pm

Postby tokudu » Sun May 16, 2010 2:32 pm

should be back up now, sorry.
tokudu
Freshman
Freshman
 
Posts: 4
Joined: Fri May 14, 2010 7:30 am

Top

Postby tokudu » Sun May 16, 2010 2:39 pm

Also, there might be a bug right now, when the service tries to reconnect too often in the background, which drains the battery. I'm working on fixing that. Just an FYI

--EDIT--
ok, I think the battery drain issue is fixed. Let me know, if I'm wrong.
tokudu
Freshman
Freshman
 
Posts: 4
Joined: Fri May 14, 2010 7:30 am

Re: How to implement push notifications using MQTT

Postby bogdannistor » Tue May 24, 2011 1:51 pm

Hi yuvalkesten, can you give me more details about the implementation. A fellow developer told me that mqtt is very hard to configure.
bogdannistor
Once Poster
Once Poster
 
Posts: 1
Joined: Tue May 24, 2011 1:47 pm

Re: How to implement push notifications using MQTT

Postby krishnakumartm » Wed Aug 22, 2012 11:00 am

Hi tokudu,
I am using your app to simulate this on ,my AVD, but when i click on Start Service button, i am getting an error unknow error. I tried to test with wmqttSample.jar, with 209.124.50.174, 1883 port. On connect in the sample it throwing an exception java.net.ConnectionException: Connection Refused, connect.
Please let me how can i test this with my own local hot.

Thanks
krishnakumartm
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Aug 22, 2012 10:53 am

Re: MQTT

Postby benefice_alfa » Fri Nov 02, 2012 9:07 am

yuvalkesten wrote:Hi guys,
I am working on a demo project, still unpublished, but I have implemented MQTT in my android app and it's great.
I am running the MOSQUITO broker on an Amazon EC2 server.
The latency is sometimes too long (4 sec) but it's due to the fact that my server is in the US and I am in Israel.
If someone needs any help contact me on this thread - I prefer not in private so others will enjoy like I am enjoying threads here daily...


hi. i'm using MQTT & mosquitto broker to doing push notifications.
it working well on localhost. but when i run the broker on amazon, my client can not connect to mosquitto.
my OS is windows server 2008.

is there any sugestion how to solve it?

thanks.
Hi Everyone
benefice_alfa
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Nov 02, 2012 8:48 am

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 8 guests