Monday, October 10, 2011

IDE for Android C/C++ Programming

Good IDEs for Android C/C++ programming includes
The first two can also be for Java programming with Android SDK. Android Development Tools is an integrated environment tool in which to build Android applications. It is officially supported in Eclipse, but not for Netbeans. Here is "How to install Android plugin version 1.x into NetBeans". According to an Android C/C++ programming blog site, ian-ni-lewis.blogspot.com, Cygwin and WinGDB are prerequisites for C/C++ programming using Visual Studio.

agcc for Android NDK, Revision 6b on ARM

agcc is a perl script Andrew Ross has written to take the pain away here and with the android toolchain in your PATH. It should be executable (by change 755) put it into your PATH somewhere (perhaps in $HOME/bin or so). It helps set various flags and things needed to cross-compile an application and properly link it to Android bionic c compiler. I modified agcc for Android NDK, Revision 6b. Here is the diff for agcc2.pl:

5c5
< my $NDK = '/path/to/android-ndk-r6b';
---
> my $NDK = '/path/to/android-ndk-r5c';
40,41c40,41
< my $PREBUILT = "$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86";
< my $TOOLCHAIN = "$NDK/toolchains/arm-linux-androideabi-4.4.3";
---
> my $PREBUILT = "$NDK/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86";
> my $TOOLCHAIN = "$NDK/toolchains/arm-eabi-4.4.0";
93c93
< "-Wl,-T,$PREBUILT/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x",
---
> "-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x",
105c105
< "$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a",
---
> "$PREBUILT/lib/gcc/arm-eabi/4.4.0/libgcc.a",
120c120
< "$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a",
---
> "$PREBUILT/lib/gcc/arm-eabi/4.4.0/libgcc.a",
165c165
< my @cmd = ("arm-linux-androideabi-gcc");
---
> my @cmd = ("arm-eabi-gcc");
179a180
>

To use it,
  1. download Android NDK 6b;
  2. add android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin to your PATH;
  3. Compile your program by agcc -o your_app your_app.c

Saturday, October 8, 2011

DVI EDID

A male DVI-D (single link) connector
Digital Visual Interface (DVI) supports Extended Display Identifi cation Data (EDID), a dedicated data stream that allows a display to communicate its capabilities to the graphics source through the DDC (Data Display Channel). The DDC's I2C master in the DVI-source reads EDID from the display device's I2C slave.

EDID is defined by a standard published by the Video Electronics Standards Association (VESA). The EDID includes manufacturer name and serial number, product type, phosphor or filter type, timings supported by the display, display size, luminance data and (for digital displays only) pixel mapping data.

EDID structure versions range from v1.0 to v1.4; all these define upwards-compatible 128-byte structures. EDID structure v2.0 defined a new 256-byte structure, but subsequently has been deprecated and replaced by v1.3. HDMI 1.0 – 1.3c uses EDID structure v1.3.

With EDID, the display communicates its operational information to the graphics source including available resolutions and scan rates. Ideally, the graphics card will read the EDID and adjust its output to best match the native resolution and scan rate of the display, avoiding any compromises in image quality due to scaling, scan rate conversion, etc. More importantly, the graphics source must receive the EDID info in order to send a signal. If the EDID is lost, the graphics source must shut down within 1 second. This is to avoid the assumed disconnected end of the DVI cable becoming a high-frequency radiator that could cause radio
frequency interference.

The following presentations provide very helpful information for EDID usage:
The most critical EDID setting is the timing which consists of
  • Resolution (e.g. 640x480, 1280x1024, 1920x1200)
  • This is the dominant characteristic which also defines the display capability
  • Vertical or refresh rate (e.g. 60Hz, 75Hz, 85Hz)
  • Horizontal rate (or line rate)
  • Blanking
  • Sync

Friday, October 7, 2011

Gingerbread Android C/C++ Programming on Ubuntu 11.04

For using open source libraries or developing a device driver and a game, native C or C++ programming sometime has to be applied. Google suggests Android NDK should be used for this purpose. The following visual tutorials are very helpful:
Android developers website showed some examples. Frank Ableson wrote a tutorial to reuse existing C code with the Android NDK. Eclipse and Android Developer Tools are suggested to be used.

