I2C with Android

Dave McLaughlin
I see that there is a library to read and write the I2C EEPROM but is there
a library to use the I2C bus with Android?

I need to read and write to an ADC with the I2C bus as the inbuilt ADC does
not have enough resolution.

I also need to communicate with an I2C battery status IC on my board.

Thanks
Dave...

iFXBR
Wich board are you using? I own a Tiny6410 and I could find the example
source code on the CDs.

Dave McLaughlin
I am using the mini210 and yes there is a demo on there but what I am
looking for is the code to drive the I2C bus from Android so that I can
talk to my own devices.

The current library only allows talking to the I2C EEPROM and there is no
source code released for this library so no way to modify it.

I need code to do START, DATA IN, DATA OUT and STOP etc on the I2C bus.

Cheers
Dave...

shashank
HI Dave, 

I tried to use your code, but when i try to write to I2C , the app closes
with nullpointer exception at I2C write command. I am bit confused with the
 "mode" parameter. Is it a the mode like Byte, Word, block etc or the
Register addresses of the device? 

Also would you be able to help me with the nullpointer exception error? I
am a java newbie and currently trying to get the I2C Radio chip working. 

I have another C program which successfully operates this chip through I2C,
so i know I2C is working properly on hardware / driver level. I have even
tried setting the permissions to 777 for /dev/i2c-1 device i am using.

I hope you will see this and respond :)

Thanks,
Shashank