# \[SOLUTION\] How to find out my IP address in smartphone WIFI status

**URL:** <https://discourse.processing.org/t/solution-how-to-find-out-my-ip-address-in-smartphone-wifi-status/24131>\
**Category:** Processing for Android\
**Created:** [September 26, 2020, 6:01am UTC](https://discourse.processing.org/t/solution-how-to-find-out-my-ip-address-in-smartphone-wifi-status/24131 "2020-09-26T06:01:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [September 26, 2020, 6:01am UTC](https://discourse.processing.org/t/solution-how-to-find-out-my-ip-address-in-smartphone-wifi-status/24131/1 "2020-09-26T06:01:23Z")

</div>

How to find out my IP address in smartphone WIFI status

Share the source code.

> import android.net.wifi.WifiManager;  
> import android.content.Intent;  
> import android.app.Activity;  
> import android.content.Context;  
> import android.net.wifi.WifiInfo;  
> Activity act;  
> Context cnt;  
> boolean toggle;  
> WifiManager wifi;
> 
> void setup() {
> 
> fullScreen();
> 
> background(0, 0, 100);
> 
> act = this.getActivity();  
> cnt = act.getApplicationContext();  
> wifi = (WifiManager) cnt.getApplicationContext().getSystemService(Context.WIFI\_SERVICE);
> 
> WifiInfo wifiInfo = wifi.getConnectionInfo();  
> int ipAddress = wifiInfo.getIpAddress();  
> String ipString = String.format(“%d.%d.%d.%d”,(ipAddress & 0xff), (ipAddress \>\> 8 & 0xff), (ipAddress \>\> 16 & 0xff), (ipAddress \>\> 24 & 0xff));  
> println(ipAddress);  
> println(ipString);
> 
> }
> 
> void draw() {  
> }
