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

  • Home
  • SEARCH
  • 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 7550869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:19:43+00:00 2026-05-30T10:19:43+00:00

Alright so let me explain what I’m doing and then I have a couple

  • 0

Alright so let me explain what I’m doing and then I have a couple questions.

Explination

I have an app I’m working on that will use a service to check my webpage for updates every 1-10 minutes. So on ACTION_BOOT_COMPLETED, MyReceiver(Broadcast Receiver) is triggered and if it’s an ACTION_BOOT_COMPLETED broadcast it starts a service called BootService. BootService then sets an AlarmService that triggers MyReceiver, and then BootService is terminated. When an alarm broadcast comes into MyReceiver it triggers another service called UpdateService which will check the internet at whatever interval that is set by BootService.

I have a service called BootService because everytime my app is started, it starts up BootService to make sure the AlarmService is running just in case it gets terminated for whatever reason.

When I make my HTTPClient requests I want it to be login protected so what I was trying to do is whenever BootService is run, it will initiate a HTTPClient request to my website, login and store a session id that I’ll use in UpdateService. However, when I put the HTTPClient request into BootService I get a ANR (Application Not Responding). I tried putting the HTTPClient request into an AsyncTask and still I have issues with it.

Questions

  1. Would it be better if I did away with the BootService and instead just have MyReceiver set an AlarmService. And whenever someone loads the app just sent out a broadcast to initiate the alarm, again?

  2. What could be causing all the hold up during the HTTPClient request that it locks up my program and forces a ANR? How could I properly implement my HTTPClient request so it wouldn’t hold up my Service?

  3. Any good examples of a login/cookie store method. And a service that later on uses a session id to make future requests?

  • 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-30T10:19:44+00:00Added an answer on May 30, 2026 at 10:19 am

    When I make my HTTPClient requests I want it to be login protected so what I was trying to do is whenever BootService is run, it will initiate a HTTPClient request to my website, login and store a session id that I’ll use in UpdateService.

    Unless the Web service allows infinite session durations, making this work could be tricky. I suggest that you do the login on each update.

    However, when I put the HTTPClient request into BootService I get a ANR (Application Not Responding).

    This means that you were trying to do way too much work in onStartCommand(), or onCreate(), or onDestroy(), or onBind(). All of those methods are called on the main application thread, and so you cannot do significant work there.

    Would it be better if I did away with the BootService and instead just have MyReceiver set an AlarmService.

    Yes.

    What could be causing all the hold up during the HTTPClient request that it locks up my program and forces a ANR?

    Network I/O can be slow.

    How could I properly implement my HTTPClient request so it wouldn’t hold up my Service?

    Use an IntentService and do your network I/O in onHandleIntent().

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

Sidebar

Related Questions

Alright so I have a task, that I have to let the client try
Alright, let's say that I have the following markup: <div class=ticker> <p>News Item One.
Alright, so let's say I have a database with a table named COMPANY_PARAMETERS that
Alright let me explain my situation first: I am part of an organization that
Alright, so I'm at wits' end. I have an app that utilizes pushing and
I have an account management page that will let users change information about themselves.
Alright, let's say I have a table that looks like this: ID | DATE
Alright so i need to open a .txt file that will be created in
Alright so I have no idea how to even begin doing this But basically
Alright, so I'm working on a website and currently I have a shoutbox at

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.