Moving base to new page: pcode.petehouston.com

December 17, 2013 Leave a comment

Hi guys,

I’m going to move all my blogs and articles into my own base at, http://pcode.petehouston.com/

In the new base at p’code, there will have:

  • more contents, categories and sections (Android, Image Processing, Data Mining, Data Crawling, Security…)
  • various topics related to programming.
  • better tutorials / guideline for learning stuffs.
  • re-base source code sample into my Github account.
  • (special) video tutorials in some topics for better illustration.
  • ….and many more to come.

Still, I will keep this Android Code Breaker this place for any new visitor to find the old information. However, all these old articles on this blog will be re-written for better readings, illustrations and clear code samples.

Join me and follow me at new base: P’CODE – ‘da code journal of a mindless developer.

Feel free to contact me via: Pete Houston – Personal Website

Categories: Home, Of Diary Tags: , ,

Free 20GB Cloud Storage for everybody


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 Leave a 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: , , , ,