Thursday, October 28, 2010

Developers can feel the shift in momentum

Developers can feel the shift in momentum. “I used to tell people I wrote software for Android, and they’d look at me like I had three heads,” said Michael Novak, who handles Android development at Medialets, a mobile advertising software company, and helps organize the monthly New York Android Software Developers Meetup. “That wasn’t even a year ago. Now everyone knows what it is. The popularity has exploded.”

Read more ...
You Can't Appreciate How Completely Apple Has Humiliated The Cellphone Industry Until You See These Charts

Friday, October 1, 2010

Android Market expands ..


We're writing to inform you about some changes to Android Market that require your attention.

Effective today, developers from 20 additional countries (Argentina, Australia, Belgium, Brazil, Canada, Denmark, Finland, Hong Kong, Ireland, Israel, Mexico, New Zealand, Norway, Portugal, Russia, Singapore, South Korea, Sweden, Switzerland and Taiwan) can now sell paid apps on Android Market. Over the next 2 weeks, users from 18 new countries (Argentina, Brazil, Belgium, Czech Republic, Denmark, Finland, Hong Kong, India, Ireland, Israel, Mexico, Norway, Poland, Portugal, Russia, Singapore, Sweden, and Taiwan) will be able to purchase paid apps from Android Market.

Please see the related post at Android Developer Blog here:

We encourage you to visit the Android Market developer console at to make the necessary adjustments.

Thanks, and we look forward to continue working with you on Android Market.

The Android Market Team

Google, Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043

Monday, August 23, 2010

Making Buttons Click!!!

Here is the basic approach:
1. First create a reference to a button in the view xml file (main.xml),
using a <button> tag, e.g., <Button android:id:"@+id/plus" .. />
2. Then use findViewbyId to obtain the id from the xml file (in the id attribute) to the program, e.g.
Button bPlus=(Button)findViewById(
3. Next set the Button class OnClickListener. If you have set your Activity to implement the OnClickListener interface, then you set it to itself (this). E.g.
4. To implement the listener, you put a switch to select the id of the button clicked, e.g.
public void onClick(View v){
switch (v.getID()){
       //do something

Monday, July 12, 2010

Android App Inventor by Google

Google has released a visual application designer called App Inventor for developing Android-based apps that require no programming. The App Inventor is based on Java OpenBlocks, a graphical programming system, developed in MIT. OpenBlocks, itself is closedly related to StarLogo, StarLogo TNG, and Scratch. The project leader is Harold Abelson of MIT, who is also the author of "Structure and Interpretation of Computer Programs" with Gerald Sussman.

The App Inventor is web-based and connects to the Android device via USB port. The application appears live on the device as changes are being made on App Inventor.

More at the  App Inventor Website.

Wednesday, July 7, 2010

Hands on: ePad images (2)

(1) Image capture showing the memory available, onboard has 256M. (2) Shell command showing the cpu info. The CPU for the unit is ARM 926EJ-S which is a 32-bit RISC chip. The J denotes Jazelle for Java acceleration (direct execution of Java bytecode), E for DSP extensions. The ARM9 series is used in alot of consumer devices. (3) Shell command showing the mounted disk, it has 1Gb of memory. It has an micro-sd card extension that enables 2-32 Gb micro cards.

Hands on: ePad images (1)

The image below shows the 7" ePad boot up screen loading the Android OS. After
booting up, it will show the desktop (2nd image). The 3rd image shows the screen capture of the same desktop. 4th image shows the other menu page.

Sunday, May 9, 2010

Samsung Behold II Man

Become a superhero with your Samsung Android Behold II!!

Wednesday, May 5, 2010

Creating Interfaces in XML

To save time and trouble, use the online program or download it. It is an open source program. With it you can drag and drop widgets.

The code generated:
<?xml version="1.0" encoding="utf-8"?>
android:text="Press Me"
android:text="My First View"

HOTT MD700 Tablet

  • 7'' TFT, 800*480 pixel hi-definition Touch screen
  • HDMI(1080P) Output
  • WIFI, USB(OTG), SD card slot
  • E-book function
  • WIN CE SYSTEM (future Android!!)
  • Video format:AVI,RM/RMVB,FLV,DAT,VOB,
        WMV, MPG, MPEG-1, MPEG-11, MP4, MKV
  • Audio format:  MP3, WMA, AAC, FLAC, WAV, OGG, APE
  • Image Format: BMP,JPEG,PNG,GIF
Cost: around 160USD

Source: HOTT

Shenzhen,China Factory
ADD: Block6,Zone3,XinXing Industrial Park, XinHe Village,FuHai Avenue,FuYong Town, BaoAn District, ShenZhen ,China.
Postal Code:518103
TEL: +86-755-83123812      EXT:8088; 8802    
FAX:  +86-755-8312489

Great Wall GPad and GBook

Great Wall (Beijing) announced the released of the 7in GPAD and 10in GBOOK on 28 April 2010. However despite its name, it actually runs Windows CE!!

GPAD Specs (top left):
  • CPU: Telechips 8901 720MHZ ARM 11
  • 256MB DDR2 RAM
  • 4Gb flash, expandable
  • 1-32 Micro SD slot, 1400 mA Li-polymer battery, 1080 HDMI interface, GPS, Wifi, external 3G module

GBOOK specs (bottom left):
  • CPU Core 2 Duo U230,CS35 Chipset
  • 2G DDR RAM
  • Intel GMA45000MHD integrated graphics
  • 2.5 HDD
  • 10/100M LAN, Wifi, Bluetooth


Content Providers and SQLite

The content provider abstraction allows you to retrieve data using REST-like syntax. For example, to retrieve  book 69 from the book database, create a URI like:


Content-provider abstraction is required only if you want to share data (files, SQL data, etc) externally or between applications.  

SQLite is built into the Android runtime, so Android applications  can use SQLite databases.

If you  are using the SQLite database only internally, you need  a class that extends SQLiteOpenHelper, then create an instance and ask it to getReadableDatabase() or getWriteableDatabase().  

      db=(new myDBClass(this)).getWritableDatabase();

Use db.execSQL(...) to execute SQL statements such as insert, update and delete that does not return values, or db.insert(), db.delete(), db.update() can be used.  The syntax is not JDBC but uses a simpler API.

Use db.rawQuery(..) if the select query is fixed, otherwise db.query(..), which returns a cursor. Another way is to use SQLiteQueryBuilder interface to encapsulate the call details.

Manually accessing SQLite databases on Android

Start the Android emulator or connect a device.
To see available devices, run: tools\android list avd
If emulator not started, using the name fround above, run: tools\emulator [avdname]
To see if devices connected run: tools/adb.exe devices
Open the adb shell: tools\adb.exe shell
Once the shell is started you have access to a Linux ash shell, with a limited commands. At the shell type, to show the list of files: ls -l
The of databases are in /data/data directory, execute: ls -R /data/data/*/databases
SQLite can be invoked: sqlite3 [database_name]
To quit SQLite, type: .exit
To copy the database to desktop PC, use : adb pull [database_name] [local path name]
Use adb push [local] [remote] to copy back the file

Tuesday, May 4, 2010

More on Android resources ...

Instead of specifying actual values as a resource (e.g. string, colour, etc), it can be referred by an indirection reference string. This is useful, e.g in internationalization, etc.

The format for specifying references resources in the XML file is:

If you are using the Android default package then [package:] can be omitted.

The '@' is for specifying references to the resource, i.e. get the actual value by looking it up as specified by the type and name,e.g.:


The actual value for opaque_red would have been specified in res/values/colors.xml.

The "+" is for auto-generation of resource value for the resource, generally used for generation the resource identification number, much like SQL auto-increment.

Without the "+" the resource value must have been specified beforehand, i.e in res/values/colors.xml

The "?" allows lookup using the name of the attribute of the resource, e.g.:


Monday, May 3, 2010

XML layout and R class

The user interface elements are declared in an XML file, these are compiled automatically (if you have setup your IDE correctly) into a R (for resource, i guess) class. Through R your Android program can access them.

So if your widgets and containers are specified in myMain.xml, then in your OnCreate() method of the Activity, then you use setContentView(R.layout.myMain).

If you want to access the elements in the XMl file, the element must have an android:id tag filled. To access the identified widget use findViewById by passing the numeric id found in the

XML fragment:
For the above to work the root element of the XML must declare the Android namespace.

The fragment above declares a button with text "Press" for the specified size. To access the button, in this case, use findViewById(

Button btn=(Button) findViewById(;

Android : Basic Classes and Concepts

View: Views are user interface elements, i.e. buttons, lists, etc. In Android user interface is specified declaratively in XML.
Activity: Activities encapsulate user interaction with various View elements, in this case a presentation screen, but view-less Activity is possible. Activities can be started by Intent, one Activity can start another Activity. The main program is an Activity.
ContentProvider: Abstracts data as service so that content can be shared and accessed in REST-based manner using URI locators, rather like http requests. This allows uniform means of accessing data without knowledge of structure and implementation. Android provides Sqlite for database access.
Intent: Intent can be thought of as a message broadcast, service or activity request; an "intention" for some action. Intent allows loose coupling of action requestor and action handler.
Service: background process.

More .. Android Pads/Tablet

Another contender from China -- the Aigo N700. Key features: 7" screen, Nvidia Tegra2, Processor dual-core Cortex A9 1Ghz (1MB L2 cache), Flash 10, Android 2.1. No pricing available as yet.

Source: chinitech

Tuesday, April 27, 2010

AndroidPad for 100US

The Chinese in Shenzhen have introduced a very attractive price point (100+US) Android-based tablet. Device specs include:

  • CPU: ARM-based CPU 600MHz
  • Display: 7” TFT screen, 800 x 480
  • Connectivity: Wi-Fi
  • Storage: 2GB Flash, expandable by SD slots
  • OS: Android 1.6


Wednesday, April 21, 2010

First Android App using Netbeans

This is a simple text and button app. An Android app uses XML for widgets and layout. This is communicated to Java via an automatically create R class when it is being built.
Running the app the first time in Netbeans will invoke the Android Virtual Device. However, it will take some time for it (avd) to startup, and the netbeans will give up and fail to run the app. You can start the AVD manually first, or just simply re-run the app from Netbeans.

Android for Netbeans: Step by Step

This blog has a screen by screen steps on how to setup for Netbeans. See

Tuesday, April 20, 2010

Alternative Android development tool

Another alternative to development for Android (and iPhone) is the Titanium appcelerator. There is a free and open source version. I have not tried it, they claim native mobile, desktop and tablet apps. It uses a combination of HTML and Javascript but does not need a browser on android , rather, it accesses part of the browser directly, in particular, it accesses the rendering part of the browser (the part that draws the webpage). The browser renderer (used in Chrome, and iPhone) is WebKit. So titanium calls Webkit to display the interface without directly invoking any browser. Since WebKit understands javascript (and its libraries eg JQuery), and HTML, essentially you are programming using both languages.

Here is a closer look on the emulator showing the menu page of the device

Here is how the Android Virtual Device looks like running in Netbeans.

Android for Netbeans - a short guide

1. Download android sdk
Run SDK Setup.exe to select versions. If you have problems, click on Settings to force it to use http instead of https. If force doesn't work, retype url.

2. Download Netbeans 6.8, and install. 6.5 no longer supported by nbandroid

3. Start Netbeans
  • Click tools/plugin/settings
  • Add Update Centers: nbandroid set URL:
  • Go to Available Plugins, look for Android and install it.
  • Click tools/Java Platform
  • Add Platform, select appropriate android directory.

3. Go to android sdk/tools directory
  • run: android list targets
  • See what targets are available, use in next command
  • run: android create avd -n 'name' -t 'id'
  • where 'name' is a name that you choose and 'id' is the id for avd found in list targets command.