BasicAirData / GPSLogger

A GPS logger for Android mobile devices
http://www.basicairdata.eu/projects/android/android-gps-logger/
GNU General Public License v3.0
403 stars 126 forks source link

Add more activity type icons #152

Closed szpak closed 2 years ago

szpak commented 3 years ago

I really like the simplicity of your logger and a possibility to visualize the track offline. Using it on canoeing, I would propose to add that icon to a set of already provided (to easier distinguish that kind of trips on the track list).

I don't know if there are rules to help automatically detect that kind (an alignment with rives could be hard to determine), however, just having an icon for a manual selection would be completely useful.

h2ad2 commented 3 years ago

Good point! In addition, I would like to propose some sort of "public transport" icon in addition to the airplane. A train, perhaps?

GrazianoCapelli commented 3 years ago

We should add more icons to identify additional track types. For example boat, ski, bus, train, motorbike...

Unfortunately there is no way to estimate these kind of activities without internet connection and a method related to terrain analysis, thus you should add them only as manually selectable icons. I think we should find a way to add all these additional icons to the details dialog avoiding the icons bloating on dialog area, in order to keep simple and eye-balanced the interface.

Could I rename the issue with a mor generic title, in order to use this issue to collect proposals and ideas for additional activity icons? We could use it also for post graphical mockups, in order to think and discuss the implementation.

szpak commented 3 years ago

I think we should find a way to add all these additional icons to the details dialog avoiding the icons bloating on dialog area, in order to keep simple and eye-balanced the interface.

Sounds very sensible. In the context of canoeing I was also thinking only about a manual assignment.

Could I rename the issue with a mor generic title, in order to use this issue to collect proposals and ideas for additional activity icons? We could use it also for post graphical mockups, in order to think and discuss the implementation.

Sure, go on.

h2ad2 commented 3 years ago

Another option would be to (optionally) completely drop the guesswork and leave it up to the user.

Eg. I bike to the station, take a train into town, and walk the last mile to the office. GPS-Logger's guess is that I drove all the way, door to door. I don't need no guesswork from the software here! Keep it simple and stupid.

Actually, the way I use GPS-Logger is to get more accurate timeline results in Google Maps because my phone only updates the timeline once every so-many minutes. Nothing I can do about that, but GPS-Logger helps improve the resolution. (Btw, my phone is an Android 9, Motorola G6, in case anybody has suggestions how to improve my experience.)

TVEgit commented 2 years ago

I'm not sure I should post here but anyway: I'd like to export the activity in the gpx file. I didn't find the dedicated tag in the gpx specifications, but dropping it as a keyword in the metadata section would work for me. It could be parsed down the road by receiving system.

GrazianoCapelli commented 2 years ago

@TVEgit In effect unfortunately there is no dedicated tag for it. Please post some GPX lines to show us what you would like to have into GPX files, starting from one of our headers.

TVEgit commented 2 years ago

Here is an example. There is already a metadata section. It should be simple to add the keywords tag then use it for passing activity type (or other useful keywords). Ideally, the settings of GPS Logger should let the user create (and store) key-value pairs to map the different activity icons in GPS Logger with the keyword to be exported in this tag. There can be more than one keyword so they should be comma-separated.

<metadata> 
 <name>GPS Logger 20220116-092645</name>
 <desc>Boucle SRN Charpal - Fortunio</desc>
 <time>2022-02-02T10:52:32Z</time>
 <keywords>Activity=MTB</keywords>
</metadata>

Alternatively, a keywords field where users could just type in whatever keywords they wish to pass into the appropriate GPX section could be added to GPS Logger.

GrazianoCapelli commented 2 years ago

In effect, basing on what is written into the GPX 1.1 Manual:

<keywords> Optional in: <gpx> <keywords>Hiking, NH, Presidential Range</keywords> Keywords for indexing the GPX file with search engines. Comma separated.

the <keywords> tag could be a good place where to put the activity type. Reading the example, the best approach to follow the guidelines is the following:

<keywords>walking</keywords>

Obviously the activity type should always be expressed in English, in order to keep the keywords homogeneous across the languages. Since we can freely choose a convention, we could copy the activity definitions from Garmin:

