I am looking into making a c# program that will read in the logcat output from an android device and read it in to the c# program.
Initially it should do this while the phone is connected and it shouldn't require a specific app on the phone to be installed for the c# program to be able to retrieve the logcat output. Also the phone shouldn't require root access.
Is this something that is possible, I can't find anything on Google that says its possible but thought I'd ask on here in case someone has some useful information.
Thanks for any help you can provide
The most practical answer is to execute the shell command 'adb logcat' from your C# program and capture its output.
The only requirement for the device is that USB debugging be enabled in the settings menu.
The host PC will require that the android developer tools and appropriate USB driver for the device be installed. This can, unfortunately involve a substantial amount of hassle, especially finding the right drivers for windows hosts.
More complicated approaches would be to duplicate the functionality of the adb program (it is open source) and/or USB driver in your program, or to install an app on the device with the read logs permission which sends them to you - or even run an ssh server under the app userid so you can connect in and obtain them.
Related
In an effort to automate some phone calling processes and integrate TAPI3 with another application, I am using to following code that was found as a sample;
tapi = new TAPI3Lib.TAPIClass();
tapi.Initialize();
foreach (TAPI3Lib.ITAddress ad in (tapi.Addresses as TAPI3Lib.ITCollection))
cbLines.Items.Add(ad.AddressName);
This code fills the devices in a dropdown and the dropdown only contains one device and it only shows from my computer. I tried installing the PIMphony_6.8_bld3200_XX_Alcatel on other computers where i add the IP address of the PBX device and a phone number (ex: 106) but it does not even show in the list the one device that i can see on my computer. I whatsoever have no idea what and how i managed to be able to see the device on my computer when i run this code. Obviously i am missing something. The devices we are using are Alcatel and the phone can be controlled by this app only on my computer. (i can provide the zip file containing PIMphony_6.8_bld3200_XX_Alcatel if needed). So the ultimate goal is to be able to see telephone lines on all computers so we can control them from the computer.
What am i missing Tapi3 experts? is it a missing installation on the other pc's ? and why only my device shows up?
You need a 3rd party TAPI driver installed, it might be on a DVD with the PBXor on some support website, but some manufacturers charge extra for it. This PIMphony looks like a phone control tool but that does not guarantee it is using TAPI under the hood, it may be using some propitiatory protocol.
I don't know TAPI3 but if you use TAPI correctly you should see 3 to 4 standard windows builtin devices (like WAN miniports) even if you have no drivers installed.
You need a decent test tool to compare results with, I would recommend phone.exe, it is kind of the standard test tool in the TAPI business. But it's getting harder to find online these days, here is a link to a slighly extended variant that google got me quickly: https://helpdesk.estos.de/Knowledgebase/Article/View/82/3/howto-ephoneexe--tapi-test-tool
I'm working on troubleshooting a device that only works once it has been unplugged and plugged back into its USB port on the PC.
The application that talks to the device is written in C#. So I need a programmatic way in C# or perhaps batch files, etc. to reset a USB device.
Thus far I've tried using the devcon.exe tool, but that doesn't seem to do the same job that physically removing and adding it back does.
Is it possible to use Win32_USBController to control a USB device's power through the port somehow? MSDN Link
Perhaps in a similar fashion, I found the CIM_Controller class, which has Reset() function. MSDN Link
The tools for resetting a USB port in the Windows Driver Framework/Kit don't appear to be readily accessible via a library or otherwise without first creating an actual driver unless I'm mistaken.
Thanks
I would recommend that you navigate to the directory and find the device. Right click on it and in the short cut menu click on eject. The application and the OS should handle the device. It is a bad idea to "unplug" a USB device, especially flash drives without ejecting them. You could end up with open file errors.
If the problem is not ejecting the device then the issue is probably with the application. If the application is opening a file on the device and the device has to be unplugged in order to function properly then the application may not be closing the open file properly...
Just saying
You might look at the SO link: How to programmatically unplug & replug an arbitrary USB device?
and read through that...
it sounds to me like your scanner is completing a task then shutting it's post down. it remains plugged into the PC but the PC does not 'see' it. go to the directory and see if it is still in the directory...
unplugging once the device shuts down the port does nothing. replugging reconnects the electronics and the PC becomes aware of the device which completes one more task. then shuts down its port again.
Dr t
I've been working with Android for a while, but now my company wants to provide the same solution for iOS as we do for android. To do this I need to be able to get log messages from the phone to my c# application or something that can bridge between the two. In android this was relatively simple, using adb monitor logcat output and send intents through the shell to the application, done.
From what I can tell there is no adb corollary for ios (of course, it's apple, right?). So, does anyone know any way to monitor NSLog messages from and send messages to a physical IPhone via c# or anything that can easily communicate to/from c#?
I would like to have something very similar to adb or more preferably an API dll to reference, but again this is apple so from what I can tell most everything is embedded into their applications and not for public use.
By default, all NSLog statements get routed to Apple System Log (ASL), which is Apple's version of syslog. ASL can be queried using C functions (see asl_set_query, asl_search, and aslresponse_next).
Note : I'm using VS2008 and I'm working on windows 7.
I'm developping a Windows CE application which will run on a Motorola MC3000 device with a WinCE 5.0 like OS .
I tried to use ActiveSync in order to make the test with the selected device possible but it doesn't work on win7, so I tried to find another tool and I found Windows Mobile Device Center based on this discussion .
So Now I can browse with the device but unfortunately I can not test with it : The device have a "santech" application installed and can not kill the app. (even when I reboot the machine, the autorun lunch the app. automatically). Also when I try to deploy my application on the device it return error reports ; sometimes "no disc space" sometimes "the .exe can not be found".
I'm really stucked.
Can some one help me with this, I will be really gratefull.
Sounds like the debugger is attaching just fine, it's just unable to either fully copy the app and dependencies, or there's not enough memory to execute it.
If you can browse the device, you can stop the "santech" app from running. You just have to determine what is launching it. It might be a shortcut in the \Windows\Startup folder. It might be through a registry entry at \[HKLM\Init\]. IIRC, Symbol devices also support a *.run file in the \Application\Startup folder, so check that as well.
One of those is launching the app, so you can eliminate that if you desire.
Next, check the available memory on the device by looking in the Control Panel under System->Memory and adjusting the slider to provide more storage space. If there's not enough Storage Memory to store your app, you might try changing the deployment directory (under Project Properties->Device) to push the app binaries to non-volatile storage of some sort (on-board Flash, SD card, etc), if the device has it.
If you don't have enough Program Memory to run your app, you might be out of luck. Try killing processes to free up some space and playing with the memory allocation slider.
You can debug from inside VS2008 as well. You'll need to tell it to connect to a device as it automatically sends it to a emulator. To do that you need to select Windows CE Device from the dropdown list found in the "Devices" toolbar (To enable go to View, Toolbars and select Devices). Then hit F5 and it should start up on your device. You might get a couple of pop-up boxes that contain a list of devices; make sure these are set to Windows CE Device as well.
This handy page on MSDN should provide the information you need also.
I have a device and the drivers for this device. What I would like to do is build an application that mocks a USB device to communicate with a third party application.
More specifically, I am attempting to build an application that can mock a USB device that mimics a Microsoft Zune. I want to make it so my application can register as a zune device and then communicate with the client. I have added several DLL's to my application in order to attempt to determine the calls that tell the software a connected device is a legitimate zune, but so far I haven't had much luck.
I'm new to this type of development - that is mimicking hardware devices, and I'm not very experienced in importing dll's that were written in C/C++. I am using Visual Studio 2010 (.net 4.0) to develop my app, and I would appreciate any help anyone can offer me towards mimicking the hardware. I do have the device drivers, which Visual studio refuses to reference directly. I also have an actual physical device, so I can see what the drivers are that it uses in Device Manager.
The goal is as follows
Application registers itself as a usb device, mimicking a Microsoft Zune in a similar fashion to how Virtual Clone Drive mimics a DVD player.
Application is recognized by zune client as a valid microsoft zune.
Zune Software works with application as it does the hardware device (syncing, etc)
I just found something called the Device Simulation Framework, which might be exactly what you need. It will still require significant research into how USB works to finish your solution, though. And probably still typically done using C or C++.
The Zune uses a modified version of the MTP protocol called MTPZ, but I found this sample using the Device Simulation Framework to simulate a regular MTP device. It's called The MTP Device Simulator. I can't tell if source code is available.
Are you able to replace the DLLs used by the zune client software with your own DLLs? In that case, you could wrap the original DLLs with your DLLs and intercept the operations.
Update: To find out the signatures of the functions in the DLL, take a look at the Dependency Walker tool, which will list the exported functions (and lots of other information). I'm guessing you will want to write your replacement DLL in C.
Otherwise, you'll have to write drivers that register a USB device with the proper endpoints. I'm not sure how to do this on Windows - I've only done USB coding on the firmware side, not the driver side. You should be able to use any tutorial for creating a Windows USB driver, like Getting Started with USB Driver Development
Zune specifics information might also be useful. Perhaps this blog post and its sequels could help: Inside the Zune/USB Protocol: Part 1