# Processing for Android

**URL:** https://discourse.processing.org/c/processing-android/12.md?no_subcategories=false&page=21

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 22

---

## [How to set sketch size as a ratio of displayWidth](https://discourse.processing.org/t/how-to-set-sketch-size-as-a-ratio-of-displaywidth/15160)

<div class="topic-metadata">

**Author:** [@blosh](https://discourse.processing.org/u/blosh)\
**Replies:** 5\
**Last updated:** [November 3, 2019, 2:11pm UTC](https://discourse.processing.org/t/how-to-set-sketch-size-as-a-ratio-of-displaywidth/15160 "2019-11-03T14:11:20Z")

</div>

I want to set my sketch in a 9:16 ratio. Processing doesn’t allow the use of variables for size() and using displayWidth and displayHeight causes it to crash. surface.setSize doesn’t work in Android Mode. What options ar…

---

## [How to change website to mobile application](https://discourse.processing.org/t/how-to-change-website-to-mobile-application/15125)

<div class="topic-metadata">

**Author:** [@imperial](https://discourse.processing.org/u/imperial)\
**Replies:** 7\
**Last updated:** [November 1, 2019, 8:37pm UTC](https://discourse.processing.org/t/how-to-change-website-to-mobile-application/15125 "2019-11-01T20:37:02Z")

</div>

hey guys? i have a website i want to change my website to android mobile application what should i do?

---

## [Use pixel density to scale the sketch](https://discourse.processing.org/t/use-pixel-density-to-scale-the-sketch/15096)

<div class="topic-metadata">

**Author:** [@Yash](https://discourse.processing.org/u/Yash)\
**Replies:** 3\
**Last updated:** [November 1, 2019, 11:21am UTC](https://discourse.processing.org/t/use-pixel-density-to-scale-the-sketch/15096 "2019-11-01T11:21:41Z")

</div>

How to use pixel density () method so i can scale my sketch irrespective of the device.(device dpi)?

---

## [Prevent sleep in android](https://discourse.processing.org/t/prevent-sleep-in-android/15011)

<div class="topic-metadata">

**Author:** [@J\_Emmerson](https://discourse.processing.org/u/J_Emmerson)\
**Replies:** 17\
**Last updated:** [October 31, 2019, 1:39pm UTC](https://discourse.processing.org/t/prevent-sleep-in-android/15011 "2019-10-31T13:39:12Z")

</div>

I’m making a counter for a card game and I need a function to prevent android from entering sleep mode

---

## [Is there an Android Mode 4.1 problem(characters are broken.) / solution?](https://discourse.processing.org/t/is-there-an-android-mode-4-1-problem-characters-are-broken-solution/15033)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 9\
**Last updated:** [October 31, 2019, 3:53am UTC](https://discourse.processing.org/t/is-there-an-android-mode-4-1-problem-characters-are-broken-solution/15033 "2019-10-31T03:53:33Z")

</div>

‘Foreign language is not expressed.’ Even if you change the font, the characters are broken. ex) Korean, Japanese, Chinese, etc. println() does not work. Is there a solution? Help. I need your help.

---

## [\[Android\] I can't find a solution. 'Notification pop up' is required](https://discourse.processing.org/t/android-i-cant-find-a-solution-notification-pop-up-is-required/14961)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 13\
**Last updated:** [October 30, 2019, 4:27pm UTC](https://discourse.processing.org/t/android-i-cant-find-a-solution-notification-pop-up-is-required/14961 "2019-10-30T16:27:20Z")

</div>

\[Android\] I can’t find a solution. ‘Notification pop up’ is required. Reference: \[Android\] 'Notification' does not work ‘Notification pop up’ doesn’t work after Android version is higher. Can anyone solve it? Pleas…

---

## [\[Android Mode4.0\] oscP5, udp library error](https://discourse.processing.org/t/android-mode4-0-oscp5-udp-library-error/15017)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 3\
**Last updated:** [October 30, 2019, 2:41pm UTC](https://discourse.processing.org/t/android-mode4-0-oscp5-udp-library-error/15017 "2019-10-30T14:41:28Z")

</div>

\[Android Mode4.0\] oscP5, udp library error Good morning. After updating your Android version, The oscP5 library does not work. The udp library does not work. Is there a solution? Or is there an example source code f…

---

## [Println not working](https://discourse.processing.org/t/println-not-working/5400)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 10\
**Last updated:** [October 29, 2019, 9:15pm UTC](https://discourse.processing.org/t/println-not-working/5400 "2019-10-29T21:15:28Z")

</div>

How can I use println in the android mode? I can make apps fine, but I never see the print lines appearing in the console.

---

## [Changing targetSdkVersion?](https://discourse.processing.org/t/changing-targetsdkversion/14723)

<div class="topic-metadata">

**Author:** [@bertin](https://discourse.processing.org/u/bertin)\
**Replies:** 20\
**Last updated:** [October 29, 2019, 8:47pm UTC](https://discourse.processing.org/t/changing-targetsdkversion/14723 "2019-10-29T20:47:48Z")

</div>

Hi all! I’m trying to publish my first android game on the Play Store, but when I try to upload my apk, which I have exported with Processing, Google rejects it, saying that my targeted sdk versione is 26, while the min…

---

## [Android build won't work](https://discourse.processing.org/t/android-build-wont-work/15000)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 2\
**Last updated:** [October 29, 2019, 7:37pm UTC](https://discourse.processing.org/t/android-build-wont-work/15000 "2019-10-29T19:37:31Z")

</div>

Android build won’t work. Since updating from Android mode 3.0 to 4.0 In no case will it build. Reinstall Android 4.0. Delete and reinstall processing. Delete the library file and reinstall. It doesn’t build no matt…

---

## [Multi touch improvement](https://discourse.processing.org/t/multi-touch-improvement/14982)

<div class="topic-metadata">

**Author:** [@PhoenixStormJr](https://discourse.processing.org/u/PhoenixStormJr)\
**Replies:** 2\
**Last updated:** [October 28, 2019, 6:07pm UTC](https://discourse.processing.org/t/multi-touch-improvement/14982 "2019-10-28T18:07:21Z")

</div>

Hi everyone. I’m not sure if y’all need multi touch for Android but this will do the trick. I made some improvements to Ak Eric’s code. This new code can track which finger you removed and finger# is only false if you re…

---

## [App crashes after onStop() with P2D -- please help!](https://discourse.processing.org/t/app-crashes-after-onstop-with-p2d-please-help/14971)

<div class="topic-metadata">

**Author:** [@hunterkiddo](https://discourse.processing.org/u/hunterkiddo)\
**Replies:** 4\
**Last updated:** [October 28, 2019, 5:22pm UTC](https://discourse.processing.org/t/app-crashes-after-onstop-with-p2d-please-help/14971 "2019-10-28T17:22:47Z")

</div>

Hi, I’m using P2D in my fullscreen() because the default renderer runs my app at around 20 fps, whereas P2D can render it in full 60+ fps. However, a bug now occurs. When I press the “Recents” button or the home button t…

---

## [Pixelflow library in Android](https://discourse.processing.org/t/pixelflow-library-in-android/10715)

<div class="topic-metadata">

**Author:** [@mrtn](https://discourse.processing.org/u/mrtn)\
**Replies:** 3\
**Last updated:** [October 27, 2019, 2:35am UTC](https://discourse.processing.org/t/pixelflow-library-in-android/10715 "2019-10-27T02:35:21Z")

</div>

Can somebody use the library Pixelflow on android? I have a code that runs on Windows, but on Android, after the builiding, I have these errors:

---

## [Problem with android mousePressed](https://discourse.processing.org/t/problem-with-android-mousepressed/14933)

<div class="topic-metadata">

**Author:** [@anony](https://discourse.processing.org/u/anony)\
**Replies:** 5\
**Last updated:** [October 25, 2019, 7:37pm UTC](https://discourse.processing.org/t/problem-with-android-mousepressed/14933 "2019-10-25T19:37:01Z")

</div>

First of all: sorry for my bad english, i’m not. I tried to use mousePressed in android, and initially works. But after some tests, i found a serius problem. By clicking quickly at the same time with two fingers and rele…

---

## [Screen proportion for cellphones](https://discourse.processing.org/t/screen-proportion-for-cellphones/14908)

<div class="topic-metadata">

**Author:** [@kelwinzxu](https://discourse.processing.org/u/kelwinzxu)\
**Replies:** 7\
**Last updated:** [October 24, 2019, 9:16am UTC](https://discourse.processing.org/t/screen-proportion-for-cellphones/14908 "2019-10-24T09:16:28Z")

</div>

Hello I’m new in Processing so I have a question for cellphones proportion… Imagine that I have the following code: void setup(){ size(900,1600); } void draw(){ backgroud(0); ellipse(150,1200,300,300); ellipse…

---

## [Android mode error - Build does not run](https://discourse.processing.org/t/android-mode-error-build-does-not-run/14896)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [October 23, 2019, 12:20pm UTC](https://discourse.processing.org/t/android-mode-error-build-does-not-run/14896 "2019-10-23T12:20:53Z")

</div>

Please see the picture above. This error occurs. Is there a workaround? Help me.

---

## [\[Android\] 'Notification' does not work](https://discourse.processing.org/t/android-notification-does-not-work/14512)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 6\
**Last updated:** [October 23, 2019, 11:45am UTC](https://discourse.processing.org/t/android-notification-does-not-work/14512 "2019-10-23T11:45:10Z")

</div>

import android.os.Build; import android.app.NotificationChannel; import android.app.NotificationManager; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat; impor…

---

## [Restarting app programmatically](https://discourse.processing.org/t/restarting-app-programmatically/14658)

<div class="topic-metadata">

**Author:** [@noel](https://discourse.processing.org/u/noel)\
**Replies:** 6\
**Last updated:** [October 23, 2019, 6:30am UTC](https://discourse.processing.org/t/restarting-app-programmatically/14658 "2019-10-23T06:30:14Z")

</div>

Hi. I want to restart my app from startup and after googling some snippets I found code below. It gives however the Exception error. Until now I restart my program by emptying all arrays and images and run simply setup()…

---

## [Enable multiDex in processing](https://discourse.processing.org/t/enable-multidex-in-processing/14834)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 1\
**Last updated:** [October 21, 2019, 5:32pm UTC](https://discourse.processing.org/t/enable-multidex-in-processing/14834 "2019-10-21T17:32:59Z")

</div>

One of my android sketches got a fair bit large, causing build errors related to dex. in After trial and error, I figured out that normally in android studio, you would simply add multiDexEnabled true to gradle default…

---

## [Build errors on a previously working sketch](https://discourse.processing.org/t/build-errors-on-a-previously-working-sketch/14784)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 5\
**Last updated:** [October 20, 2019, 6:59pm UTC](https://discourse.processing.org/t/build-errors-on-a-previously-working-sketch/14784 "2019-10-20T18:59:08Z")

</div>

I was working on implementing ads into my sketch, then I started getting this error. I have reverted the sketch back to its original state, but it’s still getting the new error. full error at: https://pastebin.com/j5Az…

---

## [Wake Lock // Screen Awake](https://discourse.processing.org/t/wake-lock-screen-awake/14745)

<div class="topic-metadata">

**Author:** [@doordewar](https://discourse.processing.org/u/doordewar)\
**Replies:** 1\
**Last updated:** [October 16, 2019, 2:49pm UTC](https://discourse.processing.org/t/wake-lock-screen-awake/14745 "2019-10-16T14:49:33Z")

</div>

Hey droids, I would like to ask if anyone here has experience with using WAKE\_LOCK on android applications. I have made an interactive application with audio (Processing Sound libraries) and the magnet sensor (Ketai). …

---

## [onPinch() not working (ketai library)](https://discourse.processing.org/t/onpinch-not-working-ketai-library/14603)

<div class="topic-metadata">

**Author:** [@Waboqueox](https://discourse.processing.org/u/Waboqueox)\
**Replies:** 3\
**Last updated:** [October 15, 2019, 1:05pm UTC](https://discourse.processing.org/t/onpinch-not-working-ketai-library/14603 "2019-10-15T13:05:48Z")

</div>

Hi there… I’m trying to use Pinch, so I started to try the ketai library, tried on android mode, exported to AS (Android Studio) and it works fine. But my problem is trying to use it in my code… I don’t know why it does…

---

## [Audio delay in interactive software](https://discourse.processing.org/t/audio-delay-in-interactive-software/14693)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 0\
**Last updated:** [October 14, 2019, 2:09pm UTC](https://discourse.processing.org/t/audio-delay-in-interactive-software/14693 "2019-10-14T14:09:57Z")

</div>

I am creating a game for both android and pc. It has audio. I get an odd 300~600ms delay in audio playback in both Android and PC. I get the same delay when only drawing 4 sprites as I do when drawing 17 sprites along…

---

## [Struggling to implement admob](https://discourse.processing.org/t/struggling-to-implement-admob/14694)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 0\
**Last updated:** [October 14, 2019, 2:28pm UTC](https://discourse.processing.org/t/struggling-to-implement-admob/14694 "2019-10-14T14:28:17Z")

</div>

import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.MobileAds; I am attempting to implement banner ads into …

---

## [What is the most efficient way of coding drag and zoom for android](https://discourse.processing.org/t/what-is-the-most-efficient-way-of-coding-drag-and-zoom-for-android/13391)

<div class="topic-metadata">

**Author:** [@bzFear](https://discourse.processing.org/u/bzFear)\
**Replies:** 2\
**Last updated:** [October 14, 2019, 1:34pm UTC](https://discourse.processing.org/t/what-is-the-most-efficient-way-of-coding-drag-and-zoom-for-android/13391 "2019-10-14T13:34:14Z")

</div>

I am new to processing and I’ve been looking for a while for a way to zoom and drag for my andriod app. I don’t need it to be very robust. just something to zoom in and drag around a certain sketch. I have ideas but I am…

---

## [Paying basic sounds in android, fail NoClassDefFoundError](https://discourse.processing.org/t/paying-basic-sounds-in-android-fail-noclassdeffounderror/14546)

<div class="topic-metadata">

**Author:** [@Waboqueox](https://discourse.processing.org/u/Waboqueox)\
**Replies:** 1\
**Last updated:** [October 14, 2019, 8:59am UTC](https://discourse.processing.org/t/paying-basic-sounds-in-android-fail-noclassdeffounderror/14546 "2019-10-14T08:59:03Z")

</div>

Hi people; I think this is a really nooby error but I don’t know how to fix it… And reading in some places I’m not able get the solution (and inside processing forum, nearly all topics about sounds are on loaded sounds,…

---

## [Audio issues... Help please!](https://discourse.processing.org/t/audio-issues-help-please/14402)

<div class="topic-metadata">

**Author:** [@Hubbit200](https://discourse.processing.org/u/Hubbit200)\
**Replies:** 17\
**Last updated:** [October 12, 2019, 4:29pm UTC](https://discourse.processing.org/t/audio-issues-help-please/14402 "2019-10-12T16:29:35Z")

</div>

So, basically I’m creating an Android app in Java, which I want to be able to play audio files (Various simultaneously). They’ll be in the data folder, and are all less than 4 minutes long. I got it all set up with the p…

---

## [TextView with icon](https://discourse.processing.org/t/textview-with-icon/14630)

<div class="topic-metadata">

**Author:** [@noel](https://discourse.processing.org/u/noel)\
**Replies:** 0\
**Last updated:** [October 12, 2019, 1:21pm UTC](https://discourse.processing.org/t/textview-with-icon/14630 "2019-10-12T13:21:00Z")

</div>

Hi. I want to add an icon to my TextView with something like: TextView tv = (TextView) findViewById(TxtViewIdNumber); tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon, 0, 0, 0) But since I only have the data…

---

## [Custom AlertDialog box](https://discourse.processing.org/t/custom-alertdialog-box/14588)

<div class="topic-metadata">

**Author:** [@noel](https://discourse.processing.org/u/noel)\
**Replies:** 1\
**Last updated:** [October 11, 2019, 8:39pm UTC](https://discourse.processing.org/t/custom-alertdialog-box/14588 "2019-10-11T20:39:32Z")

</div>

Hi. The code below will popup a dialog box, giving the option to continue or end the program. I want to customize the box using a text view. The uncommented setting does however not work. How can I link this? import…

---

## [TextView with border stroke](https://discourse.processing.org/t/textview-with-border-stroke/14570)

<div class="topic-metadata">

**Author:** [@noel](https://discourse.processing.org/u/noel)\
**Replies:** 1\
**Last updated:** [October 11, 2019, 7:06pm UTC](https://discourse.processing.org/t/textview-with-border-stroke/14570 "2019-10-11T19:06:38Z")

</div>

Hi. I want a textView with a gray background, white text and a red border stroke. In the code below I get the border and text but the background becomes transparent. What is the right way to achieve this? import andro…

[Previous page](https://discourse.processing.org/c/processing-android/12.md?no_subcategories=false&page=20)

[Next page](https://discourse.processing.org/c/processing-android/12.md?no_subcategories=false&page=22)
