paoservis / osmtracker-android

Automatically exported from code.google.com/p/osmtracker-android
GNU General Public License v3.0
0 stars 0 forks source link

Custom Layouts not possible if no SD-Card used! #123

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi everybody,

I'm using an Archos-5 to run osmtracker and have been very happy with the 
program so far. :)
Now I tried to create my own custom layout as described in the wiki page.
But my layout is not shown in the prefs page.

Is it possible that it's not working because I'm *not* using an SD-Card?
I'm using /osmtracker as my storage dir... and therein I created the "layouts" 
directory and copied the sample.xml from the wiki into it... but no luck. :-(

Any ideas?

Thanks
Roman

Original issue reported on code.google.com by rom...@trash.net on 23 Apr 2011 at 7:48

GoogleCodeExporter commented 9 years ago
From the code, it appears that the external storage device is required . It 
takes the external storage location from the android environment (say, 
'/sdcard') and appends the storage directory ('/osmtracker') and then appends a 
slash and 'layouts' to that. This results in a location of 
'/sdcard/osmtracker/layouts'. The android environment on the Archos-5 may 
deliver a different external location than other devices so the full path 
required may be different. Unfortunately, I don't have access to a copy of that 
device to investigate directly

The information above is not much help to you directly, but the GPX export 
functionality uses the same mechanism and if you can successfully export GPX 
files using the export functionality in OSM tracker then the missing SD card is 
unlikely to be the problem. On OSMTracker 0.5.3, you can export a track as a 
.gpx file by long pressing on any track in the track list and selecting 'Export 
as GPX' from the menu. 

If that works and you can find the exported gpx file on your system then I'd 
say that the problem is not due to the lack of an SD card. Let us know if gpx 
export is successful and if not, we'll see if there are other ways to identify 
the cause.

- Paul

Original comment by oshea.p...@gmail.com on 23 Apr 2011 at 5:48

GoogleCodeExporter commented 9 years ago
Hi Paul,

I also took a quick look in the source (but Java is really not my 
bread-and-butter-language) and that's where my suspicion came from...

However, exporting a track to GPX *works*. The directory is properly created 
inside /osmtracker, exactly where my "layourts" directory is... :-\

I would debug the problem... if I knew how... :-(

Regards
Roman

Original comment by rom...@trash.net on 24 Apr 2011 at 7:02

GoogleCodeExporter commented 9 years ago
I was thinking about adding a "debug" screen somewhere in the app (from the 
About screen ?) where we could show different values including what path 
Android is returning for the "external storage", etc.

That could help to diagnose device-specific issues

Original comment by nicolas@guillaumin.me on 21 Jun 2011 at 12:49

GoogleCodeExporter commented 9 years ago
I just make a quick implementation of that but I'm unable to commit again (502 
Bad Gateway). It seems that Google Code maintenance is completely in sync with 
my timezone :) Will commit it as soon as possible.

Original comment by nicolas@guillaumin.me on 21 Jun 2011 at 1:16

GoogleCodeExporter commented 9 years ago
Yes, a debug-screen would certainly help. :)
Sometimes I wish, I could program these things myself... 

-Roman

Original comment by rom...@trash.net on 21 Jun 2011 at 4:09

GoogleCodeExporter commented 9 years ago
I just released a new version with a 'debug' button in the about screen, maybe 
it'll help however I can't understand why that's not working if you're able to 
export tracks since it uses the same code as Paul said.

Did you double-check the name of the folder and your layout file ? ;)

Original comment by nicolas@guillaumin.me on 25 Jun 2011 at 3:15

GoogleCodeExporter commented 9 years ago
Installed it and the debug-info sais:

---------------
Environment.getExternalStorageDirectory: '/storage'
Environment.getExternalStorageState: 'mounted'
Can write to external storage: true
---------------

As you can see on the screenshot, I even tried to put a copy of the "layouts" 
directory in an new folder on root-level "storage"... but the result is still 
the same. :(

Maybe you could add a test-function to the debug screen that tries to load the 
custom layout and displays some more info if it can't?

Thx for you help!
Roman

Original comment by rom...@trash.net on 26 Jun 2011 at 10:13

Attachments:

GoogleCodeExporter commented 9 years ago
I guess "storage" is the root of your storage folder, in where all the other 
files are created (MapDroyd, Music, osmtracker, etc.), so everything looks fine.

Another thing maybe: I see a "lost+found" folder, so I suspect this filesystem 
is formatted in ext2/3/4 (Linux filesystem) ? In that case that could come from 
a permission issue, because each Android app can only read and write its own 
files.

Can you check to which/user group belongs the osmtracker generated files (Say a 
GPX track for example), and either:
- Try to grant permission to read to everyone on your layout files (chmod a+r 
sample.xml if you're using Linux, which I assume you are since your file tree 
looks a lot like KDE 4 :) )
- Change the owner of your layout files to match the osmtracker user (chown 
<user>:<group> sample.xml)

