Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Use your Android Phone with your computer keyboard and monitor

Aug
1,929
71
I have found a method that makes it easier for me to use my Android phone. This TCC .BTM makes it even easier to connect my Android phone to my PC.

Joe

Code:
::-------------------------------------------------------------------------------
:: AD.BTM
:: Allows me to use my Android phone with my
::  computer keyboard and monitor
::
:: Requires https://play.google.com/store/apps/details?id=com.sand.airdroid&hl=en
::  to be installed on your Android phone.
::
:: Requires your Android phone to have an active WiFi connection to the same LAN
::  that your computer is on.
::
:: February 2015 - Joe Caverly
::
:: TCC  17.00.75  Windows Vista [Version 6.0.6002]
:: TCC Build 75  Windows Vista Build 6002  Service Pack 2
::-------------------------------------------------------------------------------
@setlocal
@echo off
::
:: My WiFi range is 101 to 105, adjust this for your WiFi LAN
::
do octet=101 to 105
  set themac=%@macaddress[192.168.1.%octet]
  ::
  :: If the MAC Address is the same as my Android phone...
  ::
  iff %themac eq 10-D5-45-70-9F-92 then
  echo Found Joe's Android phone, connecting to Airdroid...
  firefox.exe -new-tab http://192.168.1.%octet:8888
   leave
  endiff
enddo
endlocal
 
Cool, I didn't know about that app. Looks pretty interesting!

Your approach may take a while for larger address ranges. My DHCP server at home is configured with a much larger pool and it would take longer to scan. Instead it might be faster to ping the broadcast address, then check the ARP table for the desired MAC address. Unfortunately that would require the use of external commands unless TCC has some ARP table functions I'm not aware of.

An alternate approach would be to set up your own DNS server that supports dynamic registrations, then you could just go to the correct hostname in your browser... eg, android-0123456789abcdef:8888. This is how I have my home stuff set up. The DHCP server registers its leases with the DDNS server. Probably way too much effort for 99.9% of people though.
 
Back
Top