Thursday, 29 January 2015

Introduction to AppsTransport

I have been making apps for transportation since mid 2010. It seems there are huge growth. Every  month, I see new ideas in transport app. Most of the creative apps sprout in London. The reason is because Transport for London (TFL) opens up its public transportation data to everyone. Yes, including people outside Britian. You can get the free license at TFL developer site.

I will post regularly for the development of transport apps for London, New York City and Singapore. There will be screenshots and codes in both Android and iOS. Below is an Android widgets that I developed for NYC subway. It shows the status of subway lines. And a 1x1 widget for your favorite subway route. A bigger widget for your favorite stop. And finally a widget for a list of your favorite. It is very convenient to use as a glance of your mobile phone tells you everything you need to know. I will post the programming code in the near future. Have fun!


Hopefully my blog will inspire more people to develop new and sleek apps and improve living standard in their own country. It takes me many hours in the night to develop these applications and I am most willing to share them free including my coding. Please comment with your url if you have complete your own app. I would love to check it out!

I will also post great works that I discovered on Google play and iTune. If you need any support, please email me at ustransit74 (at) gmail (dot) com. Have fun!

"If you are going to make thing in your life, why not make it beautiful?" Designer

My apps link

NYC Subway Times (iOS version) (Android version) 22 130213 13 0301
Live London Bus Widgets (Android version) (iOS version) 19 130213 20 0301
SG Buses Delight (Android version) (iOS version) 02 130213
Live London Tube Tracker (Android version) (iOS version) 89 130213 56 0301
NYC Bus Tracker (Android version) (iOS Version)
UK Rail (iOS) 220313
SG Trains Delight (iOS) 230313


Monday, 10 February 2014

Setup Maverick apache with django and Postgres

I will detail the process soon..!

Ok here is the steps that I found to work on Feb 2014. It takes me a few weeks to get it.

I have tried my 2 Mac
- Mac OS X 10.8.5 Mountain Lion
- Mac OS X 10.9 Maverick

Step 1. Install PostgreSQL 9.3


download postgresql-9.3.2-2-osx and install. This is first and easiest part. Then edit your python project setting in your python mysite settings.py file


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', #django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'postgres',                      # Or path to database file if using sqlite3.
        # The following settings are not used with sqlite3:
        'USER': 'postgres',
        'PASSWORD': 'xxx',
        'HOST': '127.0.0.1',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'PORT': '5432',                      # Set to empty string for default.
    }
}


Step 2. Install adapter psycopy2 2.5.2 for PostgreSQl to Python


PATH=$PATH:/Library/PostgreSQL/9.3/bin
cd psycopg2-2.5.2
python setup.py build
python setup.py install
sudo ln -s /Library/PostgreSQL/9.3/lib/libssl.1.0.0.dylib /usr/lib
sudo ln -s /Library/PostgreSQL/9.3/lib/libcrypto.1.0.0.dylib /usr/lib


Step 3. Install mod_wsgi-3.4 It is a module for apache to run python. I think OS X server has built in. 

Goto terminal and cd to the mod_wsgi-3.4 directory

And type in ./configure
and then type in 

for Maverick:
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain

for mountain lion:
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain

Then use finder and open the file makefile in mod_wsgi-3.4 directory. Edit the CPPFLAGS parameter by inserting the below 

"
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/apr-1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/apache2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE 
"
Insert right after the "=" character. For mountain lion, replace 10.9 above with 10.8


example...

CPPFLAGS =  -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/apr-1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/apache2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE 

Lastly, type in 
make
make install

And mod_wsgi.so should be created. It is used in the next step. 

4. Configure Apache config file

- Goto terminal and edit the config file:
sudo pico /etc/apache2/httpd.conf

- Scroll down to load Module part and add wsgi
LoadModule wsgi_module libexec/apache2/mod_wsgi.so

WSGIScriptAlias / /Users/yongchong/Sites/mysite/mysite/wsgi.py
WSGIPythonPath /Users/yongchong/Sites/mysite

<Directory "/Users/yongchong/Sites/mysite/mysite">
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

....

<Directory "/Users/yongchong/Sites/mysite">
    # /Library/WebServer/Documents">

....
exit and save config file

Then add permission here for apache at terminal
chmod +x /Users/yongchong/Sites

So the combination of apache + python + postgresql is really solid. It never fail.. 2 months and running!

And here you go!





Thursday, 2 January 2014

Sg buses test 030114

Nearby stop uses old database.. Gives singpost when it already not in use.

Search 81111 gives no response.

- I need to tap refresh bus icon before I get the right location.

- at blk 14, it is very convenient. I get the stop where I am sitting.

- need a stop option in bus menu after I lead a old lady to cross the road.

- think I have not taken the bus for at least half a year. I need to take bus every month to feel the need and changes.

Sunday, 22 December 2013

Plant power stops working

On the 3rd day, it stops connecting to iphone. I thought it is because I have water it. I try to change battery. And it does not work. I clear the cache in the app. And finally, the least I expected, I turn off and on the iPhone. It works. I think it is the Bluetooth at iPhone that is jam as I turn Bluetooth on and off several times a day. I will leave it on for now. 

Tuesday, 17 December 2013

Redesign for NYC subway


291213 submit NYC subway text version
- will do notification. Check every 1 hour. If time is within 1 hour of notification time, fetch status. If status has delay, notify user. 020114 

It seems scrolling is too slow to use in transport environment. I may have to go back to tab controller. 

I really do not want to use scrolling in sg buses. I want info now. 

I add in page scroll because of the animation Irish app. But it seems it is a step backward. 

Can I have ads below the tab buttons? 

Do I need to have line status? Do user need to know the service change? Do user need to know train delay? Do I really need a line status page? 

How user want to be notify for train delay? Based on the time user check time. Or a user define time to check status and notify user only when there is a delay. It is easier to identify a time for notification. 

Should I give ios 6 a miss? I develop for ios 7 but the notification does not work for ios 5, 6. 

I am going to test it 3 days. Day and night. Test the notification. 

How is the animation version going to work? It will have tab insteads of scroll. It is faster. It will have tap hold menu for fav. 

What is the problem of my NYC server? It stop with a no debug info. Is it too many people trying to access the database? I do not have any write operation. Can I use monatomic? Is there any free server now? Should I reconsider offline database? 




Monday, 16 December 2013

Design work place

- easily take cloth after shower daily
- cool place to play piano in the morning
- for 2 person working
- able to do programming in the night 70% and day 30%
- able to sleep in hot 80% and cold 20% 

Saturday, 14 December 2013

Sg buses test 151213

It gives me the opposite bus stop when I sit at CDAC. Correct timing for bus 30. Direction works 1:40pm.

1:47pm. It gives me north light school in nearby. It is a cloudy day. As I walk to open sky, a step from the bus stop CDAC, it gives me CDAC. So after 7 tries to refresh locations. Once I return to my sit in the bus stop shelter, it gives me north light and show me at sandy lane.

1:51 Walk to Grandlink.

1:56 I am near city plaza but it gives me versilia condo after 5 tries. It shows that I am at versilia. The GPS is off. It is using the mobile network. Should I have a refresh button? But it still gives the wrong location. Need to use map to go to city plaza. The title is slow to update from nearby to favorite.

In view that my app has dropped to 30th place, I am finding the fact. It is slow in scrolling, give wrong bus stop. Heart of the problem. In the web, 2 person vote 1 star due to wrong timing.

The heart of the problem is that I have not use it for about a year. I have made great changes but I have not use it myself, that is the heart of the problem. 

It does not have the speed anymore.