streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.9k stars 357 forks source link

Add an API to "inject" quests into StreetComplete #1027

Closed LivInTheLookingGlass closed 6 years ago

LivInTheLookingGlass commented 6 years ago

The idea here is to allow other app developers to come up with quests that are either partially or tangentially related to OpenStreetMap, and use StreetComplete as a framework. This can be achieved by providing an API to other apps on your phone. This API should provide at least the following:

  1. A way to insert a "quest label" that can be turned on or reordered like standard quests
  2. A broadcast that says "I'm scanning for quests in this bbox, please request if you want the contents"
  3. A way to request the contents of a bbox
  4. A way for quests to designate which UI they want, and provide stuff to get put in the template
  5. Either
    1. A broadcast that has the serialized contents of that UI, when completed, OR
    2. The ability for an app to specify how that input gets translated into OSM objects like a normal quest

Additionally, it would be useful if these quests could interact with the camera, like if you were leaving a note. That would enable quests like "These Wikipedia objects with locations do not have pictures", or other such things.

This also allows quest developers to have an easy way to develop quests before submitting them to the main project, since they can push it out for people to test. It also enables regional quests (like #639), or community-specific quests (like #904).

I was told to make this issue in #98

matkoniecz commented 6 years ago

This also allows quest developers to have an easy way to develop quests before submitting them to the main project

Why making quest and injecting quest would be easier than just making quest?

rugk commented 6 years ago

Indeed, I also don't see that advantage.

The use case I'd imagine would be quests clearly outside of the scope of SC (e.g. that Wikipedia thing, which has been mentioned). Other devs could then "dock" their apps at SC and add some quests, so they can be plugins. (maybe that would explain that API thing without too technical terms) So these plugins could just extend SC's functionality and devs have the chance to implement quests not accepted here or only useful for some users. It may also helps the ones (you @matkoniecz?) who use custom forks of SC. You would then maybe "only" have to develop a plugin, which adds the quests you want.

LivInTheLookingGlass commented 6 years ago

@matkoniecz I'm not actually sure that it would be easier. However, if there were an example plugin, and an easy way to fill in your details as if it were a builtin quest, then you could (hopefully) just copy the appropriate parts as a pull request once you've tested it.

matkoniecz commented 6 years ago

The use case I'd imagine would be quests clearly outside of the scope of SC (e.g. that Wikipedia thing, which has been mentioned)

That would make sense, as it would allow distributing addons with quests rejected by @westnordost (including some too specialized ones)

There is cost-benefit question whatever necessary code is worth it, but it is question to @westnordost

You would then maybe "only" have to develop a plugin, which adds the quests you want.

In my case it would not be helpful as I tweak also some parts of interface (like "are you sure" for toggling quest disabled by default), change what is disabled by default and quest order and switch the map style and do some other changes.

ENT8R commented 6 years ago

then you could (hopefully) just copy the appropriate parts as a pull request once you've tested it.

But you can do the same with a normal quest. Just search for an already implemented quest, copy the parts that you need and modify them. This is how I did it too in the beginning

LivInTheLookingGlass commented 6 years ago

In any case, I think we agree that it would help things that are unrelated to OSM, and things that are too specific/specialized to get in mainline StreetComplete.

rugk commented 6 years ago

I think we agree that it would help things that are unrelated to OSM

BTW, can you provide some actual examples/use cases for it? (or things you have in mind or maybe would even implement…)

LivInTheLookingGlass commented 6 years ago

I dont think that I would necessarily implement any of these, but:

rugk commented 6 years ago

add camera info to both OSM and WhereAreTheEyes

is in the scope of StreetComplete and tracked in https://github.com/westnordost/StreetComplete/issues/87

add highly specific dietary guideline quests (kosher, halal, pescetarian, etc)

same: https://github.com/westnordost/StreetComplete/issues/639

As for the otherrs (that are not related to SC): yes, some ideas at least.

LivInTheLookingGlass commented 6 years ago

I mentioned #639 at the top as well, because the main protest against it is that it would be difficult to tell. It seemed to me at the time of writing that it would not be included.

rugk commented 6 years ago

Not included, but discussed and not rejected.

Anyway, let's get back to topic…

westnordost commented 6 years ago

I do not plan to implement such a thing. However, I can follow your argument and it may certainly make sense for other people to use the framework provided by StreetComplete as a data-collector framework but this is clearly nothing I would do, it is out of scope for this project. StreetComplete is for the time-being OpenStreetMap only. Forkers shouldn't have much problems in customizing this for their needs though.