Writing portable Open GL 2.x / OpenGL ES 2.0 code using Android NDK

January 27, 2012 in Uncategorized

I got myself a second-hand Samsung Galaxy S at last, and started hacking on it!

The very first thing I wanted to try was porting the OpenGL wikibook C++ samples, that we wrote with OpenGL ES 2 in mind.

I started writing a minimal GLUT-compatible wrapper to run the samples as-is, using the Android NDK, and I’m making progress :) The Android NDK is getting nicer with Android 2.3, though it still feels less supported than Java apps (e.g. the resize events seem buggy and the keycodes header is incomplete…). Nonetheless, it’s nice to be able to write C++ portable apps.

You can see how to use the wrapper, and how it works internally, at:

http://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android

One of the limitations is that GLES2 is not a true subset of OpenGL 2.1, in particular:

  • the shader version is declared differently (#version 100 vs. #version 120)
  • GLES2 shaders require float precision hints, but OpenGL 2.1 doesn’t support them at all

I needed to pre-process these differences away, checking on GL_ES_VERSION_2_0 in the C++ source code to define a GLES2 macro in the shaders:

#ifdef GLES2
varying lowp vec4 f_color;
# else
varying vec4 f_color;
#endif

Is there a better way?

 

ED: see the article comments for some good tips

Sony implementation of WebGL for Android 4.0+ goes open source.

January 26, 2012 in WebGL

WebGL_on_Xperia_ion_small

In November, we announced that we were the first phone manufacturer in the world to support WebGL in the native Android web browser on Xperia™ phones. As a next step, we are now very excited to release our WebGL implementation for our coming Xperia™ phones running Android™ 4.0 (Ice Cream Sandwich) and above as open source. Read more after the jump, as Anders Edenbrandt, Senior Software Architect, explains more!

GLUT for android Java+NDK wrapper allows you to follow OpenGL wikibook on Android

January 24, 2012 in JNI, NDK, OpenGL, Tutorials, Uncategorized

There is a GLUT (Java+NDK wrapper) that
it would allow users to follow the OpenGL wikibook tutorials on Android without modification

I eventually got myself a Galaxy S and started implementing this GLUT
wrapper idea!

http://en.wikibooks.org/wiki/OpenGL_Programming/Installation/Android

It currently works for tutorials up to “teapot“.

I’d greatly appreciate your feedback :)

Regards,

Sylvain Beucler

No, Apple Isn’t ‘Closing in’ on Android

January 24, 2012 in News

Linked by Thom Holwerda on mobile osnews
“This week, tons of websites are reporting that Apple is catching up with Android when it comes to U.S. smartphone market share. The reports are based on some new data from Nielsen, a metrics company that measures smartphone use. The only problem: people are completely misinterpreting the data.” Numbers are fickle beings.

Theme downgrade

January 24, 2012 in Site

Because of some issues with the site theme, unfortunately we had to revert to a default theme until we will fix the issues.

Sorry for the inconvenience.

building tips for ICS android-x86 4.0.3

January 4, 2012 in Uncategorized

I found Japanese tips on building 4.0.x and following them now i could create the daily iso for asus laptop and eeepc ,
soon i will publish the iso and usb images daily

The only thing i forgot is that now lunch is needed after build setup env is done

. build/envsetup.sh
make clean
make installclean
lunch asus_laptop-eng
make-j12 iso_img

wait and then burn the iso and boot on a asus laptop

Test build 20120101 for Android-x86 4.0 (ICS-x86) is released.

January 4, 2012 in Uncategorized

The Android-x86 project is glad to announce a new test build 20120101 for public testing. This is a test release for android-x86 4.0. Live CD ISOs are available from our sites, as usual

Queru: Another year of AOSP

January 1, 2012 in Uncategorized

Jean-Baptiste Queru reflects on the ups and downs of the Android Open Source Project in 2011.

Well, the work year is over for me as today was my last day in the office before the new year.

This closes my 3rd whole year working on the Android Open-Source Project (my involvement in 2008 had been quite minor). It’s been an interesting year for AOSP, full of contrasts.

On the positive side:

-I finally managed to distribute some proprietary hardware-related binaries for the very first time. This is an issue that I had been working on since before the G1 even shipped, and it finally became reality. For me personally, that’s really a huge deal, because it really makes it practical to take the AOSP code, modify it, install it on a phone in a way that actually works, and to distribute the resulting image. This enables community builds of AOSP in ways that were not possible before, thanks to a license that allows redistribution.

