Android NDK C++ Exceptions and RTTI Link Errors

Leave a comment

Android NDK C++ Exceptions and RTTI Link Errors

When using Android NDK to build performance-critical portions of Android apps in native C++ code, we may get C++ link errors such as:
undefined reference to `__cxa_end_cleanup’;
undefined reference to `__gxx_personality_v0′;
undefined reference to `vtable for __cxxabiv1::__si_class_type_info’;
undefined reference to `vtable for __cxxabiv1::__class_type_info’.
The first two errors are caused by no exceptions support in Android NDK toolchain, and the last two errors are caused by no RTTI support in the toolchain, according to the latest Android NDK release note STANDALONE-TOOLCHAIN.html under the docs directory. The documentation also mentioned any C++ STL (either STLport or the GNU libstdc++) with it are also not supported.

To get around the above linking errors, add compile flags
-fno-exceptions to disable exceptions
-fno-rtti to turn off RTTI

Advertisements

Google Voice Enhancement for ICS Phones

Leave a comment

Google has added a nice little update to its Google Voice app. The app will now feature your Google Voice messages next to your regular phone voicemail in the native phone app rather than having to logon to the Google Voice app.

This provides a deeper integration of Google Voice in your Android smartphone, similar to those found in certain Sprint Android handsets. This update provides a one interface for handling all your Google Voice messages as well as your regular phone number voicemail.

Google said:

Your voicemails will appear alongside your outgoing, incoming, and missed calls in your phone’s call log and you can just simply touch them to play them. You can slow down the playback of the message which is great for when someone is telling you their callback number, or you even speed playback up, so you can quickly listen to longer messages.

You can get this enhancement by Going to the Google Play Store and updating your Google Voice app. Please keep in mind that this update is only available for users of Android 4.0 Ice Cream Sandwich.

Barometers in Android Smartphone

1 Comment

Before we go into details of how a barometer in a Smartphone can be useful to the consumer, let us first understand what a barometer is. Typically it is said to be an instrument that evaluates atmospheric pressure. The reading thus got can be utilized to predict interim weather changes and also to get a fair idea of altitude.

The primary purpose of the barometer is (at least, I’ve been told) to make GPS lockons faster. Locking on to a GPS involves numerically solving a 4-dimensional set of linear equations — 3 dimensions in space, and time. (Yes, you get accurate time for free if you lock on to GPS.) Because of the way GPS works, this can take a few minutes. This goes much faster if you already have an estimate of your location. This is why “aGPS” (assisted GPS) services are so popular: by starting with a rough city-level coordinate fix through something like cell-tower network location, you can reduce the amount of math you have to do to lock on. This is where the barometer comes in. The 3 dimensions in space are latitude, longitude… and altitude. The barometer gives you a reasonable first-cut estimate for altitude. This gives you a bit of a leg up on one of the dimensions — especially combined with “2D” aGPS — which can help speed up lock-on in general. Now of course, the barometer can also be used for things like, well, determining atmospheric pressure (although I’m not sure it’s really weather grade.) But the main reason it’s in your phone is to help with GPS.

Building the JNI Source Code for Android in Eclipse

Leave a comment

When we develop a Android project includes the JNI technique, we should use the Android NDK tool for building these source code. But, the NDK is a command line tool that not convenient to use when we develop in the IDE.

In this article, I shows an example to explain the steps to build JNI source code in Eclipse.

The key is you have to create a new Builder used to execute the NDK tool for building JNI source code. So, at first, you have to create a new Builder in the Eclipse.

In my example, I try to add a new NDK Builder for OpenCV project in the Eclipse.

Step 1: Enter to the Project’s property window, and then click the “New” button to create a new Builder.

More

Using NDK to Call C code from Android Apps

Leave a comment

Android NDK (Native Development Kit) allows working with native C code using a shared C library. It includes the entire toolchain needed to build for your target platform (ARM). Native C code accessible via JNI still runs inside the Dalvik VM, and as such is subject to the same life-cycle rules that any Android application lives by. The advantage of writing parts of your app code in native language is presumably speed in certain cases.

Android top mobile OS, Apple top maker in U.S.

Leave a comment

June data from Nielsen shows Google Inc. ’s Android operating system has the biggest share of the U.S. market.

The following table shows the market share of smartphone operating systems:

Android

iOS

RIM

Windows

Others

39%

28%

20%

9%

4%

Among Android phones, vendor’s market shares are shown as

HTC

Motorola

Samsung

Others

Android Total

14%

11%

8%

6%

39%

Regarding to smartphone manufacturers, Apple Inc. is the clear leader among smartphone makers, and HTC is tied with Blackberrys for No. 2 maker in the U.S.
According to Gartner, 452 million smartphones were sold in 2010, up 72% from the year before. And that growth accelerated in the first quarter of this year to 85%.