Tuesday, April 22, 2014

A Trusted QSL library for Java

As long time blog readers are no doubt familiar, I do quite a bit of tinkering with Android. Ham Finder is written in Android. I have wanted for some time to have a way of uploading QSLs to Logbook of the World from Ham Finder, mostly because it makes mobile logging for LOTW go from extremely difficult to a snap.

For your information, here's what I've had to do to make this work in the past:

1. Divide up my QSOs by location where they were made.
2. Sign each of these with a custom created Station identification with Trusted QSL.
3. Upload each of them.

This was a royal pain, and I want to make all of this seamless, using Ham Finder. I think I've almost got all of the pieces figured out, and so here I present them:

  1. The key piece to make this all work is a java library that runs Trusted QSL. I'm making this open sources, the code I have so far is available at GitHub.
  2. Right now Ham Finder doesn't provide ITU zones, nor CQ Zones. I'm working on adding those features. It will be most difficult for those countries (Outside of the US) which have multiple CQ/ITU zones, but I'll get something to work most of the time for now.
  3. Upload them to LOTW as needed, including corrections. This should be easy enough to manage, as all of the contacts are stored in a database already. It just involves making sure they are only sent once.
Trusted QSL is an open source bit of software written in C++. I wanted a natively coded bit of software, for a number of reasons, mostly because it's easier to maintain. I don't care about a lot of the functionality provided by Trusted QSL either, I just want to sign and upload them.

Through reading documentation, reverse engineering the TQ8 files, and even emailing the Trusted Qsl staff, I've learned a number of things. First of all, TQ8 files are GZipped files of the Global Amateur Interchange (GAbbI) file format. The latest specifications on LOTW can be found at Rick Murphy's website. In fact, there are a few key differences from the web site specification and what is actually used. The key differences are as follows:

  1. All of the data for signing is upper case.
  2. The order of fields for the signed data is: CA_PROVINCE, CQZ, GRIDSQUARE, IOTA, ITUZ, US_COUNTY, US_STATE, BAND, BAND_RX, CALL, FREQ, FREQ_RX, MODE, PROP_MODE, QSO_DATE, QSO_TIME, SAT_NAME. Note that station comes first, then QSO data. 
  3. There are several undocumented fields, including CA_PROVINCE, US_STATE, SIGNDATA, and SIGN_LOTW_V1.0. SIGNDATA is the data signed for the LOTW signature, SIGN_LOTW_V1.0 is the LOTW signature itself. CA__PROVINCE and US_STATE are the Canadian Province and US state.
  4. SIGN_LOTW_V1.0 has a :6 after the number of digits. I can't actually figure out what this means...
  5. The max space per row is actually 64, not 72 as specified.
  6. The character count includes line breaks, and if there is any line breaks, it also counts the last line break. For a single line, it doesn't count the final line break.
  7. The signature format is SHA1withRSA.
As of right now, I have the library published, have had Logbook of the World accept it, and am working on integrating the library into Ham Finder. Hopefully it will work great!

Sunday, March 2, 2014

How to Manage with no Power.

Does your family have a plan in case of a power outage? Power outages can be cause by a variety of things, including storms, mistakes, and even birds. They can last for minutes, or even days. Does your family know what to do if the power goes out? Here's a few questions to consider.

1. Do you have a plan for cooking food? A propane grill, nice for summer grilling, can be used to cook a variety of foods. If you don't believe me, ask the scouts! Make sure you can cook in a way that doesn't require electricity. Even better if it is portable.
2. Do you have a way to stay warm without electricity? A few extra blankets are great. Many homes in our area have gas fireplaces which can be used without electricity in our homes.
3. Do you have water? For those of you on city water, you should be a be to use city water. If you have a well, you might need a different solution.
4. Do you have adequate lighting? Make sure you have flashlights and spare batteries. Check this periodically.

Test out you plan periodically. Pick an evening, and test out your plan, see if it works. Make sure everyone knows what to do in the event of a power outage.

Saturday, February 22, 2014

Version 1.6 of Ham Finder

It's been a while since I've done an update on Ham Finder here, let me give you some basic. First of all, the app is doing great, thanks to all of you who have already downloaded it! There have been over 1000 downloads, which makes this competing for my most popular app of all time, and already I can tell you there's more actual users of Ham Finder than any other app I've developed. You guys rock!

Some features that have been released, in versions 1.3 to 1.5, include some call sign help, frequency monitoring, improved logbook, tablet versions, and in general I'm working towards ADIF exporting.

Version 1.6 will include the following:

1. Users can now specify their location, useful for those devices without a GPS.
2. Working on putting things on the map to indicate where you have been.
3. Improvements in how frequency is managed.

The next big version, I am excited to announce, will contain ADIF support! I should be able to export the log to ADIF format, and I'll work on other fun stuff as well!

Bottom line, the app's coming great, and I owe it all to my awesome audience! Thanks, and keep letting me know what you want!

Friday, February 21, 2014

The 10 Commandments of Android Development

In developing Android, I've found a bunch of common mistakes that people often make. I've made more than one of these myself. While I can, and probably will talk about how to avoid each of these at some point in time, I wanted to at least point out some of the common pitfalls that people often encounter when beginning Android development.

 

 The 10 Commandments of Android Development

 

1. Thou Shalt Have no other SDK Version Targeted, except for the latest released!

2. Thou Shalt Not make unto thee any Network Connection on the Main Thread!

3. Thou Shalt Not make unto thee any Toast without .show()ing it to the world!

4. Thou Thou shalt remember thy variables, to recycle them. Neither thy Bitmaps, nor thy TypedArrays, nor thy Parcels, nor even a reference to thy MotionEvents outside of thine functions shall escape without being .recycle()d!

5. Thou Shalt never create an anonymous inner OnSharedPreferenceChangeListener class, so that thy OnSharedPreferenceChangeListener's days may be long, and not be Garbage Collected. 

6. Thou Shalt Not have any local variables inside a onDraw statement!

7. Thou shalt Not programmatically define a View, but instead shall define it via XML code!

8. Thou Shalt Not ignore the convertView of an ArrayAdapter, but shall always use it to reduce thy memory footprint!

9. Thou Shalt not forget to add <use-preferences> when thou addest new features requiring new permissions.

10. Thou Shalt Not use absolute positions, nor use Scaled Pixels incorrectly, but rather use Density Independent Pixels for thy Views, and Scaled Pixels for thy fonts!.