Local software repository for apt-get

Leave a comment

We use to apt-get the packages to install in Debian derivative of Linux. The packages are mostly downloaded from internet based repositories and locally cached at /var/cache/apt/archives directory. In case we reinstall the Linux, we need to download the packages once again to install through apt-get or synaptic GUI tool. To avoid this situation we can backup the *.deb files available in /var/cache/apt/archives path in some other partition than root. After re-installation, we can create a local repository of these packages to avoid downloading again. Another advantage is that this repository can be shared with other computers too.

  • Identify the backup partition and directory for downloaded *.deb files (e.g.: /home/<username>/packages).
  • $ mkdir -p /home/<username>/packages/archives/dists/main/myrepo/binary-i386
  • $ cp /var/cache/apt/archives/*.deb /home/<username>/packages/archives/dists/main/myrepo/
  • $ cd /home/<username>/packages/archives
  • $ apt-ftparchive packages . > ./dists/main/myrepo/binary-i386/Packages
  • $ cd ./dists/main/myrepo/binary-i386/
  • $ gzip Packages
  • Re-install the Linux distribution.
  • Add the following entry in /etc/apt/sources.list file.
  • deb file:/home/<username>/packages/archives main myrepo
  • $ sudo apt-get update

That is it. Now you have all your last downloaded files as local repository. Use apt-get or synaptic to go ahead! Enjoy the beauty of apt-get from Debian.


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

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.

Qualcomm Demonstrates HEVC / H.265 Video Codec on Android Tablet

Leave a comment

At the Mobile World Congress 2012 show in Barcelona, Qualcomm, demonstrated a preliminary version of H.265 or HEVC, video on an Android tablet powered by Qualcomm Snapdragon, a current-generation S4 dual-core the processor running at 1.5GHz.

H.264 is today’s leader when it comes to mainstream video encoding technologies, but it will have to share the stage in 2013 with a successor called H.265 that can squeeze a video into nearly half the file size. H.264, also known as the Advanced Video Codec (AVC), defines how a video can be compressed for reduced storage requirements and – very importantly given the online video explosion – for streaming across networks. H.265, also called High Efficiency Video Codec (HEVC) , the uses new techniques to compress video even more.

The H.265 codec is likely to gain widespread support, but it and H.264 competes with a royalty-free alternative called VP8 that Google has released. Qualcomm competitor Nvidia has built VP8 decoding support into its newer Tegra 3 chips alongside H.264 support.

Qualcomm is bullish about the codec. If a given network capacity can sustain higher-quality video, that means mobile devices are better for entertainment. And because H.265 ‘s efficiencies come at the cost of a significantly higher need for processing power, mobile device makers have a new reason to buy the latest chips.

Qualcomm showed a software based encoded demo video, showing race cars peeling around a track, played at a bit rate of 610 kilobits per second on H.265 compared to 1,183 Kbps for H.264. The size of the video file itself was 3.10MB for H.265 vs 6.01MB for H.264. Each video had 800×480-pixel resolution. Qualcomm will build H.265 encoding into its chips, though it is not promised when or in which processor model.

Source CNET report

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.


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.

Older Entries