-I also finally managed to distribute some factory images for the very first time. Just like for the proprietary binaries, this is the result of 3 years of work. The main benefit is obvious: play with an AOSP build for while, and then get your device back to its factory state, over and over and over. It also has some other nice advantages, e.g. it allows AOSP users to stay up-to-date with the latest bootloader and baseband firmware.

-For the first time, AOSP supports a non-Nexus non-ADP device, which also happens to be a tablet (Xoom), and supports a development board (PandaBoard). We also added support for Intel CPUs, including emulator support. Those show well that AOSP is important for companies other than Google.

-We also got some proprietary binaries submitted directly in AOSP instead of being separate downloads, e.g. the touchscreen firmware for Galaxy Nexus and the Wifi/Bluetooth firmware for PandaBoard.

-We reached the point where AOSP is running on 11 different targets (8 different devices from 4 different families, plus 3 virtualized or emulated systems).

-IceCreamSandwich was a massive release, which added over 220,000 changes over Gingerbread. As usual since Froyo, the full source history is available, so that people can easily study how the code evolved, or research when, why and by whom a given line of code was written.

-With IceCreamSandwich, we now have a fully Open-Source NFC stack and a fully Open-Source sensor processing chain. In Galaxy Nexus, we also have a wifi/bluetooth chip that can work without requiring any proprietary firmware.

-I tagged 26 device releases in 2011, compared to 12 releases in 2010.

-I fine-tuned the process that we use when releasing GPL source files, so that it’s now much easier to build the GPL source code independently from full platform releases.

-We Open-Sourced the source.android.com site itself, thanks to the work on the intern who took care of that in the beginning of the year.

-Last but not least, the AOSP team grew, and that allows us to split the workload: +Conley Owens takes care of the long-term engineering while I manage the day-to-day execution. Conley gets credit for implementing the auto-verifier that we had running on Gerrit for a while, for dealing with many build issues that appear on various environments, and also for a lot of other work that’s not visible yet but that’ll make things even better in the future. All that happens under the watchful eye of+Dan Morrill who occasionally stops by to say hi, and with a lot of help from Google’s main Open-Source team.

“Not releasing the Honeycomb source code was catastrophic for the AOSP community. I had never before received so many angry emails, so many threats, to the point where I had to take several weeks off at some point to get away from it. Even today, there’s a lot of bitterness left on all sides. From start to finish, Honeycomb probably cost AOSP anywhere from 6 to 12 months.”

What Makes Android Revolutionary

December 31, 2011 in Uncategorized

IconIt all started with Apple/TechCrunch blogger M.G. Siegler making a huge fuss over something he didn’t understand, and while that in and of itself isn’t particularly interesting, one of the outcomes of this little internet drama is a comment on Google+(the tenth one) that so perfectly encapsulates just how important Android is for the world that I felt the need to share it with you. It’s the holiday season after all.As some of you may recall, way back in the day, Steve Jobs said Google’s use of the word “open” was disingenuous, and that Google’s use of the term in relation to Android was just smokes and mirrors. While the dripping, almost gelatinous irony of Steve Jobs accusing another company of abusing a term for marketing purposes certainly wasn’t lost on me, I personallywasn’t particularly happy with the lack of a public source code release for Honeycomb either; in the end, however, it didn’t change anything about the openness of Android – technically speaking, that is. No licenses were violated, and all the source code that had to be released was properly released (all GPL code, for instance, was readily available).

Still, Andy Rubin, Google’s Android chief, felt the need to address Steve Jobs’ comments, and opened a Twitter account. His first tweet gave the definition of open – a definition as rock-solid now as it was back then. As most of us will realise, this is the sequence of commands that downloads and compiles the Android source code.

 

the definition of open: “mkdir android ; cd android ; repo init -u git://android.git.kernel.org/platform/manifest.git ; repo sync ; make”

 

A few days ago, Rubin posted a tweet about how on December 24 and 25, 3.7 million Android devices were activated. A pretty impressive number, especially since unlike, say, Apple’s numbers, this covers devices actually bought and activated by customers, but excludes devices which aren’t Android certified, like the Kindle Fire or many Chinese products running Android derivatives (Apple’s numbers, on the other hand, only cover shipped devices - not sold devices, like many erroneously believe. Apple uses “sold” rather… Disingenuously by redefining “shipped” to “sold” in its SEC filings).

