Saturday, November 26, 2011

Why do I want to use GitHub

GitHub can be a very useful tool for your career. It can probably help you in following ways:

1. Must-Have skill. 
Git is a tool that many companies will use in their daily development. So your Git skills can help you to get a job.

2. Opensource your personal profile
If you want to show your skills level to a recruiter or a hiring manager, your code maybe the best way for you to demonstrate your skills level. Having your project opensourced on Git would allow people to see your code and potentially improve your code quality

Thus far, these are all I can think of, but may add to this list later.

Friday, November 25, 2011

Need to learn how to write a blog

It has been a few month that I have this blog.

When I first started this blog, I wanted this place to be a place that I can put down my learning notes when I read something online. Then, when I started to do some Android programming, I put some announcement for my new project here. Now, since I started this job at Amazon, my life started to get busier and busier.

But I really don't want this place to lose its meaning. So let me try to start writing down what I learned and what I would like to share here. 

Hope I would have the time and enthusiasm to do this.

Happy Thanksgiving. 

Thursday, August 25, 2011

UTORLogin v1.0 available in Android Market~!


An application for University of Toronto students! This application will help you to login to the U of T wireless network easily. You just need to input your correct UTORid and password in the application and the application will log you in automatically! It is recommended that you put the App icon on your desktop so that you just need to launch the app to login your wireless account.

This application works at least in UTSC, if you are from other U of T campus, please comment below to let me know whether it works for you or not. Thanks!

Here is the link for the app on Android Marke


Friday, July 29, 2011

李开复说

一个世界有你,一个世界没有你,让二者的不同最大,就是你一生的意义。

人生在世,我们要用勇气改变可以改变的事情,用胸怀接受不可以改变的事情,并用智慧去分辨二者的不同。

Friday, June 24, 2011

Android Study Notes

Here are some of my study notes during the development process of TipsCalc.


Hide Soft Keyboard
- InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

HideStatusBar (in Manifest)
- <activity android:name="blahblah"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
- .Fullscreen will hide status bar and title bar

Remove focus on Edit text from App startup
- <LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:focusable="true" android:focusableInTouchMode="true">

Prevent screen rotation
- <activity android:name=".TipsCalc" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="portrait">
- the other direction is screenOrientation="landscape"

Set a different view when orientation changes
- http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android

Keep data when rotation happens
- save everything in Bundle in onSaveInstanceState(Bundle outState)
- Bundle is like a dictionary in Python or hashtable in Java
- use method like Bundle.putString(key, value)
- restore everything when onRestoreInstanceState(Bundle savedInstanceState)
- use method like Bundle.getString(key, value)

EditText not fullscreen when landscape
- mEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);

Making an luncher Icon
http://blog.mikandi.com/all-entries/developers/design-developers/tutorial-design-a-simple-app-icon-with-photoshop/

End User Licensing
- http://bees4honey.com/blog/tutorial/adding-eula-to-android-app/


Checking WiFi/3G connected to a network (not on/off)
- ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
    if (mWifi.isConnected())
        //if wifi connected
NetworkInfo mMobile = connManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
    if (mMobile.isConnected())
        //if internet connected

Request Rating in Androd App Market
- http://www.androidsnippets.com/prompt-engaged-users-to-rate-your-app-in-the-android-market-appirater
- Code in UTORLogin maybe better

Progress Dialog and Android Threading
- http://www.vogella.de/articles/AndroidPerformance/article.html


TipsCalc v1.0 available in Android Market~!

TipsCalc is an application that helps users to calculate tips after each meal. This is my first time to develop an Android application, so there maybe many problems or bugs.

The development experience was great and Stackoverflow is extremely helpful for android development.

Here is the link for the app on Android Market.

Saturday, May 21, 2011

Google Map View API Registration (MD5 Fingerprint + Key Signup)

I encountered this problem when I was learning Google Map View tutorial example for AndroidGoogle provides its own tutorial about Obtaining a Maps API Key, but for those like me,who were not that familiar with Java key generation, I think it's a bit hard to understand.So here are some notes about it and this is all based on Windows 7.

1. Finding Keytool: 

Keytool is an executable file that comes with JDK. Running this tool under command prompt will give you the MD5 finger print. The JDK folder locates at where you installed Java and you can usually find the keytool under the bin folder. This is the path where I found mine

C:\Program Files\Java\jdk1.6.0_25\bin


2. Generating release keystore:

Open command prompt through "Start - Run - input 'cmd'", cd to the JDK bin folder. Then input the following command where you can replace alias_name and release_key to whatever you like

keytool -genkey -v -keystore release_key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

After you pressing Enter, the program will ask you several questions and some passwords. You will find your release_key.keystore in the bin folder. Note that you are generating this key for releasing, if you just want to sign your debug certificate, you can find the debug.keystore under this path

C:\Users\Your_Win7_Username\.android

3. Getting the MD5 Fingerprints:


Now you can get your MD5 fingerprints by executing the following command


keytool -list -keystore release_key.keystore

The program will ask you for password, which should the keystore's password. At the end, your MD5 fingerprints should look like this


94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98

When getting your debug.keystore's MD5 fingerprint, you'd better use the following command as suggested on Google's site


keytool -list -keystore debug.keystore -storepass android -keypass android




4. Map API Key signup


After you got your MD5 fingerprints, you can visit the sign up page to get the API key. With the key, you can develop your android program with the Map view API.

Sources:
http://code.google.com/android/add-ons/google-apis/mapkey.html
http://developer.android.com/guide/publishing/app-signing.html
http://stackoverflow.com/questions/2997348/cant-find-the-android-keytool