Thursday, January 13, 2011

Bluetooth 4.0 is expected to hit markets dis year

The Bluetooth Special Interest Group (SIG) said on Wednesday that version 4.0 of the wireless specification may be incorporated into devices by the end of the year. The new spec will bring Bluetooth to a whole new set of gadgets including watches, pedometers, and all other low-power devices that run on coin-cell batteries.

This is a huge step considering that Bluetooth only resided in devices that used triple-A or larger capacity batteries. Michael Foley, executive director of the Bluetooth SIG, said that 4.0 combines both the high-speed data transfer capabilities provided by Bluetooth 3.0 with the new ability to transmit small bursts of data over short ranges.

The IGD News Service reports that Bluetooth 4.0 won't offer users a major improvement in actual battery life-- only a nominal improvement at best. Foley provided an example, saying that Bluetooth 4.0 radios will see the same battery drain as Bluetooth 3.0 radios when used to sync headphones to music players, or to connect smartphones to laptops.


Charles Golvin, principal analyst at Forrester Research, said that Bluetooth 4.0 will be better than the competition because it can be deployed across a wide variety of devices, giving the tech a head start over the other technologies. Unfortunately, the data transfer rate hasn't improved: Bluetooth still shoots data from device to device at a maximum rate of 24Mb/s (BT 3.0 + HS).

http://www.tomshardware.com/news/Blu...sfer,9812.html

Thursday, January 6, 2011

How to build Android application package (.apk) Manually.

he good thing about building manually your apk is that you don’t have to name your resources directory to res, you can name it anything you want.

You can find ant scripts in: \platforms\android-1.5\templates\android-rules.xml

Step 1: Generate Resource java code and packaged Resources
aapt package -f -M ${manifest.file} -F ${packaged.resource.file} -I ${path.to.android-jar.library} -S ${android-resource-directory} [-m -J ${folder.to.output.the.R.java}]

Step 2: Compile java source codes + R.java
use javac

Step 3: Convert classes to Dalvik bytecodes
use dx.bat
dx.bat –dex –output=${output.dex.file} ${compiled.classes.directory} ${jar files..}

Step 4: Create unsigned APK
use apkbuilder

apkbuilder ${output.apk.file} -u -z ${packagedresource.file} -f ${dex.file}

or

apkbuilder ${output.apk.file} -u -z ${packagedresource.file} -f ${dex.file} -rf ${source.dir} -rj ${libraries.dir}

-rf = resources required for compiled source files?
-rj = resources required for jar files

Step 6: Generate a key
use keytool

Step 7: Sign APK
use jarsigner

jarsigner -keystore ${keystore} -storepass ${keystore.password} -keypass ${keypass} -signedjar ${signed.apkfile} ${unsigned.apkfile} ${keyalias}

Step 8: Publish
use adb
adb -d install -r ${signed.apk}

Inspecting your APK file:

aapt list -v latest.apk

Tuesday, January 4, 2011

Is Java an Object Oriented Programming Language?

A type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.

One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.

To perform object-oriented programming, one needs an object-oriented programming language (OOPL). Java, C++ and Smalltalk are three of the more popular languages, and there are also object-oriented versions of Pascal.

In a Simple way ..

As per the definition of Object Oriented Programming, a language can be categorized as PURE OOP based on following criteria:

1.
The language must have inbuilt support for encapsulation and abstraction.
2.
The language must have inbuilt support for Inheritance.
3.
The language must have inbuilt support for Polymorphism.
4.
All system defined types must be objects.
5.
All user defined types must be object.
6.
The only way of communication between objects is through the methods exposed on the same.


Criteria 1 to 3 are self explanatory and don’t require further clarification. So I am escaping those. Now consider criteria 4.

Criteria 4 states that all predefined types in the systems must be objects only. This means there can’t be anything other than objects defined by system. This is the first requirement where Java fails to fulfill the criteria to be categorized as pure Object Oriented Programming. Java has primitive types, which are not objects and thus violates this rule.

Criteria 5 suggests that all user defined types must also be objects only. This means users can’t define or create anything other than objects. This restriction is not applicable in using system defined types. Java successfully follows this rule where user can’t create or define anything other than objects.

Criteria 6 suggest that whenever objects communicate with each other, they communicate using the methods exposed on other objects. And this should be the only way of communication. Java violets this rule by using various operators. Consider the ‘+’ operator on String literals which can be used to add 2 or more string objects. By using this operator java violets the rule of object communication using methods. This holds true for other operators on primitive types as well.

Summing up the above points, java fulfils the criteria 1,2,3,5 but fails in 4 and 6. Failing of these 2 criteria deprived java from being categorized as PURE Object Oriented Programming Language. But still the programming community categorizes Java as OOP (although not Pure). In theory such languages are called ‘Hybrid OOP’ languages.