giovedì 8 luglio 2010

Froyo Build - Set bin directory is in your path on Ubuntu 10.04

If you haven't the bin directory is in your path, add it with these commands

  • Open the user .bashrc

    sudo gedit ~/.bashrc


  • Add at the end the bin file this line

    PATH=~/bin:"${PATH}"


  • Save and exit.

Froyo Build - Intrepid (8.10) on Ubuntu 10.04

The third step to set up your Linux development is not needed if you are not a Intrepid ( 8.10) users.

$ sudo apt-get install lib32readline5-dev 

Froyo Build - Install JDK 5.0 on Ubuntu 10.04

Intro


Recently I've decided to build the Android system image (Froyo) for my ADP1 from the lastest Android Open Source Project (AOSP).
I try to build it on Ubuntu Linux 10.04 LTS Desktop Edition 32-bit (x86).

If you'll follow the steps in Getting the Source probably you'll find some issues.
The first issue will be in the first step (Setting up your machine), installing the packages for Sun JDK 5.
The command below it gives you an error about JDK 5.

sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

E: Couldn't find package sun.java5.jdk

So, before of this command you have to use the cure to enable JDK5 and below you can find all the instruction.

Install JDK 5.0


These are the steps to solve the problem.
  1. Open the sources.list with GEdit or with your preferred editor

    sudo gedit /etc/apt/sources.list

  2. Enable the package including in the list the Sun JDK 5. Add this line at the end of file.

    deb http://ir.archive.ubuntu.com/ubuntu jaunty-updates main multiverse

  3. Update you package

    sudo aptitude update

  4. Now you may install it with all the others packages

    sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

    or alone

    sudo apt-get install sun-java5-jdk

That's all. Now you can continue with the Android's document.
Have a nice day.

giovedì 9 luglio 2009

Get the version information of an extern assembly

We have more ways to get the information of an assembly, the most two I use are:
  1. Only for .NET assembly
    System.Reflection.Assembly AssemblyFileInfo = System.Reflection.Assembly.Load(FileAppPath);
    Console.WriteLine (AssemblyFileInfo.GetName().Version);

  2. For all .NET and native assembly
    FileVersionInfo AssemblyFileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(FileAppPath);
    Console.WriteLine(AssemblyFileVersion.FileVersion)

martedì 9 giugno 2009

Application Path

Sometime I need to retrieve the application path, here I add the four methods I use frequently.

  1. The simple way through windows forms:
    using
    System.Windows.Forms;
    String sAppPath1 = Application.StartupPath;
  2. From the binary over reflection:
    String sAppPath2 = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );
  3. Using the file informations:
    FileInfo executableFileInfo = new FileInfo (Application.ExecutablePath);
    String sAppPath3 = executableFileInfo.DirectoryName;
  4. When my program is started from another:
    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Happy coding.

martedì 17 marzo 2009

Creating attractive UIs on Windows Mobile devices

Next week Alex Yakhnin will show us how to customize built-in controls that come with .NET CF, such as TextBox, DataGrid, ListView etc...

The first webcast of the series was great, this second will be better and more interesting. Stay tuned.

venerdì 9 gennaio 2009

iPod touch UI



I continue my journey in the fascinating world of mobile with a new article on TheCodeProject iPod touch UI[^].

Here you can see a new way to work with Alpha blending and a way to work with WMP OCX on mobile. The article focus on
  • C#
  • CF .NET
  • Resolution-aware and Orientation-aware
  • Dynamic graphic text resize
  • Mouse gesture
  • Intercepting button
  • Work with Windows Media Player OCX on Windows Mobile.

I hope you enjoy during the reading like me during the develop.