Both GPX standards have the <keyword> field, but in different places (GPX 1.1 requires to place it into <metadata> section). Thus two examples of it are the following:

GPX 1.0

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0"
     creator="BasicAirData GPS Logger 3.1.3-dev.20220205"
     xmlns="http://www.topografix.com/GPX/1/0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<name>GPS Logger 20220205-173623</name>
<desc>First small outdoor activity with Iris</desc>
<time>2022-02-06T13:18:36Z</time>
<keywords>walking</keywords>
...

GPX 1.1

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1"
     creator="BasicAirData GPS Logger 3.1.3-dev.20220205"
     xmlns="http://www.topografix.com/GPX/1/1"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata> 
 <name>GPS Logger 20220205-173623</name>
 <desc>First small outdoor activity with Iris</desc>
 <time>2022-02-06T20:23:26Z</time>
 <keywords>walking</keywords>
</metadata>
...

Both the examples here above passed the Xerces validation test, and could be implemented. We are used to validate our GPX files using Xerces (mine is the v3.2.3 for Linux):

SAXCount -v=always -n -s -f file_to_validate.gpx

@TVEgit I opened the issue #163 to track, discuss, and implement this topic.

GrazianoCapelli commented 2 years ago

As a note, some people requested to add water related activity types, for example boat and canoe.

GrazianoCapelli commented 2 years ago

I pushed a first commit that starts the implementation of a new dialog that allows the user to choose among a good number of activity types. As first implementation, I chosen the following approach:

Screenshot_20221023-221929_GPS Logger_S

I tried to subdivide the activities in categories (Fitness, Water & Snow, Wheel, Air, and Other); I already made/added a quite complete list of activities to try to cover almost all the users needs, but in the next commits I'll refine it, basing also on your feedback.

Time for suggestions...

TVEgit commented 2 years ago

That should be good to propose all these activities' icons but ideally, each user should be able to create his/her own set of icons. Displaying this list with a check box for each and saving the list as a subset presented at the time of saving the file should work well. I hope I made myself clear enough...

GrazianoCapelli commented 2 years ago

I agree, it is not practical for the user to choose the activity type using the dialog that I posted yesterday all the time. I was thinking to keep a subset of icons on the details screen (graphically where we currently show the activity icons) where we could simply show the last 5 - 6 used icons, with the possibility to open the big chooser (at this purpose I temporarily placed a right arrow on the edit details dialog, as shown here below) when the activity is not listed on the subset.

Details_20221024

h2ad2 commented 2 years ago

I kinda like the approach taken on my Android9 phone:

  1. swipe down from the top of the screen: one line of options appears
  2. swipe down again: a full page of options appears
  3. swipe right: more pages of options appear

Not saying it should be exactly like this, but it may help find a direction to go on this issue. Maybe a "more" and "next" button.

On Mon, Oct 24, 2022 at 9:40 AM Cat @.***> wrote:

I agree, it is not practical for the user to choose the activity type using the dialog that I posted yesterday all the time. I was thinking to keep a subset of icons on the details screen (graphically where we currently show the activity icons) where we could simply show the last 5 - 6 used icons, with the possibility to open the big chooser (at this purpose I temporarily placed a right arrow on the edit details dialog, as shown here below) when the activity is not listed on the subset.

[image: Details_20221024] https://user-images.githubusercontent.com/6907566/197470310-f8582490-86c8-4bbc-a96d-5d4322b09f10.jpg

— Reply to this email directly, view it on GitHub https://github.com/BasicAirData/GPSLogger/issues/152#issuecomment-1288554533, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOZBCIN4DM32HQP7ALPIVLWEY4N5ANCNFSM5C7SIF7Q . You are receiving this because you commented.Message ID: @.***>

-- TimeOfDay | timeofday.nl | +31 (0)68 198 6848

GrazianoCapelli commented 2 years ago

Here below a list of tasks to be done to implement this feature, in order to keep track of the implementation status:

GrazianoCapelli commented 2 years ago

