How to convert existing project into Android project in Eclipse?

Standard

You need to change the nature of the project.

  1. Close eclipse
  2. Open the .project file in your project
  3. Make the natures section look like:

 

<natures>
 <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
 <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

 
Start eclipse again, have fun.

How to Attach Android Source-Code to eclipse?

Standard

After installing ADT, use SDK Manager to download the source codes for the latest android API.

Open SDK Manager–>install source under api(i.e Android 4.0)
if You got No sources attached then click the button, then choose the Directory
e.g: D:\Android\android___sdk\sources\android-17\ —> this my android sdk location
Depend upon your android installation directory choose accordingly.

eclipse debugger stops at DexFile.defineClass

Standard

It is simply a breakpoint being set at the class-definition level (i.e. a breakpoint set in Eclipse on the line “public class MyActivity…” :wink:

May be android emulator handles this kind of breakpoint by DexFile.defineClass. :roll:

Android emulator failed to allocate memory 8

Standard

if when i try to run AVD emulator from eclipse and receiving an error like this:

Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

the solution is to edit C:\Users\<user>\.android\avd\<avd-profile-name>.avd\config.ini and change the value:

hw.ramSize=1024

to

hw.ramSize=1024MB

That’s it!  ;-)