Charles Wilde also gave a very good tutorial, "Android Native Development Using the Android Open Source Project".

credentiality showed a simple way to do native C program using NDK after downloading Android SDK and NDK. He applied a perl script agcc to setup build environment.

In 2009 Radu Motisan posted "Android C native development – take full control!" which is very interesting to me. Follow this instruction, I installed Ubuntu 11.04 on a virtual machine and tried a hello.c on Gingerbread Android. Here was how I did:

1. Prepare additional packages for Ubuntu 11.04.

(1) Install Sun java6

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-jre-plugin sun-java6-jdk

(2) Install other packages

sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

2. Install repo

Make sure you have a bin/ directory in your home directory, and that it is included in your path:

mkdir ~/bin

in .bashrc add

export PATH=~/bin:${PATH}

And source .bashrc.

Download the Repo script and ensure it is executable:

curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo
chmod a+x ~/bin/repo

3. Initializing a Repo client

Create an empty directory to hold your working files:

mkdir mydroid
cd mydroid

Run repo init to bring down the latest version of Repo with all its most recent bug fixes. We must specify a URL for the manifest. I tried the code aurora repo mirror site.

repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread_house -m M7630AABBQMLZA414001.xml

4. Getting the Android source tree

repo sync


source build/envsetup.sh
lunch full-eng
make

6. Compile Hello.c with gcc for the Android platform

Android uses a simplified version of libc, called bionic. We need to compile using Android's prebuilt cross-compiler arm-eabi-gcc, and use the bionic library on the phone. The easy way to do this is to use the agcc perl wrapper. We also need to change the libgcc.a path from 4.2.1 to 4.3.1. Put this agcc in ~/bin and make it executable.

chmod +x agcc

Then set the PATH to the bionic libs and the agcc location:
~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin:~/:~/mydroid/

Now you can compile the test.c file:
agcc test.c -o test

Take the resulting test binary and upload it to your android using:

adb push test /data/local/test

Then run it:

adb shell
chmod 775 test
./test

Thursday, October 6, 2011

'You've got to find what you love,' Jobs says

This is the text of the Stanford Commencement address delivered by Steve Jobs on June 12, 2005.

I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I've ever gotten to a college graduation. Today I want to tell you three stories from my life. That's it. No big deal. Just three stories.

The first story is about connecting the dots.

I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?

It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: "We have an unexpected baby boy; do you want him?" They said: "Of course." My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.

And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents' savings were being spent on my college tuition. After six months, I couldn't see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn't interest me, and begin dropping in on the ones that looked interesting.

It wasn't all romantic. I didn't have a dorm room, so I slept on the floor in friends' rooms, I returned coke bottles for the 5¢ deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:

Reed College at that time offered perhaps the best calligraphy instruction in the country. Throughout the campus every poster, every label on every drawer, was beautifully hand calligraphed. Because I had dropped out and didn't have to take the normal classes, I decided to take a calligraphy class to learn how to do this. I learned about serif and san serif typefaces, about varying the amount of space between different letter combinations, about what makes great typography great. It was beautiful, historical, artistically subtle in a way that science can't capture, and I found it fascinating.

None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, it's likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.

Again, you can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.

My second story is about love and loss.

I was lucky — I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation — the Macintosh — a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.

I really didn't know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down - that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me — I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.

I didn't see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.

During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I returned to Apple, and the technology we developed at NeXT is at the heart of Apple's current renaissance. And Laurene and I have a wonderful family together.

I'm pretty sure none of this would have happened if I hadn't been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don't lose faith. I'm convinced that the only thing that kept me going was that I loved what I did. You've got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

My third story is about death.

When I was 17, I read a quote that went something like: "If you live each day as if it was your last, someday you'll most certainly be right." It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: "If today were the last day of my life, would I want to do what I am about to do today?" And whenever the answer has been "No" for too many days in a row, I know I need to change something.

