Wednesday, 31 August 2011
Upgrading LG gt540
One solution for this trouble:
1. Unplug USB
2. Remove the battery
3. Hold the volume down button (LHS of phone) and reinsert USB lead at the same time
4. I then re-ran the update program.
LG Program Download
USB Driver Download
When you install the update be patient!!!!!! It takes forever
Wednesday, 24 August 2011
Demodulation in Android device (I): Recording sound.
While I was updating it, my computer stuck so I had to restart it. Then I tried to power on my LG device and never came back on again, I could only see the LG logo. That's why I need to reboot my device, but I don't think this take my long time because there is a lot of information about it on the internet.
Well, while I try to fix this accident I'm working on how to demodulate the signals from the arduino in an Android device.
I'm trying some classes in API Level 3:
read(byte[], int, int)
, read(short[], int, int)
or read(ByteBuffer, int)
. The choice of which method to use will be based on the audio data storage format that is the most convenient for the user of AudioRecord. public AudioRecord (int audioSource, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes)
public static int getMinBufferSize (int sampleRateInHz, int channelConfig, int audioFormat)
- AudioTrack
write(byte[], int, int)
and write(short[], int, int)
methods.public AudioTrack (int streamType, int samplieRateInHz, int channelConfig, int audioFormat, intBufferSizeInBytes, int mode)
Monday, 22 August 2011
Nice find: Getting source code from an APK file
"procedure to decoding .apk files---step wise method-->
step 1:
make a new folder and put .apk file (which you want to decode) now rename this .apk file with extension .zip (eg:rename from filename.apk to filename.apk.zip) and save it..now you get classes.dex files etc...at this stage you are able to see drawable but not xml and java file...so cont...
step 2:
now extract this zip apk file in the same folder(in this eg or case NEW FOLDER). now dowmload dex2jar from this link http://code.google.com/p/dex2jar/ and extract it to the same folder (in this case NEW FOLDER).....now open command prompt and reach to that folder (in this case NEW FOLDER)....after reaching write "dex2jar classes.dex" and press enter.....now you get classes.dex.dex2jar file in the same folder......now download java decompiler from http://java.decompiler.free.fr/?q=jdgui and now double click on jd-gui and click on open file then open classes.dex.dex2jar file from that folder...now you get class file...save all these class file (click on file then click "save all sources" in jd-gui)..by src name....at this stage you get source...but xml files are still unreadable...so cont...
step 3:
now open another new folder and put these files
put .apk file which you want to decode
download apktool using google and put in the same folder
download framework-res.apk file using google and put in the same folder
Open a command window
Navigate to the root directory of APKtool and type the following command: apktool if framework-res.apk
apktool d "fname".apk ("fname" denotes filename which you want to decode)
now you get a file folder in that folder and now you can easily read xml files also.
step 4:
it's not any step just copy contents of both folder(in this case both new folder)to the single one
and now enjoy wid source code... "
Video Tutorial APKtool
Found in: stackoverflow.com
Friday, 5 August 2011
System Architecture
This project aims to build an Arduino-powered interface to get data from any real-world, analog sensor into a smartphone (Android device) using the audio port as the communication channel between both platforms.
Sensor: obtain some values we want to know, they can be temperature, pressure, humidity, amount of light... These values are related to a voltage, a continuous value that is measured in certain periods of time.
We can measure current temperature of the environment using a simple temperature sensor LM335 and an Arduino with the help of a small circuit and a simple Arduino code.
With this what we obtain is an analog signal related to the value from the sensor, this is the modulation part.
Now we want to work with this signal in our mobile device, as we already decided and commented here, this is going to be done through the audio port. That's why we need and are going to use the Softmodem board, which allows us to connect the arduino board and our mobile device with an audio jack cable.
Using compatible FSK libraries on both the Arduino side and the Android side, we can actually accomplish bi-directional communication between our sensor rig and our mobile device. The Arduino gives us the onboard computing power to be able to both write and read data using FSK. As a first example, we’ll try to establish a unidirectional connection, sending data from the sensor to de Android device only. Still, we need to do FSK on both the Arduino side (modulation, or encoding the sensor data as audio) and the Android side (Application) (demodulation, or decoding the audio as data). So, all the raw materials are here for a bi-directional connection.
We need to decide in which frequencies we are going to encode:
This library is setup to encode data in shifts between audio frequencies 4000Hz (LOW) and 8000Hz (HIGH).
First, you need the sensor, Arduino and supporting circuitry for gathering data. For this we connect the sensor which will feed the Arduino.
You will also need to build some simple circuitry and load some code onto the Arduino.
Final objective: Android device <- (softmodem)->Arduino<-(rs232) are communicating said configuration->PC.