Pages

August 31, 2010

Blogger Code Formattings | Sample

"Show Me The Code" ( a title of davanum's blog ) !! 
To present snippets in most readable form in blog post, code-snippets needs to be formmated with Syntax Highlighter. Below is the code formatting sample...
// Comment
public class Interesting{
  public Interesting() {
}
 
public void Fun() {
  /* Another Comment
  on multiple lines */
  int x = 9;
}
}

Find out how to format code like this sample on Syntax Highlighter for Blog | a Blog Post 
hope this helps you to "Show Your Snippets" - Sharing is Learning !!

Samsung Galaxy Tablet

Android : hey iPad , Here i come , Samsung Galaxy Tablet official Launch this week. 
Tablet Competition Begins.. 

Samsung Galaxy S has great success all over the world, same expecting from TABLET.



Runs on Android 2.2..


For Indian user it would be delighting :)  Download Millions of Apps from Android Market.
I guess now Google will soon create new Category on Droid Market: Android Tablet Apps
Find out More on Samsung Galaxy Tablet | Official Site ....

August 29, 2010

Android Tips : onClickListener:onClick()


In this post , we will learn "Easy/Effective way to write code in onClickListener's onClick() to know which Button is clicked"

Inside onClick(View view) : write a switch-case as shown in below code.

Android UI Thread & Massive Work Thread

Many times Android Application becomes in-responsive due to heavy load on UI thread & user gets "FORCE CLOSE" message.

Avoid performing long-running operations (such as network I/O) directly in the UI thread — the main thread of an application where the UI is run — or your application may be blocked and become unresponsive. Here is a brief summary of the recommended approach for handling expensive operations:

There is simple solution to make application that does Massive work & need to frequently update UI.
Solution is to create a mechanism using  android.os.handler ,
  1. Create a Handler object in your UI thread
  2. Spawn off worker threads to perform any required expensive operations
  3. Post results from a worker thread back to the UI thread via Message Object.
  4. Update the views on the UI thread as needed
Below is simple solution:

public class MyActivity extends Activity {

    [ . . . ]
    // Need handler for callbacks to the UI thread
    final Handler mHandler = new Handler();

    // Create runnable for posting
    final Runnable mUpdateResults = new Runnable() {
        public void run() {
            updateResultsInUi();
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        [ . . . ]
    }

    protected void startLongRunningOperation() {

        // Fire off a thread to do some work that we shouldn't do 

        // directly in the UI thread 

        Thread t = new Thread() {
            public void run() {
                mResults = doSomethingExpensive();
                mHandler.post(mUpdateResults);
            }
        };
        t.start();
    }

    private void updateResultsInUi() {

        // Back in the UI thread -- update our UI elements based on 

        //the data in mResults
        [ . . . ]
    }
}
Article on Android.com | Common Task

August 14, 2010

Start a Kick-ass Marketing Company While Skiing Out West for 6 Months




skiing

Starting any company is tough, but starting a company while living at the base of the gondola in Breckenridge, Colorado makes it near impossible. However this is exactly what happened when Under30CEO co-founder Matt Wilson decided that it was time to start a digital marketing firm even though he was in the middle of the rocky mountains spending his days skiing fresh powder.

This was about 9 months ago when the first ideas for Shadow Concepts were being tossed around the Under30CEO offices. At the same time Matt was seeing the opportunity he had always dreamed of to go out and live at a ski resort as a ski bum for a winter. These kinds of dreams are the reason he became an entrepreneur. No one could hold him back and it was 100% up to him.  Needless to say he went for it.

The Under30CEO team had realized that they had created something special online and were now being asked by many about social tools, community and creating an online presence for a brand.  It was the perfect opportunity and at the time even seemed easy as they already had people asking them about these things. So a hurdle of 1500 miles seemed like something they could overcome. Well nothing goes as planned and like everything lessons are learned along the way. Here is what Matt learned about starting a company and being thousands of miles away from his home and business partners.

1. Take it slow

You don't have to dive into things headfirst and never look back. Matt spent his days skiing and his nights working on small client projects like training while developing future plans on how to grow. This not only fit the schedule but built credibility, experience and case studies before going after larger accounts.  This past winter was all about lifestyle design for Wilson.

2. Sacrifice

We mean lots of it! Skiing all day sounds great but don't expect to go to the party at night.  And don't expect to not get harassed by all your ski buddies going out for apres-ski dollar drafts. You have to buckle down and give something up. But don't worry hopefully your day of running a company and skiing in some great conditions is exciting enough. And please, Wilson insists if you are going to do this, don't be the guy on your Blackberry while riding the lift.

3. Network

You may be skiing all day but don't forget to network with every person you come across. Just think what those people do who are staying at the suite in the resort or the parents who drop their kids off at ski school in the Range Rover. What about the full time staff at the resort who know the big time clients that roll through? You never know who you might end up talking to so make it a point to put yourself out there to everyone. Wilson also mentioned something about "snow bunnies", but we are going to leave that part out…

4. Don't piss off the business partner

If you have a business partner who is back at home working away day and night on the company you don't want to piss him/her off. They won't care if your off living a dream by being a ski bum for a winter because that is why were creating this lifestyle in the first place. But make sure to show them your working, building and being responsive to everything each day. They know you might be a little behind but don't disappear for a week with no contact.

5. Bend the rules

Don't use that sick day because you are hungover from a crazy party or exhausted from a huge day of skiing. Save that sick day for when you have a huge sales call or a speaking gig at the local college or chamber of commerce. Remember your in a whole different part of the country and this is the best chance you have to break into that market right now. And if your calling in sick it better be because your taking a local business owner out to lunch to sign a contract.

6. Don't crash

Look it is OK to go out and have fun and push the limits. But use your head when there are backcountry avalanche warnings until your business has more of a foundation. At this point everything is riding on you and if you end up out of commission you not only will lose your clients but will be set way back when you head back home after the winter. Oh, and this will also piss off the business partner from lesson 4…

Check out the end result 9 months later ShadowConcepts.com.




August 4, 2010

Control an R/C car with Android & Bluetooth


P

Wow, controlling things with bluetooth and Android seems to be all the rage these days! Earlier today we showed you some videos of Android controlling Lego Mindstorm NXT via Bluetooth. Fast forward a few hours and Eirik Taylor, a 21 yr old 1/2 Canadian, 1/2 Norwegian guy is controlling his R/C Ferrari with his HTC Hero. But enough of the boring stuff right? Check out the video and wiring schematic after the break.

Click here to view the embedded video.

His website contains a LOT of useful info, including the schematic for how the car is wired:

Thanks to our tipster for sending this in!

For more information on Android and the current Android mobile phones, check out our Android Guides

Video: Control an R/C car with Android & Bluetooth