6

I'm learning android development.There is an apidemo app installed in the android emulator. I'd like have it installed in my real android phone so that I can use it without starting the emulator . How to do that ?

John Wang
  • 4,562
  • 9
  • 37
  • 54

3 Answers3

14

In Eclipse Android plugin (ADT) there is a wizard for creating the sample projects.

In eclipse Go to: File -> New -> Other ... -> type Android into search box -> Android Sample Project -> Next -> select your api level -> Select any of the samples, for example ApiDemos

Project called ApiDemos is created

Right click on it and select Run As -> Android Application

Peter Lamberg
  • 8,151
  • 3
  • 55
  • 69
  • 1
    In ADT 22.3.0, ApiDemo is marked as 'legacy' and its README says: "..use the compatibility library android-support-v4.jar. It is available through the SDK Updater in the Android Compatibility package." What it means is: In Android SDK Manager, have Extras / Android Support Library installed. Right click ApiDemos project > Android Tools > Add Support Library. Not sure if both are needed, at least the latter one is. – akauppi Jan 28 '14 at 10:46
4

Api Demo is part of the SDK

Go to where your SDK is installed samples/android-X/ApiDemo

(X being the version of the sdk)

then install that project on your phone

Jason Rogers
  • 19,194
  • 27
  • 79
  • 112
  • Found it, thanks! there are lots demos in that directory. Great! Have to compile all them to apk myself ... – John Wang Dec 17 '10 at 05:14
  • 1
    import/"create a new project from existing source" form that repertory and hit launch ^^ – Jason Rogers Dec 17 '10 at 05:25
  • 6
    With a recent Eclipse/ADT setup: File > New > Other..., Android > Android Sample Project, pick the config you want, then pick the sample from the list. Select the project and run it as an Android Application. – fadden Jul 25 '12 at 23:51
  • @Jason: what if we don't have Eclipse on our PC but we want to install those API on our real device? There is no .apk file there? – Vahid Ghadiri Nov 21 '13 at 09:10
3

In order open api demo in your eclipse File>new>Android Project
From that 'New Android Project' window, you select Create Project from existing sample
When you select your target, you can select 'Api-demo' from the samples list
This will open the complete api demo in your eclipse and when you run this project in device you will get it in device also. you can edit and use it as you wish.

Labeeb Panampullan
  • 34,521
  • 28
  • 94
  • 112