Let me know how it goes.

Original comment by nicolas@guillaumin.me on 26 Jun 2011 at 11:50

GoogleCodeExporter commented 9 years ago
Permissions are 777 on all files and directories inside /osmtracker ...
Would the program display a message if - say- the format of sample.xml was 
wrong or if it coulnd't be read/parsed?

-Roman

Original comment by rom...@trash.net on 26 Jun 2011 at 1:13

GoogleCodeExporter commented 9 years ago
The file is not parsed to populate the menu entries, it parsed only once you 
selected it and try to create a new track.

AFAIK the menu entry is populated only by listing the files in 
<osmtracker_dir>/layouts/*.xml ...

Original comment by nicolas@guillaumin.me on 26 Jun 2011 at 1:27

GoogleCodeExporter commented 9 years ago
Another thing: Is your storage dir (in the preferences) '/osmtracker' starting 
with a slash, or 'osmtracker' without a slash ?

Original comment by nicolas@guillaumin.me on 26 Jun 2011 at 1:30

GoogleCodeExporter commented 9 years ago
Hmm.. but I cannot select it.. there is no selection shown. :(
When I start OSMTRACKER (even after reboot!), no selection.. maybe the problem 
is earlier in the code?

And I tried both "/osmtracker" and "osmtracker" for storage dir: no difference.

-Roman

Original comment by rom...@trash.net on 26 Jun 2011 at 1:41

GoogleCodeExporter commented 9 years ago
I may have a clue, see r326 : There is a possible issue the way the path to 
customs layout is built as we use getPath() on the file, instead of using the 
File object itself or getAbsolutePath().

If you're happy with that I can send you a test version by email with that fix, 
however it'll be an 'unsigned' package so you'll have to enable unsigned apps 
on your device.
I'm keen on testing that on your device before going through the hassle of a 
release ;)

If you're suspicious, which I can understand, could you try to build it 
yourself ? It's quite easy even if you don't know Java, assuming you're ok to 
install the Android SDK and some Java tools. Again I can help by email.

Original comment by nicolas@guillaumin.me on 26 Jun 2011 at 1:49

GoogleCodeExporter commented 9 years ago
Does "enable unsigned apps" mean that I have to root the device?
If yes, then I would rather not do that...
If no, then I don't have a problem with it. :)

-Roman

Original comment by rom...@trash.net on 27 Jun 2011 at 6:11

GoogleCodeExporter commented 9 years ago
No, it only requires you to unable "Unkown sources" under the Application 
settings.

I'll send you the version by email, thanks.

Original comment by nicolas@guillaumin.me on 27 Jun 2011 at 6:23

GoogleCodeExporter commented 9 years ago
I don't have such an option anywhere in the settings... :(
Maybe Android 1.6 didn't have it yet? Or Archos removed it... <sigh>

Sorry, can't run it. :(

Original comment by rom...@trash.net on 27 Jun 2011 at 6:39

GoogleCodeExporter commented 9 years ago
I had 1.6 before upgrading to Cyanogen and was able to run non-Market apps, 
however I can't remember which settings I change. :( Could you try to run it 
anwyay, I think I recall Android tells you which settings you have to change to 
have it running...

Original comment by nicolas@guillaumin.me on 27 Jun 2011 at 10:59

GoogleCodeExporter commented 9 years ago
It only gives a Message "OSMTracker for Android" could not be installed on this 
device. And a stupid OK-Button. Nothing more. :(

Original comment by rom...@trash.net on 29 Jun 2011 at 6:33

GoogleCodeExporter commented 9 years ago
Ah well... I guess we'll have to wait for the next release to check if it 
worked ! Thanks for you efforts !

Original comment by nicolas@guillaumin.me on 29 Jun 2011 at 11:31

GoogleCodeExporter commented 9 years ago
Just for your information: I bought a SD card, instered it, copied the 
"osmtracker" directory as it was on the internal memory onto the SD card... and 
voila, the custom layout works. :)

So it's definitely the path-issue you mentioned above.

-Roman

Original comment by rom...@trash.net on 17 Jul 2011 at 7:08