Flag Count

free counters

Tuesday, November 8, 2011

Pattaya @ Night


Pattaya @ Night, originally uploaded by Mithun Kundu.

This photo was taken handheld from top floor of our hotel

Sunday, August 7, 2011

Absorbing 3rd party code (Zxing) in your Android Project


In this text ZXING or ZEBRA CROSSING is the 3rd party library.


Technologies required:

1. Android SDK Tools v10
2. Android platform 2.2( v8)
3. Zebra Crossing Library 1.6
4. Ant v1.8
5. Eclipse (optional)


Why Zebra Crossing 1.6 and not the latest 1.7?

To integrate the Zebra crossing library we need to use Zebra Crossing 1.6. The latest version is 1.7 but its target platform is 9. Target platform for Mobile Print Solution is 8. Hence ZXing 1.6 is the most suitable version for integration.

ZXing code base location?

ZXing 1.6 and ZXing 1.7 are checked in externs section of the repository. Now we should use 1.6. When we upgrade our apps to target platform 9, we can link 1.7 with Mobile Print apps.

Linking ZXing with Mobile Print Apps

Create a svn external link to the zxing/android directory from the Mobile Print Directory. Additionally, core.jar file placed under libs of ZXing extern should be linked with libs section of Mobile Print apps.

How to build the integrated code?

To build the integrated code first we need to link the ZXing as a class project with Mobile Print apps. This will require adding a line in default.properties file of <Your Project>:
android.library.reference.1=zxing/android
This has been done already for the code checked in Zxing.
From command prompt:
To do so go to the location where <Your Project> apps directory is located and run the following command:
android update project --path ./<Your Project> --library /Zing/android
From eclipse:
Please note that if you update the project from command prompt Eclipse will not be able to identify the library project. Therefore for development environment in Eclipse where you need to debug the QrCode you need to manually add the Zxing project in <Your Project>.
Step 1: Import <Your Project> and ZXing projects in your workspace.
Step 2: Right Click on ZXing in project explorer->Properties->Android->Check Is Library(Screen 1)

Screen 1

Step 3: Then,
Right Click on <Your Project> in project explorer->Properties->Android->Click on Add button(screen 2).
Screen 2
Step 4: Select ZXing library project(Screen 3).

Screen 3

Step 5: Click Ok(Screen 4)
Screen 4
   
This should add a similar tag in build.properties. Additionally eclipse will also update .classpath file and .project file adding some thing like below
<classpathentry kind="src" path="ZXing_src"/>

In the .project file a linkedresouces tag will be created and should have a hardcoded path. To avoid hardcoded path in this file.
Include the core.jar file under libs (<Your Project>) in the build path if it is not already included.
Right Click on <Your Project> in project explorer->Properties->Java Build Path->Source->Select ZXing->Click on Edit(Screen 5).

Screen 5
Select Variables(Screen 6).

Screen 6

Select PROJECT_LOC(Screen 7).


Screen 7

Click on Extend(Screen 8) and set the correct directory. This will remove the hard coded path.

Screen 8


Please note that this linking should be done only for development environment. Even if these updated config files of Eclipse are put in subversion, only checking them out will not link the entire code base properly. It has been tried and didn’t work out for Eclipse. This is a limitation of Eclipse IDE.

Build Errors from ZXing:

If we try to build the source code(v1.6) downloaded from ZXing website there will be some build errors for String.xml files under ZXing. A string namedpreferences_custom_product_search_summary is defined in strings.xml which contains %s. The compiler error that will be thrown is “Multiple Substitutions specified in non-positional format”. To fix this one add an attribute “formatted= "false" ” inside the definition tag. It has already been done in externs section of the repository. This fix is already checked in subversion. Please note that this bug is fixed in ZXing 1.7.

Manifest File Updates and invoking ZXing activity:

