Hallo,
i´m using KSWEB to have MySQL, PHP, Webserver running on my Device. BUT i don´t want to have all of them running all the time. My goal is to start server(s) when my App is started. The Authors of KSWEB publishes a java-Class which should be included with the activity. See KSWEBControl.java.txt (changd ext to .txt to be able to upload here)
Is someone here able to make a library out of it? I would really appreciate any help in this...
I´m disposed to give a donation for it...
They published a blog about this class here:
KSWEB Control
You can control KSWEB by your application via Android Broadcast messages. Note that this feature is in beta testing at the moment and this is the first version of it. List of commands will be changed and be refined over time.
To apply control commands use this java class in your Android project: KSWEBControl.java
The typical usage is to extend this class by your main activity. Each command requires a tag for tracking of the result of its execution. KSWEB sends an answer with a tag via Broadcast after executing any command. It can be KSWEBControl.RESPOND_OK or KSWEBControl.RESPOND_ERROR.
Here you can see a list of available commands to control KSWEB.
This group of static commands allows you to start/stop components (servers) of KSWEB
public static void ftpStart(Activity activity, String tag);
public static void ftpStop(Activity activity, String tag);
public static void lighttpdStart(Activity activity, String tag);
public static void lighttpdStop(Activity activity, String tag);
public static void nginxStart(Activity activity, String tag);
public static void nginxStop(Activity activity, String tag);
public static void mysqlStart(Activity activity, String tag);
public static void mysqlStop(Activity activity, String tag);
These commands allow to start/close KSWEB. “Finish activity” allows to unload KSWEB from memory without shutting down servers
public static void kswebStart(Activity activity, String tag);
public static void kswebClose(Activity activity, String tag);
public static void kswebFinishActivity(Activity activity, String tag);
To configure servers use these commands
Content of configuration file will be replaced by data from configTxt parameter.
public static void lighttpdSetConfig(Activity activity, String tag, String configTxt);
public static void nginxSetConfig(Activity activity, String tag, String configTxt);
public static void phpSetConfig(Activity activity, String tag, String configTxt);
public static void mysqlSetConfig(Activity activity, String tag, String configTxt);
To control http servers host list you can use these commands
public static void lighttpdAddHost(Activity activity, String tag, String hostname, String port, String rootDir);
public static void lighttpdDeleteHost(Activity activity, String tag, String hostname, String port, String rootDir);
public static void nginxAddHost(Activity activity, String tag, String hostname, String port, String rootDir);
public static void nginxDeleteHost(Activity activity, String tag, String hostname, String port, String rootDir);
i´m using KSWEB to have MySQL, PHP, Webserver running on my Device. BUT i don´t want to have all of them running all the time. My goal is to start server(s) when my App is started. The Authors of KSWEB publishes a java-Class which should be included with the activity. See KSWEBControl.java.txt (changd ext to .txt to be able to upload here)
Is someone here able to make a library out of it? I would really appreciate any help in this...
I´m disposed to give a donation for it...
They published a blog about this class here:
KSWEB Control
You can control KSWEB by your application via Android Broadcast messages. Note that this feature is in beta testing at the moment and this is the first version of it. List of commands will be changed and be refined over time.
To apply control commands use this java class in your Android project: KSWEBControl.java
The typical usage is to extend this class by your main activity. Each command requires a tag for tracking of the result of its execution. KSWEB sends an answer with a tag via Broadcast after executing any command. It can be KSWEBControl.RESPOND_OK or KSWEBControl.RESPOND_ERROR.
Here you can see a list of available commands to control KSWEB.
This group of static commands allows you to start/stop components (servers) of KSWEB
public static void ftpStart(Activity activity, String tag);
public static void ftpStop(Activity activity, String tag);
public static void lighttpdStart(Activity activity, String tag);
public static void lighttpdStop(Activity activity, String tag);
public static void nginxStart(Activity activity, String tag);
public static void nginxStop(Activity activity, String tag);
public static void mysqlStart(Activity activity, String tag);
public static void mysqlStop(Activity activity, String tag);
These commands allow to start/close KSWEB. “Finish activity” allows to unload KSWEB from memory without shutting down servers
public static void kswebStart(Activity activity, String tag);
public static void kswebClose(Activity activity, String tag);
public static void kswebFinishActivity(Activity activity, String tag);
To configure servers use these commands
Content of configuration file will be replaced by data from configTxt parameter.
public static void lighttpdSetConfig(Activity activity, String tag, String configTxt);
public static void nginxSetConfig(Activity activity, String tag, String configTxt);
public static void phpSetConfig(Activity activity, String tag, String configTxt);
public static void mysqlSetConfig(Activity activity, String tag, String configTxt);
To control http servers host list you can use these commands
public static void lighttpdAddHost(Activity activity, String tag, String hostname, String port, String rootDir);
public static void lighttpdDeleteHost(Activity activity, String tag, String hostname, String port, String rootDir);
public static void nginxAddHost(Activity activity, String tag, String hostname, String port, String rootDir);
public static void nginxDeleteHost(Activity activity, String tag, String hostname, String port, String rootDir);
Attachments
Last edited: