What could be used to get data from server to android as fast as it reaches server?

What is the best way to get data from server as fast as it gets to it? (Like instant message, or simple broadcast for example).

I first thought about using miniature web server in android and get post requests to it with data. However with this approach I soon understood that I will get many problems with NAT and similar issues.

Later I thought about manually pooling the server from android, but it seems somewhat flaky approach to problem, because data is got in irregular intervals (like image with some text).

I was thinking about using something like webrtc or rtp to have connection between server, but these approaches are somewhat complex and half baked. I found very little info on those about data operation. Thought I managed to get in my „experiments“ video and sound transfer, I found very little info how to get data transfers.

What should I do? Now I am thinking about having some connection to server and getting some events in android, which when I got update in server could download everything from server.

Update:

My data is encode64 processed html5 canvas png image. Probably I will add to it some text data to blob. It is generated on webpage it should reach phone as fast as it can through server. The problem is part where image data goes from server to phone. Data size per request is ~50KB.

8

I’m not quite sure about the scenario you are trying to describe but would a pub sub model help? Publish messages to a topic and have anyone who is interested in that information subscribe to the same topic. MQTT is a light weight pub / sub messaging protocol that only has 2 bytes of header and so is quick. There are several clients and servers available, some that are open source or free to use e.g. Eclipse Paho client and the Mosquito server.

2

Depending on the device you’re using, you’re going to struggle. Android has a couple of problems in the design of its networking subsystem that are going to cause you grief.

The primary issue is power management. Android devices are, as a rule, mobile devices running on battery power for the majority of the time. Therefore, they conserve power as much as possible, aggressively putting the cpu to sleep whenever it hasn’t been locked in an awake state. In many android devices, this causes the device to stop receiving packets on any wireless network it may be connected to. This makes a push protocol over wireless next to useless: in order for it to work you have to keep the cpu awake, which will kill the battery pretty quickly.

You may think you can solve this by not using the wireless network but connecting to your server over 3g, but this doesn’t work. Android automatically prefers wireless over 3g when it is connected, and the only api that lets you use 3g by preference is only usable for short duration connections because it has a timeout that is limited to a short period (30s, iirc).

Now, if you can restrict your target device to one that supports wake-on-wlan, maybe you can make it work, but you’ll find it tricky.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật