Monday, June 27, 2016

Trainsity Kuala Lumpur Windows Phone app

Carry these high resolution vector maps of Kuala Lumpur's LRT, KTM, and other train lines in your Windows Mobile handset and find your way around Kuala Lumpur. The maps are small in file size and can be accessed offline without a data connection. The following lines are available:

  • Monorail
  • Ampang Line
  • Sri Petaling Line
  • Kelana Jaya Line
  • KTM Lines
  • KLIA Lines


Users can click the train station labels to open the external Bing Maps app where they can use all the functions of the external app to visualize the surrounding area including querying for directions. This app has its own directions function for finding the best path from one train station to another.

On a Windows Mobile handset,  the app will display tiles of train lines, which when tapped will open up a detail view of the metro transit map, as shown below.
Tapping the station labels will bring up an option menu where users can choose to display the station location in Bing Maps.

If you want to find how long it takes to travel from one station to another, and the best route to take, simply swipe to the Route page. Then type in the From station and To station. As you enter the values, a drop down list will appear and a station can be selected from the list.
Finally tap the Execute icon. 
Tapping the more details link will display the recommended route to take.
Click the badge below to download from the Windows Store.
Get it from Microsoft

Monday, June 20, 2016

Trainsity Hong Kong Windows Phone App

Find your way around Hong Kong city's subway using the high resolution vector maps of the train network. The following metro rail lines are available: East Rail, Kwun Tong, Tsuen Wan, Island, Tung Chung, Airport Express, Tseung Kwan O, West Rail, Ma On Shan, and Disneyland Resort lines.

The maps have small file size footprints but with many levels of zoom and can work offline without connecting to the Internet. Users can click the train station box labels to open Bing Maps, where they can use all the functions of the external app to visualise the surrounding area and/or perform routing for directions.

There is also an offline function to calculate the best way to travel from a station to another station with a direction breakdown and timings (which may vary from the actual travelling time).

On a Windows Mobile 8+ handset, the app will display tiles of train lines, which when tapped will open up a detail view of the metro transit map, as shown below.
 
Tapping the station labels will bring up an option menu where users can choose to display the station location in Bing Maps.


If you want to find out how long it takes to travel from one station to another, and the best route to take, simply swipe to the Route page. Then type in the From station and To station. As you enter the values, a drop down list will appear and a station can be selected from the list. Finally, tap the Execute icon.

Tapping the more details link will display the recommended route to take.

Click the button below to download the app from the Windows Store.
Get it from Microsoft

Monday, June 13, 2016

Use PDAL to merge multiple LiDAR las files

I found a useful tool, something that works along the lines of GDAL for vector data, but for point cloud data; it's the Point Data Abstraction Library (PDAL).  PDAL can be downloaded from http://www.pdal.io/. It has some useful commands, like merging LiDAR las files, which I tried to use, as an alternative to other tools like Lastools.

Using PDAL to merge a few las files is straightforward, as illustrated below. If there are hundreds of las files to zip, then another tool might be more suitable.


To use PDAL to merge las files, just type in the following command at the Command prompt.
C:> pdal merge --verbose=5 part_1.las part_2.las part_3.las output.las


Note I: all the input las files will be merged into the last file name in the command.
Note II: the --verbose option tells the command the amount of processing messages to display. 0 for none. 
The resultant merge file is shown below.

Monday, June 6, 2016

Trainsity Bangkok Windows Phone app

Use this Windows Mobile 8+ app to find your way around the city of Bangkok, Thailand using the high resolution vector maps of the Bangkok Sky Train (BTS), Metro (MRT) and the Airport Rail Link train network.
The maps are small in file size and sharp without pixelation, and can work offline without a connection to the Internet. Users can click the train station labels to open Bing Maps, where they can use all the functions of the app to visualise the surrounding area and/or perform routing for directions.
There is also an offline function to calculate the best way to travel from a station to another station with a direction breakdown and estimated timings (which may vary from the actual travelling time).

The following screenshots show how the app looks like on a Windows Mobile 8+ handset.

When a tile is tapped, a detail map view of the selected line will appear, as shown.

Tapping a labeled box on the map will display the train station on the external Maps application.


If you want to find out how long it takes to travel from one station to another station, and the best route to take, simply swipe to the Route page. Then type in the From station and To station. As you enter the values, a drop down list will appear and a station can be selected from the list. Finally, tap the Execute icon.

Tapping the more details link will display the recommended route to take.

Click the button below to download the app from the Windows Store.
Get it from Microsoft

Monday, May 30, 2016

Using Android XML layout tabs without ViewPager and Fragments

