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