Jump to content
mmoalem

looking for a way to automate trigger from android phone to turn a windows application on/off

Recommended Posts

Hi all - was wondering if the following is possible:

I have a motion detecting ccrv software on PC (icam or similar) - there is a bottom that turn surveillance (motion detection) on and off. I can get autoit to automate the clicking on the button. 

 

I want my android phone to send a trigger every time it disconnect from the home network (i.e when I leave home) to tell autoit to turn on surveillance and when reconnecting to home network to trigger it to click off

 

does any one have a suggestion how to go about achieving this?

Share this post


Link to post
Share on other sites

So my computer is connected to my wifi, and my phone is connected to my wifi...so I can ping my phone continually.

When I leave, and my phone disconnects, the ping will return a failure, and I can have the same locally running script on my computer click the button.  Then I'll start looping the ping until it succeeds in pinging the cell phone, and click the other button.

I'm not sure if the IP is generated real time or not though, so it might change with each reconnect.  You can get the IP by going to your wifi page, clicking on your home's wifi settings.  It will display all the info including the IP.

$myCellPhoneIP = "127.0.0.1"

While True
    While Ping($myCellPhoneIP)
        Sleep(5000)
    WEnd
    ConsoleWrite("Failed to ping $myCellPhoneIP=[" & $myCellPhoneIP & "]" & @CRLF)
    ControlClick('yourwindow',"","your button")
    While Not Ping($myCellPhoneIP)
        Sleep(5000)
    WEnd
    ConsoleWrite("Able to ping $myCellPhoneIP=[" & $myCellPhoneIP & "]" & @CRLF)
    ControlClick('yourwindow',"","your button")
WEnd

If the IP does change (you can test by turning on and off your phones wifi), then you will have to google how to dynamically get the ips connected to your network, such as looping through an IP range that your local wifi uses.

 

Edit: I know this isn't exactly what you asked for, you'll have to wait for someone else for your specific question, but this is a very simple way to do the same kind of functionality.

 

Another route: 

I suppose you can then create a file on your phone whenever, which you can check for on your computer, inside that mapped drive.  Then when you get home, you can delete the file, which your script can check for, and turn off your application.

I'd stick with the pings, because then I wouldn't have to do manually add in a file, or manually delete a file, it would just work.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

thank you very much for the suggestion - very clever work around - didnt even think about this way... the only thing I wonder is the overhead of pinging continuously - I know pinging is only a tiny load on the network but is continuously doing so adds up to a lot of unnecessary  traffic/cpu load ?

Share this post


Link to post
Share on other sites

No problem at all, its not like you're going to crash the network by means of denial of service.

Ping is very light on the network and you can time it for some seconds of interval.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

i would suggest you install Tasker and the AutoRemote plugin on your Android phone, then install EventGhost on PC along with its AutoRemote plugin. then spend lots of hours searching the respective forums for those apps to learn how to make Tasker use AutoRemote to send commands to EventGhost to run AutoIt scripts and vice versa. Then after you have your project working to your satisfaction start experimenting with lots of other ways to automate your phone/pc and start making pointless scripts that eat up more of your time than the initial action you wanted to automate would actually take you to perform manually.


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah patience, how long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

Ha! that sounds like me sometimes. @alienclone


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Inpho
      Hi All,
      I didn't know where to put this; my apologies if this is the wrong location.
      When you plug a Samsung mobile device (phone, tablet, etc.) into the USB of a Windows PC, you can right-click the device in My Computer and select Properties. Here, it will show you the correct serial number of the device. Clearly Windows doesn't use adb to get the SN so I'm stuck at how to get the SN without adb and where the device doesn't have a drive letter assigned to it.
      When I last picked this up, I tried seemingly everything I could from wmi(?) and winmgmts(?) but either it's hidden cloak-and-dagger style or I can't see the forest for the trees...
      Does anyone know what API Windows uses when getting the serial number of a device Windows calls a Portable Media Player?

    • By rudi
      Hello,
       
      I found a couple of threads asking quite similar questions, but without finding a "straight" solution to Access the internal phone storage as well as the plugged in SD-Card.
       
      While the SD Card is quite an easy Job (shutdown phone, remove SD, plug into some Card Reader, Access it using a drive letter), the internal storage isn't accessible this way.
       
      Of course I *CAN* Access all the (regular visible) Content, when connected to a Windows box.
       
      But this way I cannot estimate, where all the space was eaten up. So I'd like to know, how to address the "root" Folder of the internal storage of my Android Phone to get it's subfolders and files. Going through the whole Folder tree recursively isn't my Problem, it's just howto address the very first Folder and then to read all files (with sizes) and names of the subfolders.
       
       
      Regards, Rudi.
    • By wisem2540
      I am a huge autoit fan and have written several graphical apps.  I would love to get started building simple and complex android apps.  I am hoping someone here can recommend a good platform to get started with.  Preferably something that had an Autoit-like feel
    • By Miliardsto
      Hello Im wondering if using this https://ohtejera.github.io/ImperiusAutoIt/#started
      UDF can i make that I can control my windows application with phone?
      like for example click button Start on android phone and then something would be done in my windows app?
    • By gillesg
      Hello all,
      First, I wish you a happy new year.
      I am building with autoit a substitution tool to sync my iTunes playlist with my android phone.
      I have managed reading the itunes lib, but now I am stuck at reading / writing on my android device.
      From all the searches I made, it is using MTP protocol. 
      The Windows Explorer can read and write on the device.
      The device appears as a "portable device".
       
      Does anyone of you can direct me in some direction to keep investigate.
       
      Thanks in advance
       
      Gilles
×
×
  • Create New...