Free 20GB Cloud Storage for everybody

July 13, 2013 1 comment

I’ve been using Copy Cloud Storage for a while, and it seems working pretty well as I expected.

However, the storage is likely to be kinda short, well, you know, cloud file storage is quite popular nowadays; and 15GB free is not enough definitely. You need to pay for more spaces.

Fortunately, Copy is running on an event for 5GB storage for each invited registration, that means you and your referred buddy will get both 5GB as bonus in your accounts. Isn’t that great?

If you are new, feel free to create account under my referral to get extra 5GB at first, and then you can invite your friends to join the cloud storage network for more spaces: https://copy.com?r=yVP8U0

Have fun with cloud ^^~

Magazine for sharpening mobile UX Skills


It’s been a long time inactive, now I can come back with the new magazine what provides lots of analysis and reviews for mobile user experiences.

Come, visit and comment me at: http://uxsharp.com/

Categories: Of Diary Tags: , , ,

A Note when Using Jsoup: User-Agent

January 29, 2013 1 comment

Several days ago, I’ve tried to run Jsoup on mobile testing for data parsing. My goal is to parse all questions posted on stackoverflow.com.

However, the result doesn’t fit me well.

First run on simple Android code:

public class MainScreen extends Activity
{
    ArrayList<String> mData =  new ArrayList<String>();
    ListView mListView;
    ArrayAdapter<String> mAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mListView = (ListView) findViewById(R.id.listView);

        processData();

        mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, mData);
        mListView.setAdapter(mAdapter);
    }

    private void processData() {
        String URL = "http://stackoverflow.com/questions/tagged/android";
        try {
            Document doc = Jsoup.connect(URL).get();
            Elements questions = doc.select(".summary h3 a");
            for(Element question: questions) {
                mData.add(question.text());
            }

            if(mData.size() == 0) {
                mData.add("Empty result");
            }

        } catch (Exception ex) {
            ex.printStackTrace();
            mData.clear();
            mData.add("Exception: " + ex.toString());
        }
    }
}

The result is empty. Well, thought of something else, so my next try is to print HTML from “doc” object, it outputs parts of full expected HTML results. So I parse with this selector: “div.nav li a”. The results show up but not for “.summary h3 a”.

After two days, working with Johnathan Hedley on GitHub, finally, found the problem is that: the mobile browser user-agent differs from the desktop browser; therefore, the HTML responses differ.

Make a note to mobile developers that use Jsoup:

+ always set a desktop user-agent

+ set a timeout

That’s good practice to avoid unexpectation.

This is the update working line:

Document doc = Jsoup.connect(URL).userAgent("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de-de) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10").get(
);

This issue was discussed here in GitHub: https://github.com/jhy/jsoup/issues/287

 

Cheers,
Pete Houston

Categories: Tricks & Tips Tags: , , , , ,

Geek Hero Comic

January 27, 2013 1 comment

Welcome to Geek Hero Comic,

Even though the series is under break, and no-one knows when it will come back again, but still, Geek Hero Comic is one of the best comic series about computer geeks.

If you’re already familiar or don’t know about it, just read it once, you will fall in love with it and keep reading every single interesting chapter.

[ Geek Hero Comic ]

version: 1.1

support Android version: 1.6+

Download: Play Store

[ Changelog ]

27/Jan/2013

[version 1.1]

.improve image quality when read in fullscreen mode
.add detailed information for characters

25/Jan/2013

[version 1.0]
.first release
.set GeekHero picture to wallaper
.read story from the very first episode to the last
.view image in fullscreen
.share episode to other apps, like Twitter, Facebook,…
.smooth image view
.add characters’ info

[ Features ]

information on series’ characters

. set wallpapers of some nice GeekHero pictures.

. read and load all chapters at the same time

. support reading in fullscreen mode

. start reading from last read chapter.

. smooth image viewer

[ Screenshots ]

screenshot_03screenshot_04screenshot_05

 

 

 

 

 

 

 

 

 

 

Cheers,

Pete Houston

Vlog Channel

January 19, 2013 Leave a comment

Welcome to Vlog Channel…

This application will provide you access to all JVevermind clips.

For all of you who like to watch personal-sharing of JVevermind, this application will allow you to watch and enjoy all the latest clips on your devices.

[ Application ]

Vlog Channel

Verson: 1.0

Support Android version: 1.6+

Download: Play Store

[ Changelog ]

20/Jan/2013

. version up, v1.1

. fix screen empty bug

. add Vietnamese language support.

19/Jan/2013

. first release, v1.0

[ Features ]
– Watch clip in two mode: small-box, full-screen.
– Describe clips’ information including: title, published date, number of views, number of likes and rating.
– Support favorite bookmark for the clips you like and display.
– Support the search functionality with auto-complete.
– Support auto update all the latest clips by pulling down the screen.
– New UI design, modern and stylish.
– In case application crash or causes error, you can recover by tapping on the Home icon in the top left corner.
– Optimize for watching clips in 2G/3G network.

[ Requirements ]
– Install and update the latest version of Youtube.

[ Compatibility ]
– Optimize for all devices running Android version 4.0.3+ and up.
– For the lower version, if you have any troubles running, please contact me through email; I will give you the best support.

[ Screenshots ]

Cheers,

Pete Houston

ChokyCooky Font for Apex Launcher

January 7, 2013 1 comment

Having a custom Rom of Galaxy 2, and Apex Launcher with TouchWhiz theme, but it doesn’t support the ChokyCooky font for Apex launcher.

So I create this small theme package to add into Apex theme to make it look more similar to the real TouchWiz theme.

[ Application Information ]

ChokyCooky Font for Apex

Version: 1.0

Android version:  4.0+

Apex Launcher version: all versions with theme support.

Download: 

Google Play Store – ChokyCooky Font for Apex

or scan QR code:

Play Store: ChokyCooky for Apex

Play Store: ChokyCooky for Apex

 

 

 

 

 

 

 

 

 

Screenshots:

Preview Feature

Preview Feature

Preview 1

Preview 1

Preview 2

Preview 2

Preview 3

Preview 3

Enjoy!

Cheers,

Pete Houston

Categories: Applications Tags: , , , ,

Detect if an application is installed or not

January 3, 2013 Leave a comment

There will be a situation where your applications require a pre-installed application in order to use their libraries or functions, for example, sharing on Facebook or Twitter, watch video on Youtube, scanning barcode from ZXing, launch casts on Sopcast

What need to implement is to detect whether those required applications are installed or not, if not, redirect users to market and get it installed.

1. First, check if the required app is installed.

There are two ways:

+) List all installed apps and find if it is installed. (refer: Retrieve list of installed applications)

+) Fire the intent of the required app to see if it runs. (refer: Launch an activity)

Well, the first way seems to be the classical one, in case lots of apps installed on device, it might reduce performance.

The second way looks better, and if it throws an exception if app not installed,  NameNotFoundException, it is the proper time to trigger the market to install.

2. Implementation on firing Intent.

This is how I work it out:

ackage pete.apps.study.droid10;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;

public class Utils {

    /** handle the required pre-installed app */
    public static boolean handleRequiredApp(Context context, PackageManager pm, String packageName)
    {
        Intent iApp = pm.getLaunchIntentForPackage(packageName);
        try {
            // this line will trigger exception if not found
            pm.getApplicationInfo(packageName, 0);
            return true;
        } catch (Exception ex) {
            // launch the market for installation
            launchMarket(context, packageName);
            return false;
        }
    }

    /** launch market to certain app */
    public static void launchMarket(Context context, String packageName)
    {
        Uri uri = Uri.parse("market://details?id=" + packageName);
        Intent iDown = new Intent(Intent.ACTION_VIEW, uri);
        context.startActivity(iDown);
    }
}

Note that: the Exception will fire either when application is not installed (NameNotFoundException) or installed but having no real launching Acitivity (ActivityNotFoundException). 

This is the sample project if you cannot run the code: Demo code – Droid 10

Cheers,

Pete Houston

Categories: Tricks & Tips Tags: ,