Multi Courier Tracker: Enhanced

The Multi Courier Tracker Android app from Sasyabook – The Lord of the Shipments: One App to Track Them All!
Multi Courier Tracker

FEATURING:

  • Support for no less than one hundred and eleven delivery companies!
  • Complete tracking history with color scheme and tagging for easy identification
  • Smart paste: paste text directly from an SMS or email – even an entire message, or a link – and the tracking number will be searched and pasted
  • Barcode scanning
  • The Magic Star ‘★’ to bring more frequently used couriers to the top of the list
  • Offline saving of track results
  • Sharing & printing of the tracking documents
  • Constantly updated and improved based on user feedback
  • And of course, all from the convenience of your Android device, in the palm of your hand, anytime, anywhere

You really should get it now – if you haven’t already!

Get it on Google Play

Sorting RadioButtons: The Magic Star ‘★’

The Multi Courier Tracker app uses two vertical RadioGroups, with lots of RadioButtons in each, for selecting which courier to track.
Magic Star
Once the number of couriers gradually increased to 50, the question arose how to give an option to bring the more frequently required / used ones to the top.

The simplest solution was to dispense with the RadioButtons and go for a ListView. But there was something nice about the RadioButtons!

How it was done, retaining the RadioButtons:

  1. First, removed all the RadioButtons from the XML layout
  2. Instead, made an array of RadioButtons in code, and also an array of ids, with one integer id for each courier. The names and colors for each courier button was mapped against its id, in two SparseIntArrays.
  3. In the onCreate() Method, looped through the id array to create each RadioButton, and add it to the RB array. Each RadioButton was also mapped to its id, in a global SparseArray.
    int index = 0;
    for (int crid:idarray) {
    RadioButton rbinst = new RadioButton(this);
    //name - Points to a String resource
    int name = nameMap.get(crid);
    int color = colorMaps.get(crid);
    rbinst.setText(name);
    rbinst.setTextColor(color);
    //The Key Step: The id of each RB is set here
    rbinst.setId(crid);
    rbArray[index++]=rbinst;
    //Global SparseArray mapping each RB to an id
    cridMap.put(crid, rbinst);
    }
  4. The RadioButtons are then added one-by-one to the layout in the onStart() method using a loop and a flag variable to put them into one of the two Radiogroups in tandem:
    boolean odd=true;
    for (int id : idarray) {
    (odd ? rgCR1 : rgCR2).addView(cridMap.get(id));
    odd = !odd;
    }
  5. When the user tracks a courier, the counter for that courier is incremented and stored in a SharedPreference integer value, with the key as the courier id + “_COUNT”
    String COUNT_KEY = CRID+"_COUNT";
    int crcount = sharedpref.getInt(COUNT_KEY, 0);
    crcount++;
    sharedpref.edit().putInt(COUNT_KEY,crcount).commit();
  6. Each time the activity starts,   the courier tracking counts are retrieved, again in a loop, and mapped to each courier id in a SparseIntArray. The counts are also separately added to an Array, which is then sorted using Arrays.sort(array). The id against each track count is then retrieved in descending order and stored in another array the sorted id array.
    Here is the full method:
    void sortRbs() {
    SparseIntArray crcounts = new SparseIntArray(idarray.length);
    int[] track_counts = new int[idarray.length];
    int index = 0;
    for (int crid:idarray) {
    int crcount = sharedpref.getInt(crid+"_COUNT", 0);
    counts[index++] = crcount;
    crcounts.put(crid, crcount);
    }
    //The Powerhouse: One-line sorting step
    Arrays.sort(track_counts);
    ArrayList cridtemp = new ArrayList(crids.length);
    for (int crid : idarray) {
    cridtemp.add(crid);
    }
    index = 0;
    //Descending loop
    for (int i=track_counts.length-1;i>-1;i--) {
    int removedindex = 0;
    for (int j=0;j<cridtemp.size(); j++) {
    int crid = cridtemp.get(j);
    if (crcounts.get(crid)==track_counts[i]){
    //sorted_crids is the global array variable that will hold the sorted ids
    sorted_crids[index++]=crid;
    removedindex = j;
    break;
    }}
    cridtemp.remove(removedindex);
    }}
  7. A button which toggles its title between the unicode characters ☆ & ★ was added to the view. When clicked, a boolean sort variable is set/unset. The RadioButtons are removed from the RadioGroups and added back.  Depending on the state of the boolean sort variable, the sorted or unsorted id arrays are used to order the added RadioButtons – and thereby achieving the desired result.

 

Get it on Google Play

Updates for iOS 8

