depicus

  just another nerd on the interweb…



  • home
  • gallery
  • play page
  • support
  • videos
  • what is depicus

Archive for the ‘Android’ Category

Android: Getting the Broadcast Address of your Wifi connection

Sunday, May 1st, 2011



If you ever need to know the broadcast address of your wifi connection…

View Code JAVA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
private InetAddress getBroadcastAddress() throws IOException {
	WifiManager myWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
	DhcpInfo myDhcpInfo = myWifiManager.getDhcpInfo();
	if (myDhcpInfo == null) {
		System.out.println("Could not get broadcast address");
		return null;
	}
	int broadcast = (myDhcpInfo.ipAddress & myDhcpInfo.netmask)
				| ~myDhcpInfo.netmask;
	byte[] quads = new byte[4];
	for (int k = 0; k < 4; k++)
	quads[k] = (byte) ((broadcast >> k * 8) & 0xFF);
	return InetAddress.getByAddress(quads);
}

Tags: Java, Wifi
Posted in Android | No Comments »

Android: Getting the Wifi Ip Address

Sunday, May 1st, 2011



This is how to get the ip address of your Android phone.

View Code JAVA
1
2
3
4
WifiManager myWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
WifiInfo myWifiInfo = myWifiManager.getConnectionInfo();
int ipAddress = myWifiInfo.getIpAddress();
System.out.println("WiFi address is " + android.text.format.Formatter.formatIpAddress(ipAddress));

Make sure you also add

View Code JAVA
1
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

to your Application Manifest.

Tags: Java, Wifi
Posted in Android | 3 Comments »

Testing UDP in the Android Emulator

Saturday, April 30th, 2011



Well it looks like my Android HTC Wildfire is fucked…. looks like receiving UDP broadcasts does not work according to this

So it’s off to the emulator to test there … ugggh.

1. First telnet localhost 5554 to get you to the emulator console
2. Then simply redir add udp:4343:4343 to forward that port on the local machine to the emulator.

This problem with HTC phones isn’t going to do the Android cause any good :(

Tags: Crap
Posted in Android | No Comments »

Wake on Lan for Android – updated to 1.4

Monday, February 14th, 2011



Nothing much exciting just added the ability to name the bookmarks like the iOS version.

Tags: Update
Posted in Android, Wake On Lan | No Comments »

Wake on Lan for Android is live

Monday, February 7th, 2011



Well that was quick. Seems Google don’t check apps before they go live so it took only a few minutes to go live and here it is…

https://market.android.com/details?id=com.depicus.wakeonlan

Tags: Release
Posted in Android | 2 Comments »

<< Previous Next >>

  • how i pay the bills

  • google rank getter

    Android Apache Aperture Apple App Store bbPress Bike Bug Canon 7D Code Dell DotNet Dropbox Fail Firefox forum Frustration Golf iPad iPhone iPod Touch Java Kenya Linksys Macbook Pro Netgear Objective C Open Source OSX PHP Rejected Safari Server Skype Support Ubuntu Update WakeOnLan Wake On Lan Wifi Windows Windows 7 Phone Wireshark Wordpress XCode
  • depicus in africa

    depicus in africa
  • friends

    • Agency Manager
    • AllClear Travel
    • Climbing Tikes
    • Globe Bloggers
    • Marchday
    • The Travel Toad
  • gallery

    IMG_2589 IMG_2570 IMG_3536 Bisley Developments Ltd
  • videos

    Vimeo

    YouTube
  • twitter

    • Holy geekness batman we have an Arduino doing Wake on Lan forwarding programmed in less than 4 hours… amazing - #iamanubergeektoday view
    • Arduino WoLF app coming along nicely view
    • RT @pasm69: On the one hand we are in a #drought says #thameswater, on the other £4.1B to throw rainwater down the #supersewer #itisjust ... view
  • recent comments

    • Sef: Yo, thats 720p @ 60fps. Huge Difference… in file size, processing, everything. DSLRs aren’t there...
    • Finson: Worked..!! Replaced all the InstallOnLHS and InstallOnWinXP with value 0 and the installation completed...
    • Geux: Terminal command didn’t work, but editing the plist manually did the trick. Thanks !!!
    • Nebras Alattar: Hi The code that you posted is very useful, but i faced a problem when i run the app i got the...
    • leon: how can I get the ImageIO.framework ? I’ve read that it doesn’t exist for iphone!!!! Can anyone...
  • archives

    • May 2012 (2)
    • April 2012 (4)
    • February 2012 (8)
    • January 2012 (6)
    • December 2011 (7)
    • November 2011 (1)
    • October 2011 (2)
    • September 2011 (2)
    • August 2011 (4)
    • July 2011 (6)
    • June 2011 (9)
    • May 2011 (8)
    • April 2011 (2)
    • February 2011 (6)
    • January 2011 (14)
    • December 2010 (9)
    • November 2010 (8)
    • October 2010 (14)
    • September 2010 (6)
    • August 2010 (9)
    • July 2010 (1)
    • June 2010 (2)
    • May 2010 (2)
    • April 2010 (2)
    • March 2010 (11)
    • February 2010 (3)

Copyright © - depicus | Entries (RSS) | Comments (RSS)

WordPress theme butchered and amended by me.