Feeds:
Posts
Comments

Posts Tagged ‘Android application development’

I wrote some time ago very favorably about future of Android and Android-related job market. Unfortunately, recent events have forced me to re-consider my opinion. I mean Google’s acquisition of Motorola Mobility.

In short, I think this is a big mistake on Google’s side which is very damaging for Android in a long run and, frankly I’m no longer confident in its future. Here is why.

There were 3 main strengths that made Android a dominating force of mobile OS market:

1. Google was a partner to hardware (phone) vendors

2. Android provided cross-platform application layer. Due to this the same application binaries could run on any Android phone notwithstanding underlying hardware

3. Android is free.

Having all those 3 strengths in place Android inhibited emergence of a potential competitor. Why phone vendors would consider another OS even if it had all 3 strengths given that they already have Android?

Until now Google followed Microsoft model: they were providing OS which was used by many hardware (phone) vendors. Google and hardware vendors were partners. After Motorola acquisition they are competitors. Now hardware vendors could not be so certain about using Android. What if at some point Google creates a new version of Android and releases it through Motorola without providing access to it for other hardware vendors. What may prevent them from playing such trick? Remember, for example, that Google didn’t publish Android 3 source? Naturally, as a result of the acquisition other hardware vendors will start hedging their bets by increasing use of other OS, e.g. Windows Mobile. At least Microsoft has proven that it has no intention competing on hardware.

So, strength #1 is no longer there after Motorola Mobility acquisition.

Without it there will be many vendors willing and capable to offer a mobile OS with those 3 strengths.

For example, Microsoft. It (almost) never competes with hardware vendors as I mentioned. Given its financial resources it can easily make new versions of Windows Mobile free or almost free. And with its C# and CLI experience it is absolutely capable of building a cross-platform application layer.

Another contender could be a combination of Intel/Nokia MeeGo and Java cross-platform application layer from Oracle. And those companies have enough money to make their OS free.

Maybe Google believes that Android will be still viable due to its excellent quality? Sorry, but this is not so obvious.

Some time ago I wrote a post where I described my software architect opinion on Android. Internal quality of Android code and code design is far from perfect.

Also, Android bug backlog is growing and serious issues are not addressed for long time.

Take a look at this bug as an example. Sometimes when you send SMS using Android phone to person A it is somehow sent to person B. Pretty serious, right? You would not like this happening to you, probably, would you?

The issue was first reported in June 2010 (more than a year ago). There is 1800+ comments from people having the problem. And this is how the story ends:

Comment 1817 by ksb…@gmail.com, Jun 19, 2011

Instead of worrying about “bots” or whatever and seeming to minimize this problem, you should worry about how your ligitimate customers feel about this issue!

I just sent a text to one girlfriend that my HTC Evo shows was actually sent to her. BUT, the problem is that my girl in Mexico texted me and asked why I sent her a text in English about going to Las Vegas!! That’s completely MESSED UP guys!

I switched to this from my Iphone cause the Iphone home key wouldn’t work, but this is worse! Fix this or I’ll definitely be going back. Apple never screwed up my personal life!!!

Comment 1818 by bweb…@dslextreme.com, Jun 22, 2011

This problem happened to me at the worst of all possible times with the most sensitive of all txt msgs. Becasue of this, my marriage is now in turmoil. Screw Google! I’m going to trash my new Galaxy S and get a Windows 7 phone. I’m talking to a lawyer about being heavily compensated for damages. Never, ever, ever buy a Google phone…that’s the word that I’m going to spread.

Comment 1819 by chicmagn…@gmail.com, Jun 22, 2011

FIX THIS! I just got a Nexus S and the same thing happened to me… I am SOOOOO lucky I didn’t call the person it went to by accident names… This is an AWFUL bug!

Comment 1820 by jrobbins@google.com, Jun 23, 2011

I’m going to block further comments on this issue because it is suspected of placing excessive load on one part of our server-side software for Google Project Hosting.

Labels: Restrict-View-Commit

Comment 1821 by jrobbins@google.com, Jun 28, 2011