In any case, Siegler noticed that Rubin’s first tweet had been deleted – conspiracy! Proof Android isn’t open! Man the trebuchets! “Where did the initial tweet go? Who knows. But it sure looks like he deleted it. Deleted it in an ‘open’ way, I’m sure,” Siegler writes, “Luckily for us all, I saved Rubin’s real first tweet from October 19, 2010.” Can you imagine if he hadn’t saved it for us all? What a relief!

There’s no conspiracy here, of course. The simple fact of the matter is that the instructions for downloading and building Android which were given in Rubin’s first tweet were outdated. After the kernel.org root server was compromised, many code repositories, including Android’s, were moved away from kernel.org. In other words, Rubin’s commands simply don’t work any more, and as such, the tweet was deleted. Again, the irony of Siegler making a fuss about this isn’t lost on me.

In case you were wondering, the new definition of open:

 

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1

 

All this is remarkably uninteresting, but there’s one upside to all this. In a comment posted on Google+ (the tenth one; how do you link to Google+ comments?), Clinton DeWitt explains the importance of open source in mobile, and the effect Android will have (and already is having) on the mobile industry in places other than the rich west. For the first time, a smartphone operating system is going to impact more than rich people in the US and Europe, and that is pretty darn revolutionary.

“I believe what Android is accomplishing is truly revolutionary. Mobile is the way that billions of people will one day access the Internet. And through that access, we will soon start to narrow the massive knowledge gap that currently divides the richest from the poorest populations,” DeWitt explains, “That there’s now an eminently capable open source mobile operating system, one that is free to use and free to fork, means that the knowledge advantage can be better and more evenly distributed across the planet than ever before.”

“For some pundits, it’s all about which companies are building the fanciest and most feature-rich handheld computers. Which, if we’re being honest about it, are devices for those that already have everything. When you’re at the top, it’s great to see the tech giants going head-to-head and competing for our dollars like this. Having a few dollars, I benefit from that, too,” he adds, “And yet in spite of that, I’m even more excited about seeing a $25 mobile device that has access to a killer web browser and endless mobile apps, and watching that device appear in the hands of a billion school children over the next 10 years.”

The iPhone is heralded as the most revolutionary mobile phone in human history, but the cold and harsh truth is that for all the cheering and punditry, the iPhone’s impact on the world is negligible. Sure, it had a huge impact on the smartphone market in rich countries – but it didn’t have such an impact on the world.

For all the bad jokes directed at the company during its trying times, Nokia is the technology company that truly changed the world. Nokia put a mobile phone within every person’s reach. Even people in some of the poorest places on earth were given the ability to communicate wirelessly, thanks to Nokia making the mobile phone affordable to everyone. Personally, I see this as one of the greatest achievements of the technology world, but sadly, it’s often overlooked because “ooh Apple has pinch-to-zoom!!!1!”

What Nokia did for the mobile phone, Android is doing for the smartphone. It’s not Apple that’s going to put a smartphone in every corner of the globe – it’s not Microsoft; heck, not even Google, but Android. In ten to fifteen years’ time, we will look back and regard Android as the technology that enabled even the poorest people in this world to have access to the web (and thus, knowledge), just like we regard Nokia as the company that put the mobile phone in every corner of the globe.

Of all the features, of all the first world problem whining, of all the lawsuits, of all the lacking updates, of all the antennagates, of all the pentile matrix nonsense, of all the large displays, of all the design patents, of all the everything - that is what makes Android revolutionary.

And that’s worth ten billion bullshit bounce-back scrolling software patents.

Android drivers to be included in Linux 3.3 kernel

December 27, 2011 in C++, Firmware, News

Android drivers are returning to the Linux kernel. Kernel maintainer Greg Kroah-Hartman has retrieved the Android drivers removed from the staging area of Linux 2.6.33 in the spring of 2010 and put them back into his development branch for version 3.3 of the Linux kernel.

The plan is for a Linux 3.3 kernel to be able to boot on an Android device without further patches – although not all Android patches are being automatically carried over to the main development branch. For example, the WakeLock code, which helps Android devices’ batteries last longer but is not necessary for booting, is not included.

Read more on h-online