The next update of Train Alarm for iOS comes with new features for iOS 8: A Today View Widget that shows up-to-date distance to latest alarm station, and ‘Show in Map’ action for alarm notifications.

Train AlarmWith iOS 8 round the corner, and Apple gently nudging to update  apps with shiny new versions in time for the big release on 17th, the past week has been busy, and the rewards, well, shall soon be ‘available on the App Store’.Download on the App Store

Managing  the different screen sizes with  larger iPhones turned out to be quite easy,  the only thing extra that was really required was a new 3x res app icon for the high pixel density of the 6 Plus screen. A few other issues regarding access to system services like notifications, location services and background tasks were sorted out.

The interesting part was trying to implement some of the new features in the latest iOS. As mentioned in the last WWDC, iOS 8 is a big release for developers and opens up a lot of the system to developers.

  1. Notification actions – which are small optional buttons that can be added to notifications to provide faster and meaningful interaction with the information. This was relevant for the Train Alarm app, so that a new option has been added, “View in Map” for the alarm notifications.
  2. Widgets – yes, iOS finally has widgets, but they are implemented in a unique way that is both unobtrusive yet seems quite powerful. They live in the “Today” view. This also was relevant for Train Alarm, to have a widget that would update the location to the latest alarm station, this has also been added in the update.

So look out for these exiting new features in the next release!

ITS for Android: QuickMarks

Indian Train Status v5.71 for Android has a new feature, QuickMarks – for quick, one-click access to any one of:

  • Live status of a train, at station
  • Live status of trains running from one station to another
  • List of trains between two stations.

Here is a short video explaining what this feature is all about:

Get it on Google Play

Enhanced Widgets in ITS 5.62 for Android

itsncr ITS 5.62 for Android supports a new set of enhanced widgets for quick, one-click access to the live status of a train at a particular station & trains running from one station to another.

These widgets are based on a suggestion by Mr Ravish Koushlesh.

ITS for Android Crosses 1 Million Downloads

IIndian Train Statusndian Train Status for Android has today crossed 1 million downloads.  So thanks everybody – thanks a million – not only for downloading, but also for sticking with the app as it evolved over time, going through several difficult periods of adaptation to the changing national train enquiry portal and, especially, for giving your valuable feedback and suggestions, many of which are now integral parts of the app, making it what it is today.

Use Hangouts+SMS

HPSIt has been a while since SMS was enabled in the Hangouts app for Android.  In some devices like the Nexus 5, it now is the only SMS app that comes installed.  However, this remarkably versatile combination seems to be rather underused, with many users disabling the feature after seeing annoying double notifications, going back to the “Stock” messaging app.

In fact, they would be missing out on a lot of messaging power:

  1. Hangouts automatically detects which contacts are online and automagically switches to Chat from SMS and vice versa = potential savings on your SMS bills.
  2. You can log in to an multiple devices with the same Google ID – and your Hangout chats will be replicated across all of them, including Android, iPhone and even iPad.  This is something very few messenger apps provide (Whatsapp and WeChat – I’m looking at you!) , and is super convenient, especially since:
  3. A Hangouts desktop app is also available, with the Google Chrome browser

Consider this:

You start a chat on mobile and suppose you need to send a photo which is currently on your PC. You can just open chrome -> hangouts, and send it to the same chat thread, which will be instantaneously synced with the desktop app, and then come back to mobile to continue the rest of the chat!

And you can do this with any combination of devices, to which you have logged in with your Google ID.

But to achieve all this chat mojo, there are a couple of additional steps you need to do, in addition to enabling SMS in Hangouts:

  1. Disable the notifications in any previously installed SMS app. The option should be available in its settings menu.  This will prevent double notifications.
  2. Open the Google+ app in your Android device at least once, and allow when it asks permission to sync contacts to your device. Hangouts works with Google+, and once sync is enabled, it will get automatically updated with contact details from your Google+ account, which is perfect.

In addition,

  • To continue chats on desktop, open the Chrome web browser and install Hangouts from the Chrome web store.

Indian Train Alarm for iPhone & iPad

Indian Train AlarmLocation based alarms for Indian Train Stations – now available for iPhone & iPad!

Download on the App Store

Just like the Android & WP8 versions, this app comes with a list of Indian Railway Stations, with their locations, to set the alarms. Over 2500 stations are currently listed, more stations are being continuously added, and you can also add stations on your own after downloading the app!

Be informed when your train is about to reach a station, using the location services on your iPhone or iPad! No internet connection is required for the alarms to work.

The alarms may be set with a triggering radius of 10km or 25km, and will be triggered within an error margin of 1/2 – 2km depending on the accuracy of the location fix.

The app uses low battery consuming location detection provided by the latest iOS core location technologies.

Download on the App Store