Closed imraro closed 8 years ago
This is for Tasker and similar apps?
I don't use anything like that, so no idea what is needed.
Specific requests (or merge requests by those who need it) would be nice.
For example: I need to start scanning only when my phone connected to my home WiFi. I create profile "Start Syncthing at Home" with condition: "When connected to Home Wifi" and ation "Run shortcut (or Locale plug-in) Start Syncthing scanning"
This specific functionality is already implemented in the 0.5.0 beta.
I know. I'm testing it now ) It was a very simple example of automation, and even within this sample Syncthing can not determine when I want start syncing only when at home and not when I'm at work. Automation app solves this problems. Second example: I want to start syncing by schedule. Implementation of all these features in the app is a waste of your coding skills, I think. But with shortcuts (preferred because it is android standard) or Locale plug-in all things becomes easier )
Okay, would would be the exact APIs needed for these?
Does it work with intents or something like that?
I'm kind of hesitant to add specific support for a proprietary app.
But if anyone wants to implement this, ideally with support for an open source app, that would be great :)
1) Support for android shortcuts (not Locale plug-ins) is not support for a proprietary app. 2) http://forum.xda-developers.com/android/apps-games/app-sfen-profile-management-app-alpha-t2824497 ( https://github.com/lordgreg/Sfen )
Basically what I'm saying is, I don't have the time/interest to implement this myself, but if anyone wants to do it, just go ahead ;)
Btw Sfen looks interesting.
In tasker you can use REST api x-api-key you'll get from web GUI -> settings -> API Key Url: localhost:8080 http://habitrpg.wikia.com/wiki/User_blog:LadyAlys/Android's_Tasker_app_and_HabitRPG's_API
Here you have API https://discourse.syncthing.net/t/the-rest-interface/85
Please post your progress with Locale/Tasker then :-)
On 23.9.14 15:22, Jacek Szafarkiewicz wrote:
In tasker you can use REST api x-api-key you'll get from web GUI -> settings -> API Key http://habitrpg.wikia.com/wiki/User_blog:LadyAlys/Android's_Tasker_app_and_HabitRPG's_API http://habitrpg.wikia.com/wiki/User_blog:LadyAlys/Android%27s_Tasker_app_and_HabitRPG%27s_API
Here you have API https://discourse.syncthing.net/t/the-rest-interface/85
— Reply to this email directly or view it on GitHub https://github.com/Nutomic/syncthing-android/issues/91#issuecomment-56518170.
This works for Tasker I have this:
Syncthing REST
A1: Variable Set [ Name:%url To:http://localhost:8080/rest/%par1?%par2 Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%api_key To:XXXXXXXXXXX Do Maths:Off Append:Off ]
A3: JavaScriptlet [ Code:try {
var http = new XMLHttpRequest();
http.open("POST", global("url"),false);
http.setRequestHeader("x-api-key", global("api_key"));
http.send(http_post_data);
var result = http.responseText;
}
catch(e) {
var error = e.message;
} Libraries: Auto Exit:On Timeout (Seconds):30 ]
And I run this with e.g. Run Task with params: par1: scan par2: repo=sync
I think you should post this to discourse, it's easier to find and discuss there. And I'll close this issue, because it won't need any changes in the app then.
I also added code tags to your post ;)
It's not a complete solution. It's only workaround for one app (Tasker).
OK then I'll leave it open^^
Fixed by b9919adccd8dd1cddec48f7d514072810c765483.
I just checked on my Nexus 5x (running Android N Preview) that there no activity handles "com.android.launcher.action.INSTALL_SHORTCUT". As indicated by some notes on StackOverflow this is no standard Android functionality. So I don't think it is worth the effort to implement.
But with #599 the functionality should be there to remotely start and stop syncthing by external applications now.
So maybe this issue can be closed now?
I'm not sure what you mean with INSTALL_SHORTCUT, that's not even mentioned in this issue?
And I already closed it ;)
It's the intent-action used to install shortcuts to the home-screen as mentioned in the linked articles.
Ah I missed that. I think something like that should by handled by an external app.
It might be very useful with various automation apps.