7.30.2011

Setting up OS/X Path for Android Development and Logging

Let's assume the default shell is in use on Darwin, bash, and you have installed the Android SDK for OS/X, installed Eclipse and the ADT. Now the you need that nice set of tools in the Android SDK/platform-tools directory, it's a lot easier if you add them to your profile. I found this a nice easy way to do it, if you have the profile it will append if not it will create it: 1.) Open TextEdit

2.) If the Users/
/(YOUR_FOLDER)/.bash_profile - exists, then open this file. 3.) Assuming no previous path information exists, then type the following:
PATH=/Users/(SUBSTITUTE_YOUR_PATH)/android-sdk-mac_x86/platform-tools:$PATH
4.) Save the file as /Users/(YOUR_FOLDER)/.bash_profile - if this does not exist, or open the .bash_profile in step #1 if the file exists.

SETTING UP LOGCAT
This can be easily be done in Eclipse as another view, but I like having it running in a background Terminal on my Apple.

1.) Open a Terminal window.
2.) Type: adb logcat

You will get a window output similar to below (depending on your emulators, and what debuggers you have setup)

 



The line in the logcat output:
D/Suduku  (  538): Debug Msg: Exit Clicked

Is coming from the emulator running, and the code I added to my Android application for this debugging information is as follows:

    private static final String TAG="";
    private void msg(String s)
    {
        Log.d(TAG,"Debug Msg: " + s);   
    }

When the user presses the "Exit" - in the onClick() method I have added the call to the method msg() as follows:

            case R.id.exit_button:
                msg("Exit Clicked");
                finish();
                break;

This sends the string "Exit Clicked" to the method msg(), which then sends the string to the debugging variable TAG - captured in the logcat output.

7.22.2011

Setting up Kinect Sensor on the PC

Microsoft Research has released the Kinect for Windows SDK BETA (32/64 bit versions).  Connecting the Kinect sensor to the PC is quite easy, but there are some things to consider.  The Xbox360 game console that has the Kinect sensor, the connector is not USB compatible. 

power-supply-adapter-cable-for-xbox-360-kinect-sensor-us_3

You must purchase an external power supply for the Kinect sensor (I had to call Microsoft Xbox Technical Support to verify this, because the information on the web was inconsistent).

On the channel9 video, that shows you how to setup the Kinect sensor – it refers to the Microsoft Store and a device that does not exist (USB Cable), but the picture shown is the Kinect Sensor Power Supply, which has a female connector for the Kinect jack and a USB output connector.

KinectSensorPS

The price for the Kinect Sensor Power Supply at the Microsoft Store is 34.95, but I purchased mine from Amazon for 11.64, with next day Prime Shipping (3.99).  Neither product description is very helpful, and the one from Amazon only had a 3-star rating based on one review by a person who was trying to use it for a totally different purpose than the Kinect Sensor.

My workstation with the Kinect operating:

Kinect_Workspace

7.21.2011

Windows Mobile: Changing Input Type Automatically

When developing an application, minimization of user input on the phone is critical.  If you develop an application that requires digital input (such as a calculator program) but the initial keyboard state is alphabetic, the user has to select the “123” key.

To automatically change the state for a specific textbox field use InputScope.

 

<TextBox Height="72" HorizontalAlignment="Left" Margin="136,32,0,0" Name="txtPrice" Text="0" VerticalAlignment="Top" Width="260" >
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Digits"/>
</InputScope>
</TextBox.InputScope>
</TextBox>





sample_dam_calc




 



REF: Windows Phone 7 Jump Start (Session 3 of 19): Building a Silverlight Application, Part 2