• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Package Imports

sehudson

Newbie
I am running an example program that needs to import:

com.example.android.apis.R

Where can I get this? I can't find it in any of the sample folders in my sdk
 
Did you see this in the source code? and there that you got the code didn't have any documentation on it??

from the looks of it, you either have to add the repository of the site that you got the code in eclipse and download it or, you have misunderstood something because I don't understand where this program is supposed to run!

anyway, have in mind that android sdk is not a complete toolset for development and "addons" are a thing to consider when implementing something specific.
 
What I understand Is that this is the package of the CameraPreview example... and for some way they need it in the source code to get access of the resources.

If you implement this camera example on your own (even by copy/paste) you don't need this. just exclude it.
 
ok, this is because you miss the resource code... (xml etc). Apparently I was wrong, sorry. This code is not going to work as it is via (copy/paste) You have to download the whole package via eclipse. Try:
eclipse->Window->Android SDK and AVD Manager->Available packages->Android Repository->Samples for SDK API (??) revision(?)

any progress?
 
I tried to do the import but for some reason its still not recognizing com. anything.

The head of the example says:

The file containing the source code shown below is located in the corresponding directory in <sdk>/samples/android-<version>/.
 
if you were successful with downloading the package, go to eclipse, and:
file->new->other->Android->android project->next->check "Create Project from Existing Sample"->ApiDemos->finish. now go to the package explorer(eclipse) and navigate to the src com.example.android.apis.graphics and then to CameraPreview.java

You should see the full working code now.
 
Back
Top Bottom