1

My app is single activity app which is used to generate token slip using WiFi printer over wifi which are connected locally. So the WiFi is always ON. Also the screen is always ON.

I have set android:keepScreenOn="true" in my activity xml file for this.

The tablet is exclusively used for this single app only not more than that. Even though, the battery drains around 4 hours.

Is this common? Or Would I change anything to achieve good battery backup?

anon
  • 855
  • 12
  • 22
  • How could we know if we don't know what is the specs of your phone, as well as how is your App logic? – Raptor Mar 02 '17 at 08:28
  • 1
    4 hours of screen on time sounds like it's about right. – Falmarri Mar 02 '17 at 08:31
  • https://developer.android.com/training/monitoring-device-state/index.html – josemigallas Mar 02 '17 at 08:41
  • @Raptor , sorry for inconvenience. I am using Fusion5 106 (10.6 inch, 8GB, Wi-Fi Only) tablet. Please see the complete details in this link. [link](http://www.amazon.in/Fusion5-106-Tablet-Wi-Fi-White/dp/B0100O2ESQ) – Keerthi Keyan Mar 02 '17 at 09:04
  • You should either connect to power, or don't use `keepScreenOn`. – Raptor Mar 02 '17 at 09:11
  • @Falmarri. Is there anyway to increase the battery stands around 7 hours with above mentioned case? – Keerthi Keyan Mar 02 '17 at 09:22
  • @Raptor, In our app, Owner has to generate token continuously based on customer visit. If i remove 'keepScreenOn', they have to click on power button for wake up the screen. it doesn't make them feeling good. – Keerthi Keyan Mar 02 '17 at 09:25
  • You can make use of Notifications. – Raptor Mar 02 '17 at 09:31
  • @Raptor, Sorry. I couldn't understand. How could I use Notifications here? Would you please explain little more? – Keerthi Keyan Mar 02 '17 at 09:34
  • See [this](http://stackoverflow.com/questions/9631869/light-up-screen-when-notification-received-android) – Raptor Mar 02 '17 at 09:37
  • @Raptor, The post used to light up the screen, when notification comes. But In my case, there is no notification. It is like generating token for coffee at coffee shop. How could I use notification logic here? – Keerthi Keyan Mar 02 '17 at 09:51
  • In my imagination, the notification content can be *You have received a token*. Once access the notification, the App will open with the token displayed. – Raptor Mar 02 '17 at 10:27
  • @Raptor, Ok. Thanks for your suggestions. – Keerthi Keyan Mar 02 '17 at 10:52

1 Answers1

0

Generally if your device is old, There is a chance to expect this kind of situation.

To debug about your network traffic, Follow this link

The network traffic generated by an app can have a significant impact on the battery life of the device where it is running. In order to optimize that traffic, you need to both measure it and identify its source. Network requests can come directly from a user action, requests from your own app code, or from a server communicating with your app.

Link is here

Zumry Mohamed
  • 9,318
  • 5
  • 46
  • 51
  • Thanks for the information. I will test and update the result. FYI, App doesn't connect with remote server, network intensive task,any external request etc. It is purely used to print the string to thermal printer over WiFi, **locally** – Keerthi Keyan Mar 02 '17 at 09:30