Giter Club home page Giter Club logo

Comments (9)

X-Ryl669 avatar X-Ryl669 commented on September 25, 2024

Please make sure your file ends with .txt extension if it's a iGO format (the error you've written happens if the file does not have the right extension).

If this still does not work, please send me the file so I can debug it.

from bwarearea.

aleprovencio avatar aleprovencio commented on September 25, 2024

Thanks for the reply and yes, it does have the .txt extension. It is actually a file exported from maparadar.
maparadar2.txt

from bwarearea.

X-Ryl669 avatar X-Ryl669 commented on September 25, 2024

Strange... The code is doing this:

// Try to figure out if it's txt or gpx.
                // Since Android is not able to figure out a GPX is a text/xml, we need some way to solve this out.
                String[] segments = data.getData().getLastPathSegment().split("\\.");
                String ext = "";
                if (segments.length > 1) ext = segments[1];
                if (ext.equalsIgnoreCase("gpx"))
                {
                     [...]
                } else if (ext.equalsIgnoreCase("txt"))
                {
                    // Likely txt
                     [...]
                } else
                {
                    Toast.makeText(this, "Only iGO .txt and GPX format are supported", Toast.LENGTH_LONG).show();
                }

Do you have more than one extension (like a.b.txt) ?

from bwarearea.

aleprovencio avatar aleprovencio commented on September 25, 2024

Alright, I could make it work my renaming maparadar2.txt to speedcam.txt and moving the file to a more obvious folder (i.e. Downloads), so either of this is what it takes :)

Thank you

from bwarearea.

X-Ryl669 avatar X-Ryl669 commented on September 25, 2024

I'm just curious about what was the original complete path to the file, so I can understand and fix the code ?

from bwarearea.

aleprovencio avatar aleprovencio commented on September 25, 2024

Sure, lives on Android/media/com.nextcloud.client/nextcloud/aleprovencio/Documents/speedcam.txt

Thanks again for you help

from bwarearea.

X-Ryl669 avatar X-Ryl669 commented on September 25, 2024

This is the working path. Do you have the failing path ?

from bwarearea.

aleprovencio avatar aleprovencio commented on September 25, 2024

No this was actually the failing path, it worked under Downloads/speedcam.txt.

By the time I get home I'll try to investigate this myself with further tests so maybe I can help you somehow.

from bwarearea.

aleprovencio avatar aleprovencio commented on September 25, 2024

OK I confirm it's not a filename problem and indeed a path issue. Maybe when your app receives the nextcloud path, it is as an URI format like content://com.android.externalstorage.documents/document/primary%3AAndroid%2Fmedia%2Fcom.nextcloud.client...%2Fspeedcam.txt. Hope by checking this output you can figure it out.

from bwarearea.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.