0

May be a repeated question, but finding hard to import APIDemos of Android L(5.0) in one shot.Sample are downloaded but unable to import. Help is appreciated.

NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
  • try out Android Studio ;) – Nadir Belhaj Sep 12 '14 at 14:13
  • The key is not to import them. If they're downloaded, then it means they're easily accessible from Eclipse either through the new android project wizard, or some other wizard (after you've selected the right target api of course). I'm sorry I can't be more precise, I'm on Android Studio and I haven't used Eclipse ADT in a while. – Stephan Branczyk Dec 21 '14 at 11:49
  • Starting with Android 5.0 (i.e. the `samples\android-21` folder) the sample projects included with the Android SDK are in Android Studio format. Converting them back is pretty easy, but it has to be done manually, AFAIK there is no tool that does this conversion. – matiash Dec 22 '14 at 00:38

3 Answers3

2

Sorry for my poor English!

To achieve the goal of running apidemos from the official sample in my Android's mobile phone (ignore if not), I delete two activity classes which import com.google.android.mms.*. Then the errors disappear. I run this apidemos project successfully!

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55
Edidada
  • 49
  • 6
0

I did the following -

  1. Eclipse -> Android SDK Manager -> Android 5.1 -> Samples for SDK select the checkbox and click install.
  2. It will download the samples. APIDemos would be found in sdk\samples\android-21\legacy\ApiDemos
  3. In eclipse import the APIDemos
  4. Make sure propoerties -> Google API - Android 5.0.1 is selected
  5. Add support libraries
  6. Clean build

Note: You may get error in related to MMS codes, which you can exclude from build.

Ramesh Prasad
  • 361
  • 2
  • 8
0

I got to be honest... I love Eclipse, truly, and I still use it for some projects I'm working on... BUT... Google have made up their mind, and although it seems frustrating, annoying, and sometimes slow Android studio is the only viable tool to work with the latest SDKs, every action that requires a single intervention in Android studio will take some decent Eclipse customizing, also the support libraries are provided as AARs so it takes longer to set it all up for Eclipse.

I've read and read that people use Gradle for Eclipse as a solution, but again, some decent customizing will be required as the aar resolving is not done automatically!

So my advice is, open these in Studio, once Android Studio is set up, it will take a few clicks to open the demo project. (you can simply choose from the menu File->open example/sample project)

Community
  • 1
  • 1
TacB0sS
  • 10,106
  • 12
  • 75
  • 118