Corrected permissions to just block additional comments because of server load.

Instead of fixing the issue Google folks just decided to block users complaining since their complains overload Android bug tracking system.

[Update Aug 24, 2011] It seems that closing channels for feedback about Android problems becomes Google policy.

Overall, Android OS shows all signs of underfunded technology project. Apparently Google just don’t allocate enough money to hire enough properly qualified developers to deliver code of proper quality and to fix the known bugs. Otherwise I can’t explain the issues I am observing.

And having this Google decided to spend $12B on buying Motorola instead of investing enough in Android OS. Nice move, Mr Page 🙂

Conclusion

By entering hardware production Google Android moves from partnership with phone vendors to competition with them.

In  seems Google adopts Apple business model. It is worth reminding that very few companies were successful in a long run trying to produce both hardware and software. Apple is rather an exception and it takes Steve Jobs genius to pull this through (I have big doubts that Apple will be as successful as it is now without Steve).

Overall, I think this Google move will cause re-structuring of mobile OS market and change the trends we had observed until now. Hardware vendors will start looking for alternatives to Android. There may be several options:

  • Broader adoption of Windows Mobile
  • Forking of Android source so that to create another OS based on Android but evolving independently (something like CentOS guys did with RedHat code)
  • Support for some alternative mobile OS like MeeGo modified to become cross-platform one like Android

In short, mobile market enters a period of uncertainty and if you plan to build you career on Android, watch very attentively what is going on mobile market.

[Update from Sep 20, 2011. Things started evolving exactly as I predicted in this post. Look here for an example]

 

Advertisements

Read Full Post »

There is a lot of questions on various forums on how to install a CA certificate on Android device. Some suggest using RealmB web site. While I trust that RealmB authors have had the best intent to help others, I think publishing a security certificate you use to connect to your corporate network on the web is as wise as giving keys to your house to absolute strangers and I personally would not use the tool.

Android 2.2 I have installed on my Motorola Atrix has both Certificate Installer and Certificate Manager.

To find them go Settings-> Location & security, scroll down ->Credential storage-> Install from internal phone storage. You will see a dialog offering you to complete the action using either Certificate Installer or Certificate Manager.

But both are rather enigmatic tools without any documentation and it took me some time to find how one actually can use Certificate Installer (this one is a part of Android; I guess Certificate Manager is Motorola’s product). This is the beauty of Open Source Software (at least for developers) – one can read a code and figure out how “the damn thing works” 🙂

First of all by default Certificate Installer looks for certificates to install at folder called download in SD card. It considers as certificates files with extensions either .crt or .p12. The latter stands for certificates in PKCS #12 format and the former stands for certificates in Base64 Encoded X.509 format. You should be aware that there are other certificate formats as well, e.g. PKCS #7, but it seems that Certificate Installer can’t handle them. If you are interested to find more about certificate file formats, read this.

[Added on April 20, 2012. Vlad (another Vlad, not I) commented below: “…the certificate should be copied to an internal folder (not external). For some devices, the installer cannot find a certificate on the external SD card.”]

So the first way to use Certificate Installer is obvious:

  • Extract SD card from your phone, insert it into your computer
  • Create download folder in its root folder and put there the certificate file or files you want to install; of course make sure that they are in acceptable format and have proper file extensions
  • Insert SD card in your phone and run Certificate Installer as described above

Well, obvious but not co convenient… First of all extracting and inserting SD card is not so simple on certain devices. Also there are devices without SD card. So what to do if you don’t want  or can not use this way? Then you can use the second method:

  • Connect your device to your computer via USB cable. Make whatever you usually do so that the device appears as an external drive in the computer filesystem. If you never connected your Android device to your computer as USB drive and you use Windows computer, the most likely you will need to install a proper USB driver on your computer. Such USB drivers for Android devices are manufacturer-specific and can be found on manufacturers web sites (see the list here). For Ubuntu Linux you will need to add some configuration parameters; no USB driver installation is required. See details here.
  • Copy your certificate file(s) to the device internal storage. Again, make sure that the files have proper format and proper file extensions
  • Open Files application and select (touch) the certificate file. A dialog will appear with details on the certificate and two buttons: Install certificate and Cancel. Click Install certificate. That’s all

