Comments (7)
from gpslogger.
v127 is on F-Droid and the Releases section.
from gpslogger.
Yanno... I actually used to have that path to the file as a link. And I removed it one day... I can't remember exactly why, it was causing crashes on some devices? I'm going to have to dig that out and find out what was wrong, but bringing it back ought to be simple I hope, and I'll see if I can wrap its code in some try catch (and why didn't I do that in the first place!!)
from gpslogger.
I can only speculate that most file browsers can't open Android/data paths in modern Android and you maybe had used file:/// or other slash delimited intent structure which would only invoke different non-aosp file managers. The intent I provided above should open the Android/data path in the AOSP Files app which can open those paths.
from gpslogger.
That's exactly it, I found what I used and it matched what you said:
final Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.parse("file://" + pathToLinkTo), "resource/folder");
intent.setAction(Intent.ACTION_VIEW);
OK nice. I'll try the new way when I can find a little time, I'm a bit slow.
from gpslogger.
This is as far as I got today, not much success but not sure what I'm missing.
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Uri folderUri = DocumentsContract.buildDocumentUriUsingTree(
Uri.parse("content://com.android.externalstorage.documents/tree/primary"),
DocumentsContract.getTreeDocumentId(Uri.fromFile(file)));
Intent intent = new Intent(Intent.ACTION_VIEW);
//intent.setDataAndType(folderUri, "resource/folder");
intent.setDataAndType(folderUri, "vnd.android.document/directory");
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, folderUri);
startActivity(intent);
}
Which results in
java.lang.IllegalArgumentException: Invalid URI: file:///storage/emulated/0/Android/data/com.mendhak.gpslogger/files
at android.provider.DocumentsContract.getTreeDocumentId(DocumentsContract.java:1289)
at com.mendhak.gpslogger.ui.fragments.display.GpsSimpleViewFragment$2.onClick(GpsSimpleViewFragment.java:210)
...
from gpslogger.
Some progress at last. The big problem is that the DocumentsUI app only accepts content:// URIs as you know, but building those URIs is very difficult. I found many unreliable examples that were sort of hacking the URI together but I did manage to figure out a way that uses the framework methods and shouldn't necessarily break that easily.
Of course there's a catch. Although the DocumentsContract.buildDocumentUri
exists, figuring out the initial part path makes use of StorageVolume.getDirectory, which is Android API level 30, which is Android R.
from gpslogger.
Related Issues (20)
- [Feature request] Several intervalls for different logging types simultaneously HOT 1
- The final ZIP files contain incomplete tracks HOT 5
- [Feature request] Automatic cleaning of CSV files. 'Allow auto sending' option HOT 8
- Write the GPX File to a New Folder each Month HOT 9
- Intents - not working for Automagic HOT 11
- Problem with Ascent/Descent HOT 2
- Custom URL - Parameter %SPD sends a wrong knot speed value HOT 3
- Custom URL: Why is the HTTP Body empty? HOT 4
- I adjust interval 1 second ,why it does not work HOT 1
- Custom URL: How to identify a specific phone by parameters HOT 1
- Switch to OAuth 2 for OpenStreetMap provider HOT 2
- last message on "STOP LOGGING" HOT 1
- STOP logging via intent hyperlink HOT 3
- Developers? HOT 1
- Dynamic Parameters in File Names No Longer Work HOT 3
- Option for accelerometer detection is gone? HOT 1
- [Feature Request] Scheduler - auto start/stop recording
- [Feature Request] - Movement detection HOT 3
- GPSLogger does not start on old android phone (android version 5.1.1)
- App doesn't respect statusbar / camera cut out space HOT 2
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 gpslogger.