FlickStart available on Google Play use it with FlickNet also available on Google Play
                
Downloads  Home  About  Contact 

 Driving FlickNet from another App

Introduction

Since FlickStart drives FlickNet via Android intents, it's equally possible for other Android apps to drive FlickNet in the same way. If FlickNet is installed on a phone (and WinFlickNet is visible on the same WiFi network), any Android app can deliver commands to PCs using FlickNet.

On this page we look at how Android intents should be structured to drive FlickNet.

Components of the Android Intent

FlickNet expects intents to be structured broadly as follows:

       Intent intent = new Intent();
       intent.setAction("com.neologue.flicknet.CMD");
       intent.putExtra("param_name1", "param_value1");
       intent.putExtra("param_name2", "param_value2");
             .              .              .
       this.sendBroadcast(intent);

Any intents will have at least one putExtra statement with a "parameter_name"/"parameter_value" pair.

The possible parameter names and the range of possible associated values as well as the impact of using the parameter and how it interacts with other parameters are detailed here.

Examples

A Known Key Sequence

This example assumes a context for creating the intent where you know the entire sequence of characters (and delays) before-hand and can just fire of the whole sequence in a single intent.

Here we will use the example shown elsewhere where we use the Windows Logo key to throw up a 'Run' box and use it to start Notepad, type some text into it and then attempt to close the Notepad window:

       Intent intent = new Intent();
       intent.setAction("com.neologue.flicknet.CMD");
       intent.putExtra("keys", "#(r)!!!notepad{ENTER}!!!!test text{ENTER}now try to close%(fx)");
       this.sendBroadcast(intent);

The special characters like "#" and "!" are described here.

An Unfolding Key Sequence

If you need to send keys over a series of intents because you only discover which keys to send bit by bit, you will probably end up with an example like this one.

In the example above, the "keys" parameter can 'hold down' qualifier keys during processing of the string supplied as the value of the "keys" command. At the end end of the "keys" sequence all the qualifier keys are automatically released. However, sometimes a qualifier needs to be held down for an unknown period of time.

In this example we fire off an intent which does a KEYDOWN on the SHIFT key, then fire off more intents with keys (as determined via some unspecified user interactions) and then finally send a KEYUP to restore the SHIFT key to the the unshifted state. Since no app or set_focus is mentioned in the intents, the key activity in this example will go to the window currently having focus.

       Intent intent = new Intent();
       intent.setAction("com.neologue.flicknet.CMD");
       intent.putExtra("keys", "");
       intent.putExtra("sticky", "1");
       intent.putExtra("shift", "1");
       this.sendBroadcast(intent);
             .              .              .
       Intent intent = new Intent();
       intent.setAction("com.neologue.flicknet.CMD");
       intent.putExtra("keys", "test");
       this.sendBroadcast(intent);
             .              .              .
       Intent intent = new Intent();
       intent.setAction("com.neologue.flicknet.CMD");
       intent.putExtra("keys", "");
       intent.putExtra("sticky", "1");
       intent.putExtra("shift", "-1");
       this.sendBroadcast(intent);

Direct Keys at a Specific App

In this example we use parameters to choose a running copy of Adobe Reader and send a key sequence that toggles fullscreen mode on the app:

       Intent intent = new Intent();
       intent.setAction("com.neologue.flicknet.CMD");
       intent.putExtra("app", "AcroRd32");
       intent.putExtra("window_class", "AcrobatSDIWindow");
       intent.putExtra("keys", "^{|}");
       intent.putExtra("set_focus", "true");
       this.sendBroadcast(intent);

Privacy Policy