Sunday, January 23, 2011

android eclipse main.out.xml parsing error?

I got this error early in the morning today and kind of pissed me off. after few hours of googling I found the solution to this problem,


1. Debug Configurations -> Target -> Automatic
2. delete any main.xml.out files
3. Clean the solution
4. Open any .java file in the editor
5. Run

Thursday, January 20, 2011

android.intent.action.BOOT_COMPLETED not working ?

Today, I spent most of the time wondering why, this is the AndroidManifest.xml





after hours of searching I posted it on StackOverflow.com, and one guy came with an answer it was because '' I is in capital letter!

yah.. bummer! hope this will help to someone else,

cheers

Wednesday, January 19, 2011

Android ADB Interface This device cannot start. (Code 10) Error !

Today, I for the first time, I wanted to debug an application on an Android device. to do this, First you must install google usb driver which is located in the SDK folder. If its not there, You have to get it manually using the SDKManager.exe

After installing the driver as a new hardware I got this exclamation mark on the driver !



So, I googled and nothing came up. Then only it hit me to install my HTC phone drivers. I got the android drivers from here

Application - HTC Sync for all HTC Android Phones

after that i can still see the exclamation mark but Eclipse debugger can debug applications!. strange but it worked!

Or you guys can use my awsome app http://androidshell.io/ to connect to remote android devices without doing all this!

Tuesday, January 18, 2011

how to wipe data when starting Android emulator?

Today, I wanted to wipe out all the test programs i have created in my android emulator. I googled it few times and found -wipe-data parameter in SDK documentation.

http://developer.android.com/guide/developing/tools/emulator.html

but how to use -wipe-data parameter ? it's easy, )but I could not find a way to do it using the Eclipse IDE)

Open command prompt,

android-sdk-windows\tools>emulator -avd -wipe-data
eg.
emulator -avd androidavd2 -wipe-data

this should work!

How to debug multiple versions of Android source code in Eclipse?

Today, I wanted to know what's going on inside Android because it was keep throwing an exception . So i wanted to check how to debug an Android application right from Eclipse IDE. When I googled I found this link,

http://android.opensourceror.org/2010/01/18/android-source/

but it says how to debug a single version of android eg. Cupcake. Now problem is how to debug multiple versions of Android ?

it's easy.

all you have to do is open the .project in notepad
\workspace\.metadata\.plugins\org.eclipse.jdt.core\.org.eclipse.jdt.core.external.folders

and another element to the
linkedresources section.

Today, I wanted to know what's going on inside Android because it was keep throwing an exception . So i wanted to check how to debug an Android application right from Eclipse IDE. When I googled I found this link,

http://android.opensourceror.org/2010/01/18/android-source/

but it says how to debug a single version of android eg. Cupcake. Now problem is how to debug multiple versions of Android ?

it's easy.

all you have to do is open the .project in notepad
\workspace\.metadata\.plugins\org.eclipse.jdt.core\.org.eclipse.jdt.core.external.folders

and another element to the
linkedresources section.

.link1
2
android-sdk-windows/Donut

Monday, January 17, 2011

How to run multiple instances of Android emulator to SMS?

Today, I wanted to run two instances of emulator to simulate sending and receiving SMS messages.

This is how i managed to make it work.

To create the 2nd instance you need to,

1. Need to create a separate virtual device on Android SDK and AVD Manager.
1.1 Open Eclips -> Window -> Android SDK and AVD Manager

2. Select virtual devices from left panel, Click on New button.

3. Set the name Eg. androidavd2

4. Set the Target Android 2.3 API Level 9 or any other you prefer.

5. Click on ok.

ok, now we have a Android Virtual Device created.

6. Open the Android SDK Tools folder in the command prompt.
C:\android-sdk_r08-windows\android-sdk-windows\Tools

Type:
emulator.exe -avd androidavd2

this will tell the emulator.exe to open android virtual device "androidavd2".

that's it.

Also you can use the telnet. (Windows Vista Up operating systems, you have to download telnet.exe separately because it doesn't come with the default Windows installation.)

to connect using telnet type
telnet localhost 5554

you can use the
adb devices command to see the list of devices currently running. if not You need to start the emulator first!.

then
sms send
eg:
sms send 5554 "Hello android!"

if you have any questions, please drop a line here. good luck.