Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8265799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:55:51+00:00 2026-06-08T04:55:51+00:00

I am writing a android client which pushes data every 20-30 seconds & also

  • 0

I am writing a android client which pushes data every 20-30 seconds & also receives updates from server asynchronously.
Since i have other UI components as well, I can’t block the main thread.

What are the pros and cons(performance, complexity, maintainability, easy to use API etc..) of using:

  1. sync i/o with async task / threads for pushing data to & receiving events from server
  2. async nio lib based i/o

Also suggest if there is a better approach.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:55:53+00:00Added an answer on June 8, 2026 at 4:55 am

    With Android and UI apps, you are not only not supposed to block the UI thread, but with newer versions of Android you are simply not allowed to do any networking on the UI thread at all.

    Thus, even NIO-based networking on UI thread is usually not a working approach.

    For WebSocket, you might want to look at: https://github.com/tavendo/AutobahnAndroid

    This does NIO, but on 2 background threads for reader/writer. Notably, it does not do any networking on UI thread .. including connection establishment.

    We might rewrite that in the near future to do old-school IO on the background threads since:

    a) NIO doesn’t buy a lot in this situation
    b) implementing TLS over NIO is a PITA

    Disclaimer: I am author of Autobahn and work for Tavendo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an Android application which can enable and disable the Network Data
Im writing a client/server app for android that sends a username and password to
1.I have an android client application in which i am grabbing frames from the
I'm writing both a server and an Android client application. The Android client sends
I'm writing my first client/server android app, and need an advice regarding server architecture.
We are writing an application for Android OS which communicates with a server to
I'm writing an sample app to create a Server on Android and a client
I was writing a simple AIDL based android remote service & a client to
I am writing a server client on android platform. If one of the client
Im writing an android app that connects to my own Jersey rest client. HTTP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.