Using ADB to Launch Web Page With Multiple Querystring Parameters - c#

I'm trying to launch a web page inside a vitual android device. The address of the page takes multiple querystring parameters. For some reason when passing the url in all parameters after the first & are missing (including the &).
I have a very simple C# WinForm app to test this with. I am using MadBee NuGet package to send the commands to the android VM.
When I send the command I see the url loaded but as I described, it is missing the parameters that come after he first &
Below is a snippet of the code I am calling:
command = "am start -a android.intent.action.VIEW -d http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352";
ConsoleOutputReceiver creciever = new ConsoleOutputReceiver();
device.ExecuteShellCommand(command, creciever);
Does anyone have any ideas as to why the parameters would not make it across to Android?

Your parameters "make it across to Android" just fine. What you failed to realize is that your command is getting parsed by the Android shell on the device side and & has a special meaning for it. To stop the shell from treating & as special symbol use quotes like this:
command = "am start -a android.intent.action.VIEW -d 'http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352'";

Related

Firing an event in a tray-icon app when an exe is launched?

I'm trying to write a Tray-Icon application with WPF as a kind of add-on to a telephone software. However my only way of recieving data from said telephone software is by having it automatically execute a URI with parameters (command line or http). Essentially I can freely define the format similar to this:
trayapp.exe --num $caller.number --name $caller.name
When the telephone software recieves a call it'll automatically fill in the parameters and executes the target.
So basically I want a permanently active executable that's running in the background but my only way of getting the necessary info (like caller-number) is by passing it as a command line parameter.
Is there a good way to get the data that's being passed to a URI into my background application? It's not like I can just re-execute the tray-app, or can I? Communication via HTTP (locally!) seems overkill but I just don't know a windows-internal equivalent ...

Make a phone call from Cisco Jabber using .Net console app

I am trying to make a phone call from .Net console Application using Jabber client installed on my laptop.
I want to achieve something similar that you would achieve by the following anchor command in HTML:
Weekly conference call
I want to run the same command through my console application so that it launches Jabber and make a call.
I am not familiar with Jabber, but most likely the client has registered the CISCOTELCONF protocol (similar to how HTTP is registered to your default browser and MAILTO might open Outlook). Therefore you should be able to use Process.Start to pass the same URL to the shell, where it can decide what to do - hopefully invoking the Jabber client as it would if you clicked on the link. You can test this by copy-and-pasting the URL into Start-Run. If it works, then this should also.
var startInfo = new ProcessStartInfo("CISCOTELCONF:msmith#domain;amckenzi#domain")
{
UseShellExecute = true
};
Process.Start(startInfo);
Note the default for UseShellExecute is true, so you do not actually need this line. I've included it anyway because this is what causes Process.Start to, well, invoke the OS shell.

Run application from browser

I could not find any information about this. I am sure there is a term for this type of applications, but I have no idea where to look. That's why I decided to ask here.
So there are a few websites where you hover over a link or button it says something like application:xyz where application usually is the name application to run, and the xyz are the parameters or something.
An example is all the torrent links. If you hover over a link there it says
magnet:?somethingxxxxxxxxxxxx how can I bind my own custom application to a certain URL?
Let's say I have a C# application I call Musiclist. I want to make URLs like: musiclist:?song=hey123
And when I click it in my browser, it opens the application.
I really could not find anything about this with some examples, or how I pass those variables in with the :? in the link, so that's why I cannot provide any code examples.
This is what's called a protocol or a URI Scheme.
This is defined in the registry, so you'd have to add the correct values there:
HKEY_CLASSES_ROOT
<protocol>
(Default) = "URL:<protocol name>"
URL Protocol = ""
DefaultIcon
(Default) = "<path to your application>,<icon index>"
shell
open
command
(Default) = "<path to your application>" "%1"
In your case this could for example be:
HKEY_CLASSES_ROOT
musiclist
(Default) = "URL:Music list protocol"
URL Protocol = ""
DefaultIcon
(Default) = "C:\Program Files\Musiclist\musiclist.exe,0"
shell
open
command
(Default) = "C:\Program Files\Musiclist\musiclist.exe" "%1"
Everything after the colon (:) will be passed to your application as (a) Command Line Argument(s).

Command Line through C# -- commands not executing

I'm using C# and AWS's CLI for S3. I seem to be having the same or a similar issue in two different places. In the first, I'm trying to execute multiple commands with the same process. The first command is to set the environment variables for the access key and secret key for AWS S3. The next two commands are just a simple ls to see what's in the bucket already and a sync to update its contents. If I take the commands to set the environment variables out, it works fine (because I'm already configured on the machine I'm working on), but since I need this to work on other machines, the environment variables need to be set. However, if they are, the following commands do not execute. Here's code for this:
String commands = #"set AWS_ACCESS_KEY_ID=keykeykey set AWS_SECRET_ACCESS_KEY=secretsecretsecret";
commands += #" & aws s3 ls s3://bucket";
commands += #" & aws s3 sync C:\test s3://bucket/kaaaaay";
The issue reappears in a different method. There, I need to get the value from a registry key. I know the command is correct, because it works just fine in a command line window. Here's code for that:
String commands = #"Reg.exe QUERY HKEY_LOCAL_MACHINE\Software\GIJOE\HASAKEY";
Any help would be much appreciated, because I'm stumped.

Selenium Grid Hub shutdown command

Is there a command (from the command line or a webrequest) to shut down a grid 2.0 hub?
I have tried "curl -d action=shutdown http://localhost:4444/lifecycle-manager" (as POST request), I have also tried the usual http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
I've searched everywhere. I would preferably like something without using rake or ant
At version 2.25.0 old-style hub managing added.
So now you can use request like this one to stop hub:
http://localhost:4444/lifecycle-manager?action=shutdown

Categories

Resources