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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:25:56+00:00 2026-05-22T18:25:56+00:00

I am developing an app in which i need to send and receive packets

  • 0

I am developing an app in which i need to send and receive packets in background. But I’ve discovered that when screen shut off also cpu and networking is disabled. So I’ve found on Android Developers that I should use wake lock and wifi lock to let the cpu works altought if the screen went off. This solution works for other devices such LG Optimus One but not for Samsung Galaxy Tab. With this device when screen shut off I can’t receive no more packets (UDP) and magically when I press power button for re enabling screen, I restart to receive packets.
In my code I call:

powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_W AKE_LOCK, "TAG");

then

wakeLock.acquire();

I think that is a Samsung bug but I’m not sure of this, and if someone can give me some hint i would really appreciate.

P.S. I need some programming help… I already know that if I modify some manual setting to avoid shutting down the screen, this will work. But I’m developing an app and i need code!!

  • 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-22T18:25:57+00:00Added an answer on May 22, 2026 at 6:25 pm

    You should use PARTIAL_WAKE_LOCK in your case.

    I’m not sure why SCREEN_DIM_WAKE_LOCK is not enough (didn’t find any documentation that justifies this), but PARTIAL_WAKE_LOCK worked just fine for me in a similar scenario.

    As another option you may use WifiLock. But you need to be smart about that, as your network connection may be 2G or 3G, not Wi-Fi only. So you shouldn’t hold Wi-Fi lock when you are actually using 3G/2G/etc.

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

Sidebar

Related Questions

I have been developing an iPhone app which queries a server that relays data
I am developing an android app in which i need to display images after
I am developing a app for a movie in which I need to fetch
I am developing an app which supposed to work on devices that have OS
I am developing an app using android OS for which I need to know
I am developing an app which uses gps. i need a high accuracy so
I am developing a app in android .... which need a code snippet to
I am developing a web app that relies on the ability to send thousands
I am developing an application which is based on user challenges. The app also
I am developing an app that needs to send text messages, so I have

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.