Re: acces droidscript files apps via sftp with external editor.

85 views
Skip to first unread message
Message has been deleted

Chisan Gelu

unread,
Apr 18, 2026, 9:58:11 AM (9 days ago) Apr 18
to DroidScript
hi. i created a droidscript plugin who enable a ftp or sftp access to droidscript folder .

usage: create a droidscript app in ide :

function OnStart()
{
var servicejs=`
app.LoadPlugin("FtpServer");

var sftp;

function OnStart()
{
app.SetInForeground("SFTP","SFTP","","","high");
    sftp = app.CreateFtpServer();
    sftp.SetOnServerEvent(OnEvent);
    sftp.SetProtocol("sftp");
    sftp.SetAuth("user1", "pass1");
    sftp.Start(2222);
   
    // Notify user
    app.ShowPopup("SFTP started on port 2222");
}

function OnMessage(msg)
{
    if(msg == "stop") {
        if(sftp) sftp.Stop();
        app.StopService();
    }
}

function OnEvent(status, msg)
{
    // optional: notify main app
}
`;

app.WriteFile( "Service.js", servicejs );

    lay = app.CreateLayout("linear", "VCenter,FillXY");
    txt = app.CreateText( "", 0.4 );
    txt.SetTextSize( 22 );
    lay.AddChild( txt );

    btn = app.CreateButton("Start SFTP", 0.5);
    btn.SetOnTouch(function() {
        svc = app.CreateService("this", "this", OnServiceReady,"Persist");
        svc.SetOnMessage( OnServiceMessage );
    });
    lay.AddChild(btn);

    btnStop = app.CreateButton("Stop SFTP", 0.5);
    btnStop.SetOnTouch(function() {
        if(svc) svc.SendMessage("stop");
    });
    lay.AddChild(btnStop);

    app.AddLayout(lay);
}

function OnServiceReady()
{
    txt.SetText("Service Ready");
}

function OnServiceMessage( msg )
{
    txt.SetText( "Count: " + msg );
}



the run the app and press start SFTP.........



FTP dosent work to connect from same device......only from another device.....

sftp works from same device.....

check plugin samples docs....`


tested on : Android 16 Acode editor (very good editor) and in MAcOS VSCOE extension SFTP/FTP sync by Natizyskunk .......

the sftp server is alive while droidscript ide open.......after starting ftp server from app,you can exit that app and run another apss...it uses a service.......

also use thi setting to droidscript ide WhatsApp Image 2026-04-18 at 16.54.00.jpeg
On Saturday, April 18, 2026 at 2:06:58 PM UTC+3 Chisan Gelu wrote:
hi. i created a droidscript plugin who enable a ftp or sftp access to droidscript folder .

usage: create a droidscript app in ide :

function OnStart()
{
var servicejs=`
app.LoadPlugin("FtpServer");

var sftp;

function OnStart()
{
    sftp = app.CreateFtpServer();
    sftp.SetOnServerEvent(OnEvent);
    sftp.SetProtocol("sftp");
    sftp.SetAuth("user1", "pass1");
    sftp.Start(2222);
   
    // Notify user
    app.ShowPopup("SFTP started on port 2222");
}

function OnMessage(msg)
{
    if(msg == "stop") {
        if(sftp) sftp.Stop();
        app.StopService();
    }
}

function OnEvent(status, msg)
{
    // optional: notify main app
}
`;

app.WriteFile( "Service.js", servicejs );

    lay = app.CreateLayout("linear", "VCenter,FillXY");
    txt = app.CreateText( "", 0.4 );
    txt.SetTextSize( 22 );
    lay.AddChild( txt );

    btn = app.CreateButton("Start SFTP", 0.5);
    btn.SetOnTouch(function() {
        svc = app.CreateService("this", "this", OnServiceReady);
        svc.SetOnMessage( OnServiceMessage );
    });
    lay.AddChild(btn);

    btnStop = app.CreateButton("Stop SFTP", 0.5);
    btnStop.SetOnTouch(function() {
        if(svc) svc.SendMessage("stop");
    });
    lay.AddChild(btnStop);

    app.AddLayout(lay);
}

function OnServiceReady()
{
    txt.SetText("Service Ready");
}

function OnServiceMessage( msg )
{
    txt.SetText( "Count: " + msg );
}



the run the app and press start SFTP.........



FTP dosent work to connect from same device......only from another device.....

sftp works from same device.....

check plugin samples docs....`


tested on : Android 16 Acode editor (very good editor) and in MAcOS VSCOE extension SFTP/FTP sync by Natizyskunk .......

the sftp server is alive while droidscript ide open.......after starting ftp server from app,you can exit that app and run another apss...it uses a service.......


DogPlanner GSS

unread,
Apr 20, 2026, 3:53:48 AM (7 days ago) Apr 20
to DroidScript
Hello,

thank you for info and link! Could you describe more in detail why is it needed?

Thank you very much in advance. Have a nice day!

Best regards
Dmitry

суббота, 18 апреля 2026 г. в 16:58:11 UTC+3, gel...@gmail.com:

Alan Hendry

unread,
Apr 20, 2026, 5:08:04 AM (7 days ago) Apr 20
to DroidScript
HI,
In DS you can write/edit your code 
using the built-in editor or the WiFi IDE.
This plugin and DS app allows you to use other editors
that can use ftp/sftp (or have extensions to do so), 
to access the DS folder directly.
Other editors may have additional abilities (for example an AI assistant).
Regards, ah

DogPlanner GSS

unread,
Apr 20, 2026, 5:32:04 AM (7 days ago) Apr 20
to DroidScript
Dear Alan,

thank you very much for clarification! 
Ok, we will know this but DroidScrit tools are enough for us at this moment.

Have a nice day.

Best regards
Dmitry
понедельник, 20 апреля 2026 г. в 12:08:04 UTC+3, hendr...@gmail.com:

Chisan Gelu

unread,
Apr 20, 2026, 12:07:11 PM (6 days ago) Apr 20
to DroidScript

i think there are users who will want to use external editor......at the same others users want to use only droidscript bultin editors.......its every one choice: good to have to choice !!!
Screenshot 2026-04-20 at 19.05.21.png

DogPlanner GSS

unread,
Apr 22, 2026, 4:17:07 AM (5 days ago) Apr 22
to DroidScript
Dear Gelu,

thank you very much! You did a great job of making this feature available and publishing it. I only wanted to say about myself - I work with built-in DroidScript editor, and it's very convenient for me, but for many developers it's a really useful option.

Thank you again! Have a nice day.

Best regards
Dmitry
понедельник, 20 апреля 2026 г. в 19:07:11 UTC+3, gel...@gmail.com:
Reply all
Reply to author
Forward
0 new messages