Remembering that I'll be dead soon is the most important tool I've ever encountered to help me make the big choices in life. Because almost everything — all external expectations, all pride, all fear of embarrassment or failure - these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.

About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn't even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor's code for prepare to die. It means to try to tell your kids everything you thought you'd have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.

I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form of pancreatic cancer that is curable with surgery. I had the surgery and I'm fine now.

This was the closest I've been to facing death, and I hope it's the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:

No one wants to die. Even people who want to go to heaven don't want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life's change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.

Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma — which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in Menlo Park, and he brought it to life with his poetic touch. This was in the late 1960's, before personal computers and desktop publishing, so it was all made with typewriters, scissors, and polaroid cameras. It was sort of like Google in paperback form, 35 years before Google came along: it was idealistic, and overflowing with neat tools and great notions.

Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: "Stay Hungry. Stay Foolish." It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.

Stay Hungry. Stay Foolish.

Thank you all very much.

iPhone 4S Multimedia Capability

  • Audio
  1. AAC (8 to 320 Kbps)
  2. Protected AAC (from iTunes Store)
  3. HE-AAC
  4. MP3 (8 to 320 Kbps), MP3 VBR, Audible (formats 2, 3, 4, Audible Enhanced Audio, AAX, and AAX+)
  5. Apple Lossless, AIFF, and WAV
  • Video/Movie
  1. H.264 video up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
  2. MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
  3. Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
  • Image Processing
  1. 8 MP camera having capability to capture HD video with “real-time video image stabilization.”
  2. Microscope Feature. Using 5x magnification ball lenses (1 millimeter-diameter) and the high resolution of the camera’s semiconductor sensor, the iPhone microscope could distinguish features on the order of 1.5 microns
  3. Spectrometer Feature. Like the microscope, the iPhone’s spectrometer takes advantage of smartphone imaging capabilities
Thanks to Apple and Steve Jobs, no wonder there are lots of applications that can be played with iPhone 4S. I am very sad since Steve Jobs passed away yesterday. I also like to pay homage to Steve Jobs and his legends.

Wednesday, October 5, 2011

August 2011 U.S. Mobile Subscriber Market Share

Today comScore reported August 2011 U.S. mobile subscriber market share as follows.

  • OEM Market Share

Top Mobile OEMs
3 Month Avg. Ending Aug. 2011 vs. 3 Month Avg. Ending May 2011
Total U.S. Mobile Subscribers (Smartphone & Non-Smartphone) Ages 13+
Source: comScore MobiLens
Share (%) of Mobile Subscribers
May-11Aug-11Point Change
Total Mobile Subscribers100.0%100.0%N/A
Samsung24.8%25.3%0.5
LG21.1%21.0%-0.1
Motorola15.1%14.0%-1.1
Apple8.7%9.8%1.1
RIM8.1%7.1%-1.0

  • Smart Phone Platform Share

Top Smartphone Platforms
3 Month Avg. Ending Aug. 2011 vs. 3 Month Avg. Ending May 2011
Total U.S. Smartphone Subscribers Ages 13+
Source: comScore MobiLens
Share (%) of Smartphone Subscribers
May-11Aug-11Point Change
Total Smartphone Subscribers100.0%100.0%N/A
Google38.1%43.7%5.6
Apple26.6%27.3%0.7
RIM24.7%19.7%-5.0
Microsoft5.8%5.7%-0.1
Symbian2.1%1.8%-0.3

  • Mobile Content Share

Mobile Content Usage
3 Month Avg. Ending Aug. 2011 vs. 3 Month Avg. Ending May 2011
Total U.S. Mobile Subscribers (Smartphone & Non-Smartphone) Ages 13+
Source: comScore MobiLens
Share (%) of Mobile Subscribers
May-11Aug-11Point Change
Total Mobile Subscribers100.0%100.0%N/A
Sent text message to another phone69.5%70.5%1.0
Used browser39.8%42.1%2.3
Used downloaded apps38.6%41.6%3.0
Accessed social networking site or blog28.6%30.9%2.3
Played Games26.9%28.5%1.6
Listened to music on mobile phone18.6%20.7%2.1


Followers

About Me

My photo
HD Multimedia Technology player