In Android, the TabLayout widget is typically used together with a ViewPager and fragments; when a user touch a tab, a fragment associated with the tab is displayed in the activity. But sometimes, I do not want or need fragments for each tab; I just want to execute some code. This post illustrates an example of using the TabLayout without a ViewPager and Fragments and setting a tab selected listener to the TabLayout.



First, create an XML layout and add in the TabLayout code. Add in the TabItem widgets underneath the parent TabLayout node. You can simple use text or icons (in this example) for the TabItem labels.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.skyglob.insight.view.MainActivity">

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:popupTheme="@style/AppTheme.PopupOverlay" />

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabGravity="fill"
                app:tabMode="fixed">

                <android.support.design.widget.TabItem
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:icon="@drawable/ic_action_call" />

                <android.support.design.widget.TabItem
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:icon="@drawable/ic_action_checkin" />

                <android.support.design.widget.TabItem
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:icon="@drawable/ic_action_contacts" />

                <android.support.design.widget.TabItem
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:icon="@drawable/ic_action_schedule" />

                <android.support.design.widget.TabItem
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:icon="@drawable/ic_action_logout" />

            </android.support.design.widget.TabLayout>

        </android.support.design.widget.AppBarLayout>

        <include layout="@layout/content_main" />

    </android.support.design.widget.CoordinatorLayout>

</LinearLayout>

In the activity Java code, add in the tab selected listener. The following is an example showing how to assign a tab selected listener to the TabLayout widget.


private void setupTabLayout() {
    TabLayout mTabLayout = (TabLayout) findViewById(R.id.tabs);
    mTabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
        @Override
        public void onTabSelected(TabLayout.Tab tab) {
            onTabTapped(tab.getPosition());
        }
        @Override
        public void onTabUnselected(TabLayout.Tab tab) {

        }
        @Override
        public void onTabReselected(TabLayout.Tab tab) {
            onTabTapped(tab.getPosition());
        }
    });
}

private void onTabTapped(int position) {
    switch (position) {
        case 0:
            // Do something when first tab is tapped here
            break;
        default:
            Toast.makeText(this, "Tapped " + position, Toast.LENGTH_SHORT);
    }
}

Monday, May 23, 2016

Android App for monitoring Washington, DC crime incidents and 311 service requests

This is an Android app for monitoring Washington DC's 311 service request calls and crime incidents. The incidents can be viewed as a text list or as icons or heatmap on a map. Details about the calls can be viewed by tapping an item on the list or on a marker on the map display. A function is available to easily filter away unwanted incidents from the list or map by a text search. The app allows the user to send the incident location to the external Google Maps and/or Street View for better visualization of the incident environment.

Upon launching the app, the list of incidents can be downloaded and displayed with categorized icons, as shown below.

To view all the incidents on a map, simply select the Map option item in the Toolbar menu. Tapping any icon will pop up a snippet of information about the incident. Tapping the snippet will display the incident details.

Long pressing any list item or tapping the arrow icon will pop up a menu, as shown below, where the selected incident can be shared, located on a map, or sent to the Google Maps or Street View apps.

Users can visualise the incidents as a heat map instead of as marker icons. This can be done by choosing toggling the Heat map menu option on in the Tool bar menu, as shown below. To display as marker icons again, just toggle off the Heat map option.

On a table, the app will display a two pane layout - a list on the left and a map view on the right, as shown below.

As on a handset, the incidents can be displayed as marker icons or as a heat map.



Click the badge below to download the app from the Google Play Store.
Get it on Google Play

Monday, May 16, 2016

ProGuard exceptions for Retrofit in an Android project

If you are enabling ProGuard to minify an Android APK, then it will be necessary to tell ProGuard to leave the Retrofit and related JSON data classes as they are. Otherwise, you will get class not found errors when running the Android app.

In Android Studio, to add the exceptions to ProGuard, open up the file proguard-rules.pro in the editor. Add in the following lines.


# for Retrofit
-keepattributes Signature
-keepattributes Exceptions

-keep class com.squareup.** { *; }
-keep interface com.squareup.** { *; }
-keep interface retrofit.** { *;}
-keep class retrofit.** { *; }

-keepclasseswithmembers class * {
    @retrofit.http.* <methods>;
}

-dontwarn com.squareup.okhttp.**
-dontwarn rx.**
-dontwarn retrofit.**

# add your JSON classes here
-keep class com.dom.mypackage.myclass.** { *; }
Note: for the last line above, replace it with the path to your classes that correspond to the JSON classes you are using in Retrofit.
Related Posts with Thumbnails