# JAVA sketch not working in Android

**URL:** https://discourse.processing.org/t/java-sketch-not-working-in-android/29211
**Category:** Processing for Android
**Created:** [April 8, 2021, 8:03am UTC](https://discourse.processing.org/t/java-sketch-not-working-in-android/29211 "2021-04-08T08:03:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MPROCD](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@MPROCD](https://discourse.processing.org/u/MPROCD)
#### Post date: [April 8, 2021, 8:03am UTC](https://discourse.processing.org/t/java-sketch-not-working-in-android/29211/1 "2021-04-08T08:03:36Z")

</div>

I am working on an application which needs to get my router’s IP.  
The following sketch works in JAVA.  
Before running in Android, I checked the Internet option under Permissions.  
With ANDROID, it compiles OK but does not work. I get a long error message, beginning with:  
" (HTTPLog)-Static: isSBSettingEnabled false  
java.io.IOException: Cleartext HTTP traffic to [checkip.dyndns.com](http://checkip.dyndns.com) not permitted  
………".

Thanks for any idea.

my sketch:

String ExtIP;  
PFont font;  
int Green=#4EFA2D;

void setup() {  
size(400,200);

String[] lines = loadStrings(“[http://checkip.dyndns.com](http://checkip.dyndns.com)”);  
println(“there are " + lines.length + " lines”);  
for (int i = 0 ; i \< lines.length; i++) {  
println(lines[i]);  
}  
ExtIP=lines[0];  
ExtIP=ExtIP.substring(ExtIP.indexOf(“ss:”));  
ExtIP=ExtIP.substring(4, ExtIP.indexOf("\</"));  
println(ExtIP);  
font= createFont(“arial Bold”,32);  
fill(Green);  
textFont(font);  
text(ExtIP,10,100);  
}

void draw() {  
}

```auto

```

---

<div class="post-metadata">

### Author: ![AdityaRana](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/adityarana/32/18501_2.png) [@AdityaRana](https://discourse.processing.org/u/AdityaRana)
#### Post date: [April 8, 2021, 6:47pm UTC](https://discourse.processing.org/t/java-sketch-not-working-in-android/29211/2 "2021-04-08T18:47:54Z")

</div>

Hi @MPROCD give INTERNET permission to your app in Manifest and then try.

Hope this will resolve the issue.

thanks,  
rana

---

<div class="post-metadata">

### Author: ![MPROCD](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@MPROCD](https://discourse.processing.org/u/MPROCD)
#### Post date: [April 9, 2021, 8:03am UTC](https://discourse.processing.org/t/java-sketch-not-working-in-android/29211/3 "2021-04-09T08:03:30Z")

</div>

Thank you Rana for this answer. I mentioned in my post that I enabled the Internet option under the sketch permissions. It did not solve the problem. I solved this issue the same way as I did in this post:

“Problem with [processing.net](http://processing.net).\* library in Android]([Problem with processing.net.\* library in Android - #11 by MPROCD](https://discourse.processing.org/t/problem-with-processing-net-library-in-android/28722/12))”.

Thanks for trying to help.