Read Full Post »

GUI tool to work with SQLite

There is a number of GUI tools for SQLite available for Linux and Windows. We’ll be using Sqliteman. It is free, available for Linux, Windows, Mac OS X and various versions of Unix. This makes instructions we are going to provide applicable to all those OS.

To install it on Ubuntu 10.10 Linux use the command:

sudo apt-get install sqliteman

Installation instructions and Sqliteman installer for Windows could be found here as well as instructions and distributives for other OSs.

Let’s try to explore an existing database from Contacts application using Sqliteman.

Sqliteman can not access files inside Android AVD or Android device. To make use of Sqliteman we have to copy the database file we want to work with from  Android filesystem to your PC local filesystem. This can be done with adb tool. If you want to work with files inside Android filesystem, use SQLite command line shell described here.

Contacts application uses a database which is stored within contacts2.db file. It is located in /data/data/com.android.providers.contacts/databases/ directory of Android device or AVD. Type this command (I assume you have running AVD or a device attached to your computer):

adb pull /data/data/com.android.providers.contacts/databases/contacts2.db ~/android

Here ~/android is a directory where we want to copy the database file.

If everything is OK, you’ll see something like this:

590 KB/s (109568 bytes in 0.181s)
vlad@vlad-laptop:~/mydroid$

This confirms that the file was copied successfully.

Now let’s start Sqliteman. If you use Ubuntu Linux as I do, go to Applications -> Programming -> Sqliteman. This will launch Sqliteman:

Now we have to open the DB file. Go to File -> Open and select the file you downloaded from Android AVD or device. You will see something like this:

Let’s explore the database. Click on Tables in the left pane. This will show you the list of tables in the database. Click on data table; this will show you a description of the table:

You can drill down to find more details… But for the purpose of the post let’s try to run an SQL statement. Type

select * from data

in the top right pane, then click on a green triangle above it. This will display the content of the table data in the pane below the one where you typed the SQL statement:

After we finished your work with the database using Sqliteman, we can copy the database file to the device or AVD. For this we should use adb push command. In our case this will be:

adb push ~/android/contacts2.db /data/data/com.android.providers.contacts/databases/contacts2.db

That’s all for now.

Read Full Post »

Today we are going to look at how to work with Android application database

Android OS 2.X uses SQLite relational database for storing data. SQLite website states:

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.

Basically, there are two main ways to explore or to change Android SQLite database:

  • We can use SQLite command line client to access files containing SQLite database tables inside Android device (a phone, a tab) or inside Android emulator
  • Alternatively we can copy the files from the device or emulator to our workstation, work with them there using a handy GUI tools and copy them back to the device or emulator after we done

Both methods have advantages and disadvantages, therefor we need to get familiar with both.

I assume you have already installed Android development environment. If not, instructions for Windows are here, for Linux they are here.

The instructions below work for both Windows and Linux.

Command-line interface

Android provides command line shell access to its SQLite databases through a standard SQLite command line shell. You can find a good manual on it here. Just keep in mind, that Android OS 2.3 contains SQLite version 3.6.22 while the documentation has been written for a slightly earlier version (3.6.11) which accounts for small discrepancies. Otherwise Android team implemented a complete command line access to SQLite databases (unlike they did with ash shell; Android provides a reduced set of ash shell commands).

We can start SQLite command line shell while running adb. adb stands for Android Debug Bridge, a tool similar to SSH or telnet which allows accessing either AVD (Android Virtual Device, essentially Android emulator) or a real Android device connected to our computer.

I highly recommend experimenting with AVDs instead of real devices until you feel confident with what you are doing.

So let’s start AVD. Type:

emulator @TestAVD

Here TestAVD is a name of AVD we are going to work with (of course, your AVD may have a different name).

If you get a message saying that emulator not found, you may have forgotten to add tools and platform-tools directories of Android SDK to your system PATH. If all goes fine, we’ll see Android emulator GUI in a few seconds. Give it a time to start Android OS; it may take up to a minute or so.

Now we have to open another command line console window. Type there:

 adb devices

This command should give us a list of all AVDs or Android devices running. You’ll see something like this:

vlad@vlad-laptop:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
emulator-5554	offline

Please note, it says that emulator-5554 is offline. The most likely it is since the AVD went to a sleeping mode after it started:

Click on Menu button on AVD to “wake” it up. Type:

adb shell

This will launch Android ash shell and you will see Android shell prompt (#). Note, this will not work if you have several AVD or devices running; in that case you need to type

adb -s emulator-5554 shell

explicitly describing what AVD or device you want to connect to. Anyway, after we got the shell prompt (#), we can start SQLite shell. Type:

sqlite3

Now you should see SQLite shell prompt:

sqlite>

SQLite command line shell accepts SQL statements and so-called “dot” commands, i.e. commands starting from a dot. Those commands unlike SQL are SQLite-specific.

To see the list of “dot” commands type .help (note the period) after you get SQLite shell prompt (sqlite>):

# sqlite3
sqlite3
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .help
.help
.backup ?DB? FILE      Backup DB (default "main") to FILE
.bail ON|OFF           Stop after hitting an error.  Default OFF
.databases             List names and files of attached databases
.dump ?TABLE? ...      Dump the database in an SQL text format
If TABLE specified, only dump tables matching
LIKE pattern TABLE.
.echo ON|OFF           Turn command echo on or off
.exit                  Exit this program
.explain ?ON|OFF?      Turn output mode suitable for EXPLAIN on or off.
With no args, it turns EXPLAIN on.
.genfkey ?OPTIONS?     Options are:
--no-drop: Do not drop old fkey triggers.
--ignore-errors: Ignore tables with fkey errors
--exec: Execute generated SQL immediately
See file tool/genfkey.README in the source
distribution for further information.
.header(s) ON|OFF      Turn display of headers on or off
.help                  Show this message
.import FILE TABLE     Import data from FILE into TABLE
.indices ?TABLE?       Show names of all indices
If TABLE specified, only show indices for tables
matching LIKE pattern TABLE.
.load FILE ?ENTRY?     Load an extension library
.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout
.mode MODE ?TABLE?     Set output mode where MODE is one of:
csv      Comma-separated values
column   Left-aligned columns.  (See .width)
html     HTML <table> code
insert   SQL insert statements for TABLE
line     One value per line
list     Values delimited by .separator string
tabs     Tab-separated values
tcl      TCL list elements
.nullvalue STRING      Print STRING in place of NULL values
.output FILENAME       Send output to FILENAME
.output stdout         Send output to the screen
.prompt MAIN CONTINUE  Replace the standard prompts
.quit                  Exit this program
.read FILENAME         Execute SQL in FILENAME
.restore ?DB? FILE     Restore content of DB (default "main") from FILE
.schema ?TABLE?        Show the CREATE statements
If TABLE specified, only show tables matching
LIKE pattern TABLE.
.separator STRING      Change separator used by output mode and .import
.show                  Show the current values for various settings
.tables ?TABLE?        List names of tables
If TABLE specified, only list tables matching
LIKE pattern TABLE.
.timeout MS            Try opening locked tables for MS milliseconds
.width NUM1 NUM2 ...   Set column widths for "column" mode
.timer ON|OFF          Turn the CPU timer measurement on or off
sqlite>

To exit from SQLite shell type .exit (note the dot) or Ctrl-D. To interrupt a long running SQL statement type Ctrl-C.

Until now SQLite shell hasn’t been connected to any database. To make the shell connected to a particular DB, launch it with DB file as a parameter (SQLite contains the whole DB in one single file which is very handy). But where to find those files?

Each time a new package is installed in Android OS, the OS creates a sort of “home directory” for it. All those “home directories” are located in /data/data directory of the device or AVD. The names of the directories correspond to names of the packages. All package data including its DB or DBs is stored within the directories.

Type following while you are in Android command line shell (not SQLite command line shell! You should see # as a prompt):

ls -l /data/data

You will see something like this:

drwxr-x--x app_0    app_0             2011-01-04 15:36 com.android.sdksetup
drwxr-x--x app_2    app_2             2011-01-04 15:36 com.android.calculator2
drwxr-x--x app_4    app_4             2011-01-04 15:36 com.android.packageinstaller
drwxr-x--x app_6    app_6             2011-01-04 15:36 com.android.development
...........
#

Those are package “home directories”. You can either dig down into those directories to find database files (they have .db extension), or you can use this command which will list all database files:

cd /data/data
ls -R

This will show you all directories and files in /data/data directory (unfortunately Android command line shell does not support find command). You’ll see something like this:

.............
./com.android.providers.userdictionary:
lib
databases

./com.android.providers.userdictionary/lib:

./com.android.providers.userdictionary/databases:
user_dict.db
............

Let’s try to see what is inside EmailProvider.db database:

# sqlite3 /data/data/com.android.email/databases/EmailProvider.db
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
Account           HostAuth          Message           Message_Updates
Attachment        Mailbox           Message_Deletes   android_metadata
sqlite> select * from Account;
sqlite>

This shows that EmailProvider.db contains a number of tables: Account, HostAuth etc. Output of SQL statement  select * from Account shows that table Account is empty.

We are not going to discuss here all capabilities of SQLite command line shell. If you are interested, take a look here.

While it is cool to be able to access SQLite database on a real Android device with so powerful tool, I think the use of SQLite command shell in this case is limited to debugging and research purposes. Indeed, I would not design a database inside a live device. Designing a database makes sense as a part of an overall application development which in Android case is done on a computer running Eclipse IDE and Android SDK. We’ll discuss tools more suitable for SQLite development in one of the next posts. There are such tools. They provide a handy GUI.

Read Full Post »

In previous post we were looking at various command-line tools that come up with Android SDK (android, emulator, adb). We mentioned that abd shell command provides a shell access to Android device. Let’s explore this further.

But before we start on this, let’s talk a bit about what Android OS is.

A good short history of Android OS can be found here. If you read the article, you’ll find that Android OS is actually modified stripped down Linux + certain additional native libraries + Dalvik JVM which runs “customer facing” applications written in Java. Just a bit more facts:

  1. Android OS 1.6, 2.0. 2.1 are based on Linux Kernel 2.6.29
  2. Android OS 2.2 is based on Linux Kernel 2.6.32
  3. Android OS 2.3 is based on Linux 2.6.35

Which means Ubuntu Linux 10.4 Natty Narwhal and running on my laptop and Android 2.3 are sort of  sisters 🙂 since they share the same Linux Kernel 2.6.35. Interesting…

The shell used by Android is actually Unix ash shell. It is somewhat stripped down, so such commands like grep are not available, but it still has around 100 commands which is very impressive. You can check what commands are available:

adb shell ls /system/bin

More on adb and shell commands can be found here.

You can look at certain examples of shell usage here. Don’t try them on a real device unless you fully understand what you are doing!

It is no surprise that certain developers started porting Linux applications to Android. For example look here for how to add bash shell to Android OS.

I will be not surprised to find ports of bigger Linux applications to Android. For example, Gnome is already allegedly running on Android. But why to be surprised…. Android devices have more CPU power and pixels on screens that best PCs had 10-15 years ago, right?

Read Full Post »

Let’s examine what is available in tools and platform-tools directories of your Android SDK. I will be using Linux machine for this blog, but adjustements for Win environment are minor ones and rather obvious.

Before you start, make sure that both directories have been added to your computer PATH.

There is a number of scripts and executables in this directory (there are directories, too, but we are not looking at them now).

Today we’ll examine a script named android. If you launch it with –help option (android –help), you will see something like this:

android script provided us with a list of options and so-called “verbs” it understands. Verbs actually mean certain actions that can be performed by the script. Those actions fall into 3 groups:

  1. AVD (Android Virtual Device) management (create, move, delete AVD etc)
  2. Android project management (create, update an Android project)
  3. ADB (Android Debug Bridge) and Android SDK update

Basically, these are functions of SDK Manager and android is the main script which launches SDK Manager. You can easily verify this by executing the script without parameters: in such case it will launch SDK Manager GUI which we already have seen while installing Android development environment.

You can use android script for all those functions, but, frankly, SDK Manager GUI is handier, so I would not use the script in command-line mode unless I want to write certain automation scripts that require its functions.

Next tool which we are going to look at is emulator executable. This is actually an interpreter which runs AVDs. This executable is used by Eclipse IDE under the cover to launch Android device emulator. But you can launch it from command line as well. If you followed me in installing Android development environment, you already should have had at least one AVD available. You can verify this by using android script. Type this in your command shell:

android list avd

This will list you all AVD you have on your computer with certain details on them. If you have AVD indeed, you can launch emulator to execute the AVD.  If you don’t, launch SDK Manager by executing android script without any parameters. This will provide you with SDK Manager GUI and there is a tab for creating AVDs. Create AVD and proceed.

There are two equal ways of launching emulator to run AVD. Type in your command shell:

emulator -avd NameOfYourAVD

or this:

emulator @NameOfYourAVD

Of course, use a name of your existing AVD instead of NameOfYourAVD. Both commands will launch the AVD and you’ll see the emulator GUI:

Next we are going to look at adb command-line tool. adb stands for Android Debug Bridge. This is an executable which allows other applications to connect to either Android emulator or a real device if such is connected to your computer.

While the emulator is still running, type this in the command-line shell:

adb devices

You will see something like this as adb output (it may take several seconds to start adb, so be patient):

List of devices attached
emulator-5554    offline

This output shows that adb is aware of emulator instances running and their state. If there is no emulator/device running, adb returns no device.

Unlike android script, adb has a lot of functions. You can see a list of them if you type

adb help

If you just want to do a basic development, you probably don’t need to know much about adb; it will be operating “behind the scene” for you. However, if you consider yourself as an advanced developer, you may want to learn more about adb here.

To give you examples, here are just some of adb functions:

  1. Copy Android application (apk file) to an emulator or a device and install it there (install command)
  2. Copy arbitrary files to and from an emulator or a device (push and pull commands)

What I personally like most among adb functions, is a real Unix/Linux shell. Type this:

adb shell

and adb will present you with a shell prompt (# in my case). To make sure it is the shell indeed, type ls (Unix/Linux analog of dir command on Windows) and you will see filesystems mounted on your running AVD:

We’ll talk about shell access to Android devices in the next blog post.

Read Full Post »

To develop something one has to install a development environment which includes various tools, libraries, IDEs etc. Android is not an exception. I have already posted instruction on how to do this on Windows XP. This time I’m going to describe instructions for Ubuntu Linux. They should be applicable to or at least applicable for other Debian-derived Linux distros. These instructions are for those who wants to develop their own Android applications. If you want to build Android OS itself or explore its sources, you have to follow another process which I plan to document as well. I decided to document the installation process since I found instructions provided by Google here not very convenient. Also, at least in some places are somewhat outdated. For example, this page says:

The Ubuntu package manager does not currently offer an Eclipse 3.3 version for download,   so we recommend that you download Eclipse from eclipse.org

The latest version of Eclipse IDE is 3.6.1, version 3.3 has been released in June 2007, so one can guess that the page hasn’t been updated for several years. There are other places in Android docs that suggest the same conclusions. Please note, I’m using Ubuntu 10.10 64-bit (the latest and greatest one at the moment when I write this). If you use another version of Ubuntu, you may need to deviate from the instruction as it may be needed. Hopefully, this my post will save time to somebody interested in Android development. The instructions assume that you install the development environment from fresh, i.e. none of the necessary components is present on your computer. The whole installation process may require several hours (taking into account download times for various components) and it requires following steps:

  1. Checking system requirements to make sure that your computer is suitable for Android development at all
  2. Installing support for 32-bit applications if you are using 64-bit Ubuntu as I do
  3. Installing Java
  4. Installing Eclipse IDE
  5. Installing Android SDK
  6. Installing ADT plugin
  7. Configuring ADT plugin
  8. Adding necessary folders to PATH
  9. Building and testing your first Android application

1. Checking system requirements

You can check the system requirements here. This page seems to be up to date.

2. Installing support for 32-bit applications

if you are using 64-bit Ubuntu as I do, Google documentations  claim you’ll need to install support for 32-bit applications. You can do it in two ways: through command line interface of GUI. For command line method use this command in a terminal console window:

sudo  apt-get install ia32-libs

For GUI way you can use Synaptic Package Manager. Go to System -> Administration -> Synaptic Package Manager. The Manager will ask for your password, enter it. Search for the package (ia32-libs), mark a checkbox at the beginning of the line and click Apply in Mahager’s menu. That’s all.

2. Installing Java

You will need Java 1.5 or 1.6 and not only JRE (Java Runtime Environment), but JDK (Java Development Kit).  Again. you can do it using command line or Synaptic Package Manager. Here is the command to use in a terminal console window:

sudo  apt-get install sun-java6-jdk

3. Installing Eclipse IDE

Eclipse IDE can be installed in two ways. You can use Synaptic Package Manager or do it manually. However Synaptic Package Manager can istall Eclipse IDE 2.5.2 which is appropriate, but not the latest and greatest (3.6.1 at the moment).  So let’s install it manually. Eclipse IDE can be downloaded from here. Please note, this link points to 64-bit distro. If you use 32-bit Linux, you need to choose a proper distro. There are many flavors of it, you will need Eclipse IDE for Java Developers. This will give you the latest 3.6.1 version. If you have already earlier versions (3.5 or 3.4) and want to use them for Android development, you can do it. There is no difference between 3.6 and 3.5 as far as the installation is concerned. There is slight difference between 3.4 and 3.6 though (more about this later). Eclipse IDE comes as tar.zip file (eclipse-java-helios-SR1-linux-gtk-x86_64.tar.gz), so no installation as such is required. You just uncompress it into a folder you choose (I normally use for all my Eclipse installations ~/bin directory, where ~ stands for your home directory; but you can use whatever you want). Uncompressing the file will create another directory, which in my case will be ~/bin/eclipse. Since I use several versions of eclipse, I normally rename the latter eclipse directory to something which reflects a version of eclipse it contains, e.g. ~/bin/e361. However, of course, it is up to you where to place Eclipse on your computer. To make sure it works, you can launch the IDE. For this purpose you have to launch eclipse executable from the root directory of the uncompressed archive (which will be ~/bin/e361/eclipse in my case). You will see this dialog Workspace Launcher dialog. Select a directory for Eclipse workspace, click OK. After this you will see Eclipse IDE launched: This means your Eclipse IDE has been successfully installed. It is optional, but you may want to create a launcher for Eclipse executable. This is just for your convenience, though.

4. Installing Android SDK

This is the step which caused me the most trouble. Hopefully with my instructions it will be much simpler for you. First you need to download Android SDK from here. You need to download Linux distro: android-sdk_r08-linux_86.tgz. The current version of SDK is 8.0. The installer you have downloaded actually contains only SDK Manager which is a tool to download and to manage SDK. So the installation is two step: first you install SDK manager from the downloaded archive and later the SDK Manager downloads and installs all other parts of SDK. Uncompress the archive to e.g. ~/tools. You need to add tools and platform-tools directories in SDK folder to Linux PATH. For this add to your .bashrc file following line:

export PATH=$PATH:~/android-sdk-linux_86/tools:~/android-sdk-linux_86/platform-tools

Then launch /tools/android-sdk-linux_86/tools/android script. In a second you’ll see the dialog:

From this point on you can follow instructions I have posted for Windows. Just adjust file system paths accordingly. There is no c: drive on Linux, right?

Read Full Post »

Older Posts »