December 21, 2017

Maintaining my Topo map viewing application for the Android

I wrote this thing back in 2013 and use it all the time, both on my Android tablet and phone. An issue that comes up continually is that Android seems to have no standard naming convention for the external card slot that holds the maps. My friend Mark has recently upgraded his phone to a Samsung S5, running Android 6.0.1 (aka "marshmallow") and it no longer can find the maps. Some grubbing around with ES File Explorer seems to indicate that the external directory is the following. Note the curious capitalization of the "topo" directory. I may have to check for that also (but I never had to before).
/storage/0000-0000/Topo
Previously (on the Samsung S4, running Android 5.0.1 aka "Lollipop") it had been:
/storage/extSdCard/topo

New strategy

I have a method "find_maps" that simply rattles through a list of names that I have encountered thus far for the SD card slot. What I am now thinking of doing is to start at /storage and write code that loops through all subdirectories under this, looking for my maps. There may be other issues too, such as the permission to access external storage that is mentioned in the stackoverflow posting.

Android development things I forgot

I still have the android development tools on my machine and typing "adt" starts them up, so that is easy. I am sort of amazed given that I installed all of these at least 4 years ago. I should probably update ADT, but for now I am leaving well enough alone.

Exporting the application

This is pretty simple. Use File -- Export and follow the dialogs. I have an android keystore on /u1/tom/androidkeystore and ADT knows how to find it. I also have it backed up on my special password dongle. It uses a well known password. It asks for the path to save the thing, which is /u1/tom/atopo_new.apk at the present time.

USB debugging and developer options

This is unpredictable and intermittent, and I do not yet understand how to do anything other than thrash around until things start to work. What seems to be part of the trouble is that my LG tablet will not retain certain settings.

Along with that, when I plug my device in, there is about a 20 second delay before the ADT can detect it. This is absurd, but patience is the cure. Java sucks and is miserably slow.

Under Developer options, I need to click on "Stay awake" as well as "USB debugging". Oddly enough, the USB debugging greys itself out as soon as I select it.

I plug my LG tablet in via a USB cable and hit the green arrow "run" button in ADT. It shows my tablet as offline. I hit the arrow again and watch the tablet screen. A popup appears asking me if I want to enable USB debugging. I say yes and continue. Now it warns me it needs to uninstall the application. I tell it "yes" to go ahead, and it loads and runs my latest build. This was actually pretty easy. Source files and Git

On my machine, my files are at:

/u1/tom/Android/atopo/src/com/trebisky/atopo/
I have this under git, but at the following level:
/u1/tom/Android/atopo
My git repo has fallen behind, so I do an add and a commit This adds the new file:
src/com/trebisky/atopo/Settings.java
However the push fails. Apparently the repo was a local thing at /u1/Repo/atopo.git. This no longer exists. Typing "git remote -v" shows:
origin	cholla.mmto.org:/u1/Repo/atopo.git (fetch)
origin	cholla.mmto.org:/u1/Repo/atopo.git (push)
I add this project via the NEW button on Github, then do the following:
git help remote
git remote remove origin
git remote -v
git remote add origin [email protected]:trebisky/atopo.git
git push -u origin master
This seems to do the trick.
Feedback? Questions? Drop me a line!h

Atopo / [email protected]