# APDE and switch(String) compile errors

**URL:** https://discourse.processing.org/t/apde-and-switch-string-compile-errors/5649
**Category:** Processing for Android
**Created:** [November 17, 2018, 10:43pm UTC](https://discourse.processing.org/t/apde-and-switch-string-compile-errors/5649 "2018-11-17T22:43:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![InSat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/insat/32/2403_2.png) [@InSat](https://discourse.processing.org/u/InSat)
#### Post date: [November 17, 2018, 10:43pm UTC](https://discourse.processing.org/t/apde-and-switch-string-compile-errors/5649/1 "2018-11-17T22:43:26Z")

</div>

Hello, I’m a begginer with APDE and processing, and meed some help.

I create this sketch on Processing 3.4 in Windows : no PB, it’s juste a sample.

//-------------------------  
String state = “none”;  
int w, h;  
void setup() {  
state = “setup”;  
w = 100;  
h = 100;  
}

void draw() {  
switch(state) {  
case “none”: /\* do nothing \*/ break;  
case “setup”: state = “draw”; break;  
case “draw”: line(0, 0, random(0, w), random(0, h)); break;  
}  
}  
//-------------------------

But when I try to run it under my Phone with APDE verrsion 0.5.0 I have many compiles errors.  
Ok managing a state in a string is not a good idea, this is just a sample to have the compile error.

Initializing build sequence…

Deleted old build folder

Injected log broadcaster

Detected architecture armeabi-v7a

Packaging resources with AAPT…

Compiling with ECJ…

* * *

1. ERROR in /data/data/com.calsignlabs.apde/app\_build/src/processing/test/switch/switch.java (at line 1)

package processing.test.switch;

```
                    ^^^^^^

```

Syntax error on token “switch”, Identifier expected

* * *

1. ERROR in /data/data/com.calsignlabs.apde/app\_build/src/processing/test/switch/switch.java (at line 17)

public class switch extends PApplet {

```
         ^^^^^^

```

Syntax error on token “switch”, Identifier expected

* * *

* * *

1. ERROR in /data/data/com.calsignlabs.apde/app\_build/src/processing/test/switch/MainActivity.java (at line 1)

package processing.test.switch;

```
                    ^^^^^^

```

Syntax error on token “switch”, Identifier expected

* * *

1. ERROR in /data/data/com.calsignlabs.apde/app\_build/src/processing/test/switch/MainActivity.java (at line 23)

sketch = new switch();

```
         ^^^^^^

```

Syntax error on token “switch”, invalid ClassType

* * *

* * *

1. ERROR in /data/data/com.calsignlabs.apde/app\_build/src/processing/test/switch/APDEInternalLogBroadcasterUtil.java (at line 1)

package processing.test.switch;

```
                    ^^^^^^

```

Syntax error on token “switch”, Identifier expected

* * *

* * *

1. ERROR in /data/data/com.calsignlabs.apde/app\_build/gen/processing/test/switch/R.java (at line 8)

package processing.test.switch;

```
                    ^^^^^^

```

Syntax error on token “switch”, Identifier expected

* * *

6 problems (6 errors)

---

<div class="post-metadata">

### Author: ![calsign](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/calsign/32/30_2.png) [@calsign](https://discourse.processing.org/u/calsign)
#### Post date: [November 19, 2018, 9:35pm UTC](https://discourse.processing.org/t/apde-and-switch-string-compile-errors/5649/2 "2018-11-19T21:35:31Z")

</div>

The problem is that you have named your sketch `switch`, which is a keyword in Processing/Java. The compiler errors are with the code that Android mode generates around your sketch. You need to rename your sketch something else, from menu \> “Rename Sketch”.