@h2ad2 - We are going in this direction (that is the most used in the Android apps): we placed a "More" button on the right of the icons subset (something like an arrow, or 3 horizontal dots); clicking it will open the big dialog. After some thoughts I tried this approach as first implementation and I found it simple and intuitive.

I thought to adapt the 6 icons of the subset to contain the estimated (1) and the latest used (5) icons, but maybe I'll try to add a second line of icons to have an idea of the visual appeal of the interface.

GrazianoCapelli commented 2 years ago

The complete list of the activity names (that are written into <keywords> tag of GPX files) is into Track.java, starting from row number 90. At the moment we defined the following types:

            "steady",                                           // STEADY           = 0
            "walking",                                          // WALK             = 1
            "mountaineering",                                   // MOUNTAIN         = 2
            "running",                                          // RUN              = 3
            "cycling",                                          // BICYCLE          = 4
            "car",                                              // CAR              = 5
            "flying",                                           // FLIGHT           = 6
            "hiking",                                           // HIKING           = 7
            "nordic_walking",                                   // NORDICWALKING    = 8
            "swimming",                                         // SWIMMING         = 9
            "scuba_diving",                                     // SCUBADIVING      = 10
            "rowing",                                           // ROWING           = 11
            "kayaking",                                         // KAYAKING         = 12
            "surfing",                                          // SURFING          = 13
            "kitesurfing",                                      // KITESURFING      = 14
            "sailing",                                          // SAILING          = 15
            "boat",                                             // BOAT             = 16
            "downhill_skiing",                                  // DOWNHILLSKIING   = 17
            "snowboarding",                                     // SNOWBOARDING     = 18
            "sledding",                                         // SLEDDING         = 19
            "snowmobile",                                       // SNOWMOBILE       = 20
            "snowshoeing",                                      // SNOWSHOEING      = 21
            "ice_skating",                                      // ICESKATING       = 22
            "helicopter",                                       // HELICOPTER       = 23
            "rocket",                                           // ROCKET           = 24
            "paragliding",                                      // PARAGLIDING      = 25
            "air_balloon",                                      // AIRBALLOON       = 26
            "skateboarding",                                    // SKATEBOARDING    = 27
            "roller_skating",                                   // ROLLERSKATING    = 28
            "wheelchair",                                       // WHEELCHAIR       = 29
            "electric_scooter",                                 // ELECTRICSCOOTER  = 30
            "moped",                                            // MOPED            = 31
            "motorcycle",                                       // MOTORCYCLE       = 32
            "truck",                                            // TRUCK            = 33
            "bus",                                              // BUS              = 34
            "train",                                            // TRAIN            = 35
            "agriculture",                                      // AGRICULTURE      = 36
            "city",                                             // CITY             = 37
            "forest",                                           // FOREST           = 38
            "work",                                             // WORK             = 39
            "photography",                                      // PHOTOGRAPHY      = 40
            "research",                                         // RESEARCH         = 41
            "soccer",                                           // SOCCER           = 42
            "golf",                                             // GOLF             = 43
            "pets",                                             // PETS             = 44
            "map"                                               // MAP              = 45
GrazianoCapelli commented 2 years ago

Note for developers

We are using the standard icons available as vector asset in Android Studio (the Google Material icons).

When the icon was not present into that standard library, we used the icons published on https://materialdesignicons.com/. This icon collection is released as free, open source, and GPL friendly by the Pictogrammers icon group. The icons are usable for commercial projects, open source projects, or anything really. Here you can read the License.

GrazianoCapelli commented 2 years ago

The implementation of the feature is finished, it needs only some tests that I'll do in the next days. the Edit Details dialog (and also the Finalization one) now has an arrow on the right of the icons subset, that allows to open the big activity chooser:

issue-152 - 20221104

At this time we could add additionally activities and polish the visual appearance of the interface. This is a good time to propose activities that I hadn't thought of, or to discuss the work we made.

GrazianoCapelli commented 2 years ago

The feature has been merged into develop branch, and it will be included into the next release of the app. I close the issue, feel free to comment here or re-open it in case of need.

szpak commented 2 years ago

Thanks @GrazianoCapelli for you work!