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 6155143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:23:01+00:00 2026-05-23T20:23:01+00:00

My app uses the Android XML-RPC project to communicate with a server. After the

  • 0

My app uses the Android XML-RPC project to communicate with a server. After the connection is established the app needs to keep the connection alive by sending a message to the server every xx second. The app also contains multiple Activities that need to send and receive messages using the connection.

What’s the proper way to implement this?

Using a IntentService and BroadcastReceiver?
Or just a Thread?

  • 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-05-23T20:23:02+00:00Added an answer on May 23, 2026 at 8:23 pm

    This looks like a perfect job for a Service started by the AlarmManager.

    Your service in its onStart method will get whatever information you need for connection (like token, username, …) from the preferences for instance. You can trigger the service start by using the AlarmManager sending on a regular basis an intent to start the service.

    Another option would be to have a service started in the background, running a thread that does the communication each X seconds (use a sleep(delay) between calls.

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

Sidebar

Related Questions

I have a current Android app that uses i18n via resources. res/values-es/strings.xml and so
I have created an App Widget for Android 1.5. It uses a TextView to
My app uses the android.support.v4.view.ViewPager class. For each page in the ViewPager, I want
I have an Android app that uses ActionBar Sherlock. I create a menu that
I have published an app with this AndroidManifest.xml: <supports-screens android:smallScreens=true android:normalScreens=true android:largeScreens=true android:anyDensity=false />
I used to have this clause in my AndroidManifest.xml : <uses-configuration android:reqFiveWayNav=false android:reqHardKeyboard=false android:reqKeyboardType=nokeys
I have published a test app with such manifest <?xml version=1.0 encoding=utf-8?> <manifest xmlns:android=http://schemas.android.com/apk/res/android
I'm making an android 1.6 app that uses phone's camera. In order to do
We've upgraded yesterday our App (easy.go) on the Android Market and after that we
I'm working on a small app that uses and xml file to print an

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.