# Problem with running a simple sketch on Android

**URL:** <https://discourse.processing.org/t/problem-with-running-a-simple-sketch-on-android/40732>\
**Category:** Processing for Android\
**Created:** [January 28, 2023, 6:54pm UTC](https://discourse.processing.org/t/problem-with-running-a-simple-sketch-on-android/40732 "2023-01-28T18:54:58Z")\
**Posts on this page:** 1\
**Showing post:** 34

<div class="post-metadata">

**Author:** ![Glenton](https://avatars.discourse-cdn.com/v4/letter/g/8edcca/32.png) [@Glenton](https://discourse.processing.org/u/Glenton)\
**Post date:** [February 2, 2023, 9:18am UTC](https://discourse.processing.org/t/problem-with-running-a-simple-sketch-on-android/40732/34 "2023-02-02T09:18:48Z")

</div>

Hello,

Last step done, it works!  
I have now a processing sketch on my phone that communicates with a processing sketch on my PC!

Thank to the netstat command svan lead me to and ipconfig, I finally figured out what was wrong. I just had to plug and unplug different network connections to find what was the good ip adress to use in the client sketch…

To summarize what I did:

-For the problem with running an app on a smartphone using processing, the problem was solved with using Android Studio and [following this tutorial](https://android.processing.org/tutorials/android_studio/index.html).

-For the problem with using the client class of the library [processing.net](http://processing.net) with processing on Android Studio, the solution was to:

- create a new java class named “Client” (next to the processing sketch and MainActivity, in the same folder. I easily did it from AS).
- Copy/paste modified client code from [this discussion](https://discourse.processing.org/t/android-mode-import-processing-net-fails-build/28473/2) in this new java class
- Add the line (replace “][” by \>\<) [uses-permission android:name=“android.permission.INTERNET”] in the AndroidManifest.xml file

Then be careful with the ip adress set in the client sketch. Using ipconfig and netstat from a cmd terminal can help a lot!

---

_[View the full topic](https://discourse.processing.org/t/problem-with-running-a-simple-sketch-on-android/40732)._