To invoke the CaptureActivity? of ZXing we need to add the following in Android manifest file:
<activity android:name= "com.google.zxing.client.android.CaptureActivity"
android:screenOrientation= "landscape"
android:configChanges= "orientation|keyboardHidden"
android:theme= "@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode= "stateAlwaysHidden" >
<intent-filter>
<action android:name= "com.google.zxing.client.android.SCAN" />
<category android:name= "android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Additionally add the following permission:
<uses-permission android:name ="android.permission.CAMERA" />
Please make sure that <Your Activity> from component section is present in
Now if the apps is built from command prompt using build.xml or from Eclipse the apps will run fine and Camera will be invoked.


Building Zebra Crossing as a separate component:

Please note that building the zebra crossing separately is not required for using it in <Your Project>. However, for testing purpose it can be done.
You can check out all the files under Zxing in externs section. Alternatively you can create a folder Zxing and inside it download android directory, core directory, and all the configuration related files.
To build it from command prompt, perform the following steps:
Edit build.properties at the top level of the project, and change the android-home property to point to the SDK install location
Download Proguard, version 4.4 minimum, and install it where you like.
Edit build.properties and set proguard-jar to the full path (including the filename) of the proguard library.
Build core; Note that core must be built without debug symbols to avoid an incompatibility between proguard and the Android tool chain:
cd core
ant clean build-no-debug

Build android:
cd ../android
ant

Please note that the build.xml file provided by ZXing open source will throw some errors as some of the tags used in it are depreciated for later versions of ant, android and proguard.
Copy the core.jar file inside android under a new directory core_jar. This is optional and is done to use the same directory to build the ZXing with <Your Project> from command line as well as eclipse.
From Eclipse: 

First create the core.jar file from command prompt. Place the jar file inside core_jar directory in android. Then import the android project in Eclipse. Remove the “Is Library” tag if it is displayed and trigger the build. This will create the apk file.



Flickr Enjoy photos on http://www.flickr.com/photos/mithunkundu/

Sunday, July 24, 2011

Hampi - The Ruined Empire

 Hampi - The Ruined Empire

Hampi is a village located in northern Karnataka, on the banks of the river Tungabhadra. Also called as "The City of Ruins", Hampi was once the capital of Vijayanagar empire, the largest Hindu empire in the history. A UNESCO World Heritage Site, Hampi lies within the ruins of mighty Vijayanagar Empire. Of course, Hampi is mostly in ruined state today, but due to its rustic charm it attracts thousands of tourists and pilgrims every year. Hampi is situated in a strange and picturesque hilly landscape strewn with numerous rounded boulders, with the Tungabhadra river flowing through the centre of it. Among the hills and valleys of Hampi there are over 500 monuments. Hampi is home to beautiful temples, basement of palaces, royal pavilions, bastions, royal platforms, remains of aquatic structures, old market streets, treasury buildings and several other interesting structures. Most of the ruins at Hampi are located along the road leading from Kamalapura to Hampi. Moreover, whether you are a common traveller or a pilgrim, it doesn't matter, Hampi is a perfect destination for all and deserves a visit as well. So, visit this ruined city on your next vacation and get a glimpse of the largest Hindu empire.

We visited Hampi between 11th & 12th December 2010. A must visit for a traveler.

Weather - Best season to visit this place is September to February.
Hampi’s climate is generally warm and dry. During the summer season (March to May) the temperature reaches a maximum of 40°C. Monsoon (June to August) brings some wet weather with good showers. The winter period in Hampi is from November to February, during which the climate is very pleasant and cool. During winter day temperature is less than 30°C and night temperature can go as low as 12°C.
Hampi has a set of attractive annual festivals, some religious and others cultural. All festivals are celebrated with much enthusiasm and fanfare. Hampi festival (November), Purandaradasa Aradhana (January/February), Shivaratri (February/March) and Deepavali (October) are some of the festivals attracting many tourist to Hampi.

Stay - We stayed at Karnataka Hotel ,Tungavadra Dam.


We have started our exploration around 8 a.m. Destinations are in order.


- Virupaksha Temple  - 



The magnificent Virupaksha Temple lies at the western end of the famous Hampi Bazaar. On its eastern entrance the temple has a 120 feet high towers. Virupaksha temple houses the shrines of Shiva, Pampa and Bhuvaneswari. Some portions of this temple are older than the Vijayanagar Kingdom, dates back to the 11th or 12th centuries. Close to this temple is the 6.7 m tall monolith statue of Ugra Narasimha. According to a nearby inscription it was hewn from a single boulder in 1528 during the reign of Krishnadeva Raya.








- Kadle Ganesh - 

Kadle Ganesh Temple Complex
On the slope of Hemakuta Hill, near the Sasivekalu Ganesha is another monolith called in the same vein, the Kadalekalu (gram seed) Ganesha. The huge seated God, carved in the round out of a massive boulder, is about 4.5 metres high and is housed in a large shrine with a fine open pillared mantapa in front. The tall, slender and graceful pillars are of the ornate cubical Vijayanagara type with solid early corbels. The mantapa is singularly classical in its architectural proportions and has been admired by many architects and critics. The temple also forms one of the important vintage points from which a good and picturesque view could be had of the Hampi monuments.

- Krishna Temple Complex -




This temple complex has been recently excavated through the last decade, and restoration work is still in progress.
This is a ruined temple, south of Hampi and Hemakuta hill. It was built by the emperor Krishnadevaraya after military campaigns in Orissa. The temple is contained in twin enclosures. Parts of the temple and its compound have collapsed, and while some restoration has been carried out, it is generally in poor condition. There is now no image in the inner sanctuary.











- Lakshmi Narasimha -


South of Hampi has this massive rock cut idol of Narasimha, the fierce aspect of Vishnu, 6.7 m high. Originally the idol bore a smaller image of Lakshmi on one knee this had fallen off, probably due to vandalism. The Lakshmi statue is now in the museum at Kamalapuram.

Narasimha is depicted seated on the coils of Shesha. Shesha is shown here in a form with seven heads, the heads arching over Narasimha to form a canopy. The statue has recently been restored. The granite strap binding between his knees is a recent addition to stabilise it. The donation of this work is ascribed to either Krishnadeva Raya, or to a wealthy merchant during his reign.

- Sister Stone -


It is said every stone in Hampi has a story to tell. These boulder-like two similar looking stones (in the picture) are called Sister Stones. According to legend, two jealous sisters visiting Hampi were commenting badly about the city. The city goddess heard this and turned them into stones!
On march 2011 one of the two gigantic boulders of Sisters Stone and considered one of the important land marks at the Hampi heritage city, was found broken. The middle portion of the boulder on the right side has fallen down. 
A crack was noticed in the boulder some time ago. Due to extreme weather conditions, with mercury shooting up during summers and dipping during winter, the vibrations caused by heavy vehicular traffic and the sinking of the soil, the crack might have widened and split into two.



- Underground Shiva Temple -

The temple has a Garbagriha with an antarala and Aradhamantapa and a Mahamantatapa. The mahamantapa has pillared corridors that fuse with the pillared Mukhamantapa, making a larger pillared frontal Mantapa which also encloses a Dwajasthamba. The pillars of this temple are plain.
An inscription referring to this temple states that Krishnadevaraya donated Nagalapura and other villages for worship and offerings to the Gods for the merit of his parents Narsa Nayaka and Nagaji Devi.
At times the base of the temple is flooded and may be inaccessible. When it is accessible, masses of small insect bats may be found in the temple.

- Nobelmen's Palace -

Noblemen's Palace was discovered few years back. It is believed that this palace was for aristocrats and high-ranking officials. It was made of sandalwood. Now only the base remains.

- Lotus Mahal -

A palace for the queen Looking like a lotus flower, the two-story structure has magnificent arc ways set in geometric regularity. Lotus Mahal was an air-cooled (Pipes with running water) summer palace of the queen.
IT was constructed in the later Vijayanagara period, this structure shows Islamic influence in its arched gateways and vaulted ceilings. Its construction entirely in stone is a clear deviation from conventional Vijayanagara palace and house construction that used wooden structures on stone platforms.

- Elephant stables -

A set of large stables, to house the ceremonial elephants of the royal household. The area in front of them was a parade ground for the elephants, and for troops. This is another structure that shows Islamic influence in its domes and arched gateways. The guards' barracks are located right next to the elephant stables
Elephant Stable : Elephant Stable presents an excellent example of Hindu-Muslim style of architecture. Once the huge stable housed 11 elephant in separate compartments.

- Ramachandra Temple or Hazara Ramaswami Temple -

Hazara Ramaswami Temple is located on the western side of House of Victory. It is believed that the temple was the private place of worship of the royal family. Main attraction of this temple is the series of scene from the epic Ramayana carved on inside walls of the mantapa.

The temple stands in a rectangular courtyard, with entrances facing to the east. Reliefs showing daily life and festival scenes occur on the outer walls of the courtyard. Scenes from the Ramayana occur on the inner courtyard walls, and on the temple itself. There is a well-relief of baby Krishna on the walls.
The temple may have been exclusively for royal use. It is believed to be constructed at the site of Vaali's killing in the hands of Rama. It may have been a private shrine for royalty. It is unusual in that it has four black basalt columns in the mantapa (columned hall). The inner sanctuary of the temple is now empty.
This is also known as the Hazara Rama temple (temple of a thousand Ramas), due to the recurrence of images of Rama on the walls. Sometimes it is called the Hajara Rama temple (the Rama temple in the courtyard)

- The Royal Centre -

This extensive area consists of a small plateau, which starts about 2 km (1.2 mi) to the southeast of Hampi, and extends southeast, almost to the village of Kamalapuram. It is separated from the Sacred Centre by a small valley, now consisting of agricultural fields, and which carries irrigation canals or streams that join the river opposite Anegondi. A granite platform overlooks the Royal Centre.The Royal Centre contains the ruins of palaces, administrative buildings, and some temples directly associated with royalty. Little remains of the palaces except the foundations, as they were largely timber structures, for comfort. The temples and some of the other stone structures survive however, as do many of the surrounding city walls.
An aqueduct runs through much of the Royal Enclosure and into the Great Tank where water was brought for special events. The west end of the tank is overlooked by a platform shrine. The aqueduct also runs into the large stepped tank, lined in green diorite, with a geometric design that has not required restoration.


- House of Victory -

House of Victory was constructed by Krishnadeva Raya when he returned after his victorious expedition against the king of Orissa. The Vijayanagar kings used to sit on a huge throne in the House of Victory to see the nine-day Dussehra festival. 

- Pushkarani or Stepped Tank -

This large and geometrically thrilling tank, lined in green diorite, has never required restoration. It has no drain, and is fed by an aqueduct . Markings on the blocks (not shown) indicate that they were cut elsewhere, before being moved to the site and assembled here.
Also called the Stepped Bath, or the Queen's bath, this is a stepped well designed for bathing. Such sunken wells were created to provide relief from daytime heat. It would have been covered when the city was occupied.

- Mahanavami Dibba -

Mahanavami Dibba is a big platform having beautiful carvings. Actually the Mahanavami Dibba is the foundation of a lion story wooden structure from which the royal family of Hampi used to see pomp, colour and revelry during the Mahanadu festival.

- Hemakuta Hill -

The hill is situated to the south of Hampi village. It bears several small temples that predate the construction of Vijayanagara as the capital of the empire, some being as early as the 10th century. The hill was fortified when the main city was constructed, and a number of more recent temples, tanks, entrances, and gopurams exist on the hill, some of which were never completed.

- Sugriva's cave -

This is a natural cave, said to be the original home of the monkey king Sugriva, where Rama is said to have met him and Hanuman on his travels. The cave is marked by coloured markings, and the attentions of pilgrims.

- Vittala Temple Complex-

This is perhaps the most famous and well-known among the ruins of Hampi. The iconic stone chariot in the vicinity of this temple complex is a symbol of Karnataka Tourism. Off late, floodlights have been installed in the temple complex that provide illumination at dusk, thereby adding to the grandeur of the architecture.
Situated northeast of Hampi, opposite the village of Anegondi, this is one of the principal monuments of the city. It is dedicated to Vittala, an aspect of Vishnu worshipped in the Maratha country. It is believed to date from the 16th century.
In the front of the temple is the famous stone chariot or ratha. This is itself a miniature temple, carved out of a single rock, to resemble the temple chariots or rathas in which temple idols are traditionally taken out in procession.
One of the notable features of the Vittala Temple is the musical pillars. Each of the pillars that support the roof of the main temple is supported by a pillar representing a musical instrument, and is constructed as 7 minor pillars arranged around a main pillar. These 7 pillars, when struck, emanate the 7 notes from the representative instrument, varying in sound quality based on whether it represents a wind, string or percussion instrument.
The temple is the venue of the annual Purandaradasa festival.










- Stone Chariot -

The Stone Chariot in the front is called the Garuda Mandapa and it is only of its kind in the entire country.(one in Uttara Kosa Mangai near Ramnad and another one in KOnarak). This Stone Chariot is to be admired as to 1)How the wheels have been in stone?
2)How they have positioned the wheels.
3)How the Garuda Mandap has been carefully placed on the bottom supporting platform (as can be seen in the pics below). If you start asking questions like this our heads would start rotating like a wheel!Hats off to those sthapathis of 1513!!


- King's Balance -

This structure, the Tulapurushandana, stands to the southwest of the Vittala temple. consists of two carved granite pillars, spanned by a carved horizontal granite transom. This was used on ceremonial days, when scales were hung from the transom, and the Raya (the emperor) was ceremonially weighed against gold or jewels. The treasure was then distributed, to Brahmins or others in the city.

- Aneghundi and Sri Navabrindava -

2KM north of Hampi lies this old town Aneghundi,and this was thei first Kingdom of the Vijayanagar Kings before they moved over to Hampi.You can see the old fort in Aneghundi still. One calls this place the mythical Kingdom of Kishkinda and there is a Hanuman temple on top of the Hills and its really steep to climb.

- Tungabhadra Dam & Musical Fountain-


About 15 km upstream from Shimoga at Gajanur across the River Tunga a dam is constructed. At Lakkavalli about 15 km upstream of Bhadravati across the Bhadra a dam is constructed. Both are multipurpose dams and irrigate lands in Shimoga, Chikkamagalur, Davanagere and Haveri.
TungaBhadra dam is constructed across river Tungabhadra, a tributary of River Krishna. The dam is built near the town of Hosapete in Karnataka. It is considered as a multipurpose dam or project. Its storage capacity is 135 Tmcft. Owing to siltation the capacity has been reduced by about 30 Tmcft. If there is seasonal and late rains, the dam distributes the estimated quantity of 235 Tmcft. The dam is filled as when the water is let into the canals during the rainy season. The main architect of the dam was Thirumalai Iyengar, an engineer from Madras. As Tungabhadra Dam was constructed by him, so a general purpose hall in this place was named after him. Multipurpose dams are the one's which help in generation of electricity, irrigation of land, Prevention and control of floods etc. It has become a picnic or tourist spot over the years. The dam is near to world famous heritage site Hampi.
At Sunkesula, about 25 km upstream from Kurnool a barrage was constructed at about 1860s by the British Engineer, hailed as Bhagiratha for Andhras, Sir Arthur Cotton. Originally was intended to be used for navigation also. As the road and rail transportation increased it is now an irrigation project, for Kurnool and Kadapa Districts, carrying water through the renowned K.C.Canal.(Kurnool - Cuddapah canal- Till recently Kadapa was spelled "Cuddapah"). Recently the barrage is replaced by the Kotla Vijayabhaskara Reddy Project- a permanent dam. It impounds about 15,000,000,000 cubic feet (0.42 km3) of water and irrigates about 300,000 acres (1,200 km2) of land in Kurnool and Kadapa districts.


 


Keep following......

Other Posts coming soon.