Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
View Poll Results: What does u want in the next version?
Ability to read/write the device contacts? 1 50.00%
Ability to read/write device sms/mms? 1 50.00%
Voters: 2. You may not vote on this poll

Post Reply

[DEV] AndroidCtrl.dll [0.0.0.5] (AAPT/ADB/Fastboot/(apk/zip) Signer - Framework)

OP k1ll3r8e

5th November 2014, 12:47 PM   |  #61  
squabbi's Avatar
Senior Member
Flag Sydney
Thanks Meter: 925
 
1,125 posts
Join Date:Joined: Jul 2012
Donate to Me
More
Hey there dude! Long time no speak! how are u?

I would like to ask if it's possible to have a live output of the commands.

Thanks!
6th November 2014, 04:01 PM   |  #62  
OP Senior Member
Flag Delmenhorst
Thanks Meter: 99
 
153 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by squabbi

Hey there dude! Long time no speak! how are u?

I would like to ask if it's possible to have a live output of the commands.

Thanks!

Hey bro
-
I'm fine - And u?

What does u mean with live outputs?

U can use for example:

Code:
...
using AndroidCtrl;
using AndroidCtrl.ADB;
...

// Get the shell instance
ShellRT _shell = ADB.Instance().ShellRT;

// or a superuser shell
// AndroidCtrl.ADB.Device.SuShellRT _shell = ADB.Instance().Device.Su.ShellRT;

// define the callback for shell response
_shell.Callback += OutputCallback;

// sending an command
_shell.SendCMD("ur command");

// Callback for shell response
public void OutputCallback(object sender, ProcessResponseArgs e)
{
    if (String.IsNullOrEmpty(e.Response) == false)
    {
        App.Current.Dispatcher.Invoke((Action)delegate
        {
            // do what u want with "e.Response"
        });
    }
}
On other hand u can use Logging.Logger{}.

Hope this helps u

EDIT:
For understanding,
ShellRT, SuShellRT and a few other classes inherit RealTimeBG. This will mean u can also directly call RealTimeBG, like this (untested) example:
Code:
...
using AndroidCtrl;
using AndroidCtrl.ADB;
using AndroidCtrl.ProcessModels;
...

public class StatusWindow : RealTimeBG
{
    public StatusWindow()
    {
        Exe = ADB.PATH_ADB;
        Args = "status-window";
        Start();
    }
}

// instance of StatusWindow
StatusWindow test = new StatusWindow();

// define the callback for shell response
test.Callback += OutputCallback;

// sending an command
test.SendCMD("ur command");

// Callback for shell response
public void OutputCallback(object sender, ProcessResponseArgs e)
{
    if (String.IsNullOrEmpty(e.Response) == false)
    {
        App.Current.Dispatcher.Invoke((Action)delegate
        {
            // do what u want with "e.Response"
        });
    }
}
Last edited by k1ll3r8e; 6th November 2014 at 05:40 PM.
The Following User Says Thank You to k1ll3r8e For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
adb, androidctrl.dll, dll, fastboot, framework
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes