How to run those Android SDK example applications?

user569474 picture user569474 · Sep 8, 2011 · Viewed 11.9k times · Source

I have 64-bit Windows 7 Professional, Android SDK and ADT Plugin for Eclipse. In the examples directory of Android SDK there are at least three different directories for SoftKeyboard. Which one should I use?

How to run that SoftKeyboard? I tried, but it didn't work at all.

You can find it from here, too: http://developer.android.com/resources/samples/SoftKeyboard/index.html

Answer

user658042 picture user658042 · Sep 8, 2011

These can be imported as an existing project into your eclipse workspace. You can find the project files in the ANDROID_SDK\samples\android-XX\SoftKeyboard folder (where XX is a certain api level).

To import them inside eclipse, go to File -> New -> Other -> Android Project. Then select create project from existing source and select the folder above as the location. Pick the appropriate API level below if none is selected and press finish. And thats it, you got yourself a shiny new android project that you can run like every other one.

Keep in mind that all api samples come preinstalled in every emulator. So if you want to test this in a emulator, you have to uninstall the preinstalled version first. Either run adb uninstall com.example.android.softkeyboard from the command line of your OS or uninstall the examples via Preferences -> Applications in the emulator itself.

The different versions in the folder are for the different API levels (What is an API level?) of android. That just means they are written to support that api level and above. Depending on what has changed between the versions, there might be no difference at all between the files.