• Stars
    star
    119
  • Rank 287,452 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library to parse XML Gpx files, built for Android.

Android Arsenal

Android GPX Parser

Table of Contents:

  1. Description
  2. Module Structures
  3. Projects using this library
  4. Download
  5. Dependencies
  6. Usage
  7. License

Description

A library to parse GPX files, built for Android. The reference schema is the Topografix GPX 1.1.
In addition, it parses the speed extension, when provided as a double number.

GPX is an XML file format to represent GPS data: coordinates, routes, waypoints, and more.

Pull requests are welcome! Please check the issues and open a pull request when done: you will have made the world a better place.

Module Structure

  1. App: an example usage of the library.
  2. Parser: the library itself.

Projects using this library:

To have your project listed here, please send me an email or open a PR.

Download

Add the Jitpack repository to your root build file. The way you do this depends on the Gradle plugin you are using.

If using Gradle plugin 7.0.0. or newer (default for new apps since Android Studio Artic Fox)

// in settings.gradle
dependencyResolutionManagement {
    ...
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

For older verions of Gradle:

// in project-level build.gradle
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Finally, in your dependencies list

dependencies {
    implementation 'com.github.ticofab:android-gpx-parser:2.3.1'
}

Dependencies

The following is an open github repo that has date and time handling. Keep in mind that the following dependency also has dependencies of its own.

Usage

In Java:

GPXParser parser = new GPXParser(); // consider injection
Gpx parsedGpx = null;
try {
    InputStream in = getAssets().open("test.gpx");
    parsedGpx = parser.parse(in); // consider using a background thread
} catch (IOException | XmlPullParserException e) {
    // do something with this exception
    e.printStackTrace();
}
if (parsedGpx == null) {
    // error parsing track
} else {
    // do something with the parsed track
    // see included example app and tests
}

In Kotlin:

val parser = GPXParser() // consider injection
try {
    val input: InputStream = getAssets().open("test.gpx")
    val parsedGpx: Gpx? = parser.parse(input) // consider using a background thread
    parsedGpx?.let {
        // do something with the parsed track
        // see included example app and tests
    } ?: {
        // error parsing track
    }
} catch (e: IOException) {
    // do something with this exception
    e.printStackTrace()
} catch (e: XmlPullParserException) {
    // do something with this exception
    e.printStackTrace()
}

License

Copyright 2015 - 2023 Fabio Tiriticco - Fabway

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

akka-cluster-kubernetes

Code for our talk about achieving elasticity with Akka Cluster and Kubernetes
Scala
33
star
2

play-scala-webjars-react

The React.js tutorial implemented using Play, Scala and Webjars. Accompanies a blog post.
Scala
29
star
3

simple-play-websocket-server

Example WebSocket server built with Scala and Play Framework.
Scala
29
star
4

deep-learning-with-scala

Repository for the talk 'From Zero To Deep Learning With Scala'
Scala
28
star
5

aws-request-signer

Scala library to sign HTTP requests to AWS services.
Scala
21
star
6

akka-http-websocket-example

Scala
20
star
7

reactive-pipeline-rsocket

Scala
11
star
8

play-scala-akka-example

Scala
9
star
9

codility-scala-lessons

Codility lessons implemented in Scala
Scala
7
star
10

reactive-kraken

Scala / Akka library for the Kraken exchange API.
Scala
7
star
11

cloudmatch

2019 version of my cloudmatch project
Scala
6
star
12

simple-websocket-client

A very simple html / javascript WebSocket client
6
star
13

akka-http-distributed-websockets

Distributed websockets with Akka Http, handled by remote actors.
Scala
6
star
14

The-Things-Network-Android-SDK

Android SDK to listen to information travelling on The Things Network
Java
4
star
15

scala-with-cats-exercises

Exercises in the book "Scala with Cats" - https://www.underscore.io/books/scala-with-cats/
Scala
3
star
16

speakertogether

Scala
2
star
17

Scala-RabbitMQ-Example

Scala client listening to a RabbitMQ queue.
Scala
2
star
18

android-websocket-test

Experiment with websockets on android
Java
2
star
19

cartaccia

A quick actor model example built for a friend (using Akka HTTP)
Scala
2
star
20

stream-thinking-workshop

Examples for a Stream Thinking Workshop with Akka Streams
Scala
1
star
21

scala-akka-streams-meetup

Scala Akka Streams example using meetup.com's streaming API
Scala
1
star
22

AkkaBackoffSupervisorExample

Akka Backoff Supervisor Example
Scala
1
star
23

ticofab

1
star
24

cloudmatch_android_sdk

Embed CloudMatch in your app and enable device-to-device gesture communication.
Java
1
star
25

scala-jobs-processing-approaches

Four different approaches to Scala jobs processing: plain Scala, RxScala, Akka Actors, Akka Streams.
Scala
1
star
26

ActorDemo

Simple app to show the basics of Actor supervision and failure handling in Akka & Scala.
Scala
1
star
27

akka-cluster-router-group-example

Example usage of Akka Cluster with ClusterRouterGroup.
Scala
1
star
28

MaterialNavigationDrawer

Example of putting together a NavigationDrawer following the Material Design guidelines. Using the support library for retrocompatibility.
Java
1
star
29

simple-play-scala-reactjs-refluxjs-server

An example of a server built using Scala, Play, WebJars, ReactJS and RefluxJS.
Scala
1
star