# Android mode 40% frame drop, without code

**URL:** <https://discourse.processing.org/t/android-mode-40-frame-drop-without-code/13536>\
**Category:** Processing for Android\
**Created:** [August 22, 2019, 12:37am UTC](https://discourse.processing.org/t/android-mode-40-frame-drop-without-code/13536 "2019-08-22T00:37:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![madscience2728](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@madscience2728](https://discourse.processing.org/u/madscience2728)\
**Post date:** [August 22, 2019, 12:37am UTC](https://discourse.processing.org/t/android-mode-40-frame-drop-without-code/13536/1 "2019-08-22T00:37:19Z")

</div>

```auto
void setup()
{

}

void draw()
{
  println(frameRate);
}

```

**That is the only code.** Even with a diy framerate check instead of println(frameRate); same results.  
**Tested on Galaxy S9:** sometimes stable 60fps, 70% of the time drops to 35fps almost immidiately or after 5-30 seconds.  
**Tested on Galaxy Tab-A:** spikes down to 40fps every few seconds, hovers around 55.

I was having some really bad fps problems when switching to android mode. I fixed and optimized, but I eventually commented out all of my code until only that was left chasing the problem. My next step is to develop with Android Studio, using Processing as a dependancy (which is new to me, I have never done much outside of Processing, but I guess it’ll be good if I want to become an app developer, I just hope the problem does not happen there as well).

**Processing 3.5.3**  
**OS:** Linux Mint 19.2 Cinnamon  
**Kernel:** 44.15.0-54-generic  
**Processor:** AMD A12-9720P RADEON R7

**Android SDK Build-Tools:** 26.0.2  
**Android SDK Platform 26:** 2  
**Android SDK Build-Tools:** 26.0.3  
**Android SDK Tools:** 26.1.1  
**Android SDK Platform-Tools:** 29.0.2

**Galaxy S9 Android Version:** 9  
**Galaxy S9 Kernel:** 4.9.112-16319031  
**Galaxy S9 Model:** SM-G960W

The full code is running at about 20fps on the S9, 16 on the Tab-A. In any case it would seem I can not get my code to not lag somehow somewhere, even though I am practically certain all magor sources are gone. I do not use any images (image(PImage, x, y)) as that seems to really mess things up. I have PShape objects for my tiles instead of images or recalculating the shape data for each redraw. I don’t have things that update when they don’t need too, and what I do is so minor it takes time\<=1ms. Link to full code here:

> **[WordWiseBugFullCode.zip](https://drive.google.com/file/d/1CAZAEBIZ4LI8BinokXTB-eS9LaMQIT_G/view?usp=sharing)**
>
> Google Drive file.

  
or here: [https://www.dropbox.com/s/4k8obaxbxvyx0sx/WordWiseBugFullCode.zip?dl=0](https://www.dropbox.com/s/4k8obaxbxvyx0sx/WordWiseBugFullCode.zip?dl=0)

 ![Screenshot_20190821-203359_One%20UI%20Home](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2fc5530153e7d1ec631f3307663032134003d282.jpeg)

Any insights? Thank you

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [August 30, 2019, 7:31am UTC](https://discourse.processing.org/t/android-mode-40-frame-drop-without-code/13536/2 "2019-08-30T07:31:15Z")

</div>

Hi.  
I am trying to load your code, but what is “home/madscience2728/sketchbook/Screen\_Manager\_Library/Screen\_Manager\_Library.pde” supposed to do in this tab?

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 31, 2019, 2:29pm UTC](https://discourse.processing.org/t/android-mode-40-frame-drop-without-code/13536/3 "2019-08-31T14:29:41Z")

</div>

My first suggestion is to use the P2D renderer if you are not doing so. Add `fullScreen(P2D);` and see if you see an improvement.

I would also avoid calling println in every draw loop. For example I would do: `if(frameCount%60==0) {println(frameRate);}`

Kf

---

<div class="post-metadata">

**Author:** ![madscience2728](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@madscience2728](https://discourse.processing.org/u/madscience2728)\
**Post date:** [September 2, 2019, 4:14am UTC](https://discourse.processing.org/t/android-mode-40-frame-drop-without-code/13536/4 "2019-09-02T04:14:49Z")

</div>

Shoot, sorry I forgot the library is actually a symlink, as it makes it acting like a libray a million times easier because I can edit anywhere with instant universal changes.

**Update: The problem is due to WQHD+ resolution on Android.** I’ll try adding the P2D in my test program, see if that works. For now I’ve moved on to Unity and making my game awesomely 3D. Thank you.
