2012年6月18日

【Andoid】eclipse connect to mobile device

1.Turn on "USB Debugging" on your device 
     Android 2.X :Settings > Applications > Development enable USB debugging 
     Android 4.0 :Settings > Developer enable USB debugging 

2.Set up your system to detect your device
     Windows:install USB Driver
     Mac OS X:It works, skip it.

Reference:

【Android】R.java is missing?

When creating a new Android project, but got an error, can't find 'R'. Tracing the project, we can find that R.java is missing.

This is due to setup incorrect target build settings. Target build was set toAndroid 2.1 (SDK v7) where his layout XML used Android 2.2 (SDK v8) elements (layout parametermatch_parent), due to this there was no way for Eclipse to correctly generate the R.java file which caused all the problems.

Solution:

  • Remove  import android.R.*
  • Project->Clean , to regenerate R.java
Reference: