Comments (9)
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.
Thanks for the reply and yes, it does have the .txt
extension. It is actually a file exported from maparadar.
maparadar2.txt
from bwarearea.
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.
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.
I'm just curious about what was the original complete path to the file, so I can understand and fix the code ?
from bwarearea.
Sure, lives on Android/media/com.nextcloud.client/nextcloud/aleprovencio/Documents/speedcam.txt
Thanks again for you help
from bwarearea.
This is the working path. Do you have the failing path ?
from bwarearea.
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.
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)
- Sound alert HOT 3
- app crashes on starting the service HOT 10
- Just use OsmAnd HOT 2
- Crash when starting service HOT 3
- request function HOT 7
- add csv import format HOT 4
- Csv file example HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bwarearea.