Monday, December 5, 2011

Congratulations to myself. NCCU AMBA I am coming!

It is a great chance coming to me that I can enter the best MBA program in Taiwan.
I can't wait to absorb the business knowledge as I can.
It is a great benefit to a person who owns different knowledge fields on computer science and business management.
Later days I hope I can integrate both of these skills to improve my career even better.

Friday, September 30, 2011

Quick Check In

I launched an App named "Quick Check In" a period ago.
As the name, it allows users check in to Facebook quickly!

I wrote this because there is no fast enough app to enter screen that searches and shows places well.
And this is not a monster app that occupy mount of memory or internal storage, even more it saves the data connection and power consumption to let user check in efficiently.

Here are the related links, I hope you love it.
http://www.facebook.com/apps/application.php?id=233917706638405
https://market.android.com/details?id=com.sanhom.quickcheckin&feature=search_result

Sunday, August 14, 2011

Two ways to upload photo to Facebook

Graph and REST

1. Use Graph
/ALBUM_ID/photos
This way needs album id to upload a photo within a album.


Bundle params = new Bundle();
Uri uri = (from somewhere)
byte[] data = null;

InputStream is = mContext.getContentResolver().openInputStream(uri);
data = new byte[is.available()];
is.read(data);

if (data != null) {
    params.putString("message", "test");
    params.putByteArray("source", data);
    String response = Facebook.request(ALBUM_ID/photos, params, "POST");
}


2. Use REST
photos.upload
This doesn't need a album id, instead it creates a album with your application name if there doesn't exist one.


Bundle params = new Bundle();
Uri uri = (from somewhere)
byte[] data = null;

InputStream is = mContext.getContentResolver().openInputStream(uri);
data = new byte[is.available()];
is.read(data);

if (data != null) {
    params.putString("method", "photos.upload");
    params.putByteArray("picture", data);
    String response = Facebook.request(null, params, "POST");
}




Tuesday, July 12, 2011

Android: How to encode an URL path

Reference page
http://developer.android.com/reference/java/net/URLEncoder.html


Input (Bundle):
Bundle parameters;

Output (Encoded path):
String result = null;
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String key : parameters.keySet()) {
    if (first) {
        first = false;
    }
    else {
        sb.append("&");
    }
    sb.append(URLEncoder.encode(key) + "=" +
        URLEncoder.encode(parameters.getString(key)));
}
result = sb.toString();

Monday, July 4, 2011

Uri schemes for Android

Android provides 3 types of Uri for pointing a content.
SCHEME_ANDROID_RESOURCE
SCHEME_CONTENT
SCHEME_FILE

Developer has to deal with these schemes to point a content out when transferring via an Uri.

Thursday, June 30, 2011

Instant Upload on Google+

I am using Google+, its a complete socail environment.
I love the circles (just imagine t a movie "Litte Fockers" , Robert always says the "circle")
Now you can choose who can be in your circle!

As title I am talking the Instant Upload.
It will observe your pictures taken by camera and upload it if you ckeck the option in settings.
You can also choose upload via mobile network or wifi for each photos and videos.
Be noticed, it upload to instant album only.

Before this, HTC Sense (like Chacha & Salsa) has this function named "Auto Backup" and much well design.
Now HTC Sense supports two two Services as Facebook and Flickr.
Each service you can select a default album you want to upload.
Besides Instant Upload and only upload via Wifi, HTC Sense supports "Scheduler Upload".
You could set a daily scheduler to upload your photos on time.
This allows you upload photos when you are sleeping while the phone is charged.
It will not influence your internet speed, phone performance, and don't worry about battery dead.

If you have any suggestions on Auto Backup, please give me some feedback.
I'll improve it.

Thanks.
Sanhom