I recently updated ADT to point to Google APIs 18. The install went fine it seems and I'm able to point my Project Properties to Google APIs 18, however, Eclipse can't find the package com.google.cast. Anyone else having this problem?
That's because com.google.cast is not part of Android.
Near as I can tell, you will need to download a ZIP file containing their library project, import it into your IDE, mark it as actually being a library project, then attach that library project to your app.
Actually using those APIs appears to require a whitelisting, and it is in violation of their license to actually distribute an app (or, near as I can tell, source code) without express written permission of Google.
CommonsWare is correct, additionally, you'll need the v18 Android Support Libraries. v7/mediaRouter & v7/appCompat
I finally got this to work for me. Originally, I tried doing it like I used ActionBarSherlock (making it a library, went to Project -> Properties and told it to use that library, etc) but that didn't work. Finally, I got frustrated and simply moved the GoogleCastSdkAndroid-1.0.0.jar file from the lib folder of the library directly into the lib folder of the project.
So, again, I imported from existing code the SDK into my workspace, then took the jar file from its library and put it directly into my project's lib folder. Not sure if that's how it's supposed to be, but the sample TicTacToe game is now error free and runs on my Nexus 4.
It sounds like you're trying to run one of the Google Cast sample apps without having installed the Google Cast SDK. The instructions for installing the SDK and all necessary support libraries were just uploaded here on GitHub. I'm quoting below the relevant section for installing the Cast SDK itself:
http://developer.android.com/tools/support-library/setup.html#libs-with-res
You can either add the Cast SDK as a library project in your workspace, or add
the GoogleCastSdkAndroid-x.x.x.jar directly to the project you're building. The
former is recommended if you have multiple Cast-related projects in your
workspace.
As a library project: Follow the Support Library setup instructions linked
above for your downloaded and extracted SDK.
As an included library:
Copy the /libs folder from your downloaded SDK to your Cast-related project.
In the Package Explorer window, open (your Cast project)/libs and right
click on GoogleCastSdkAndroid-x.x.x.jar. Select Build Path->Add to Build
Path.
Related
I developed an Android app with Android Studio and I want now to create a SDK to enable other developer to use the technology I created. This SDK should use an activity and a couple of background service.
I've looked around on internet and on SO, but I did not manage to find the basic information I need :
How to set Android Studio to build a SDK , not an APK;
Is there any security to implement so that my code is not readable by others?
I created an app but I have no basic knowledge on building SDK, so any information or link where I can learn would be appreciated.
According to me what you require is a .aar file. Just like you give out Java sdk's as a jar, you can package your Android code as a .aar file. This can be imported in any other Android project and your exposed API's / screens can be used directly.
To create an aar select your module in Android studio project structure- then on the right pane select gradle and then select generate .aar file. This will be generated in your build/outputs folder.
Now this can be added in any project and compiled by putting a dependency in the gradle. You can Google "creating an aar" for more information.
I've downloaded the source code of android widget "TextView".
I included some other packages, but Eclipse can't find them.
I've checked android source again and they exist there.
import android.content.UndoManager;
import android.text.GraphicsOperations;
import android.content.res.CompatibilityInfo;
So why doesn't Eclipse them? In source code they are also public.
I'm using Android 4.4.2.
If you are trying to build something that is part of AOSP and import it into eclipse, then you need to let eclipse know what those other packages are. Based on android, eclipse only knows about packages that are part of the SDK. This does not include all packages that are part of android.
If you look through the AOSP files, you will find methods and variables that are hidden. Some classes are simply not included in the SDK. Other packages are considered to be "internal" and thus you can not access them easily (infact, if a package is internal eclipse has a line that will specifically block all packages from being imported).
Most likely, you have not updated your build path to include an updated framework.jar file. There are quite a few resources available for these tasks. This answer here: How do I build the Android SDK with hidden and internal APIs available? will give you a quick rundown on how to get a framework.jar file simply if you are building aosp.
If you aren't building AOSP, I suggest you check out this guide here on using hidden and internal parts of the API. From a quick glance, it doesn't look like any of those packages are internal, so you should be fine by just importing the framework jar which contains all the classes and hidden methods.
Good luck!
Just a little list of quick fixes:
try right click on your android-project -> Android Tools -> Fix Project Properties
right click on your android-project -> Android Tools -> Add Support Library...
is your SDK up-to-date? You can check this in your SDK Manager
last thing: go on Project -> make sure that Build Automatically is checked and then do Clean...
I was using the Android developer guide to learn. On my first run, I ran into a number of problems setting up the v7 appcompat library which caused more errors for the next steps ahead of the guide. I had to restart coding the guide.
However, I am not sure how to remove the support library (I want to start over), which is currently on the same directory of my app folder. I am using Eclipse IDE. Can I just delete it from the Package Explorer? Will that wipe the library clean? If not, how should I remove the library to re-learn?
I have an Android Apps (A) project that depends on a Library project (B). The library project contains code as well as third-party jar files and some other jars that were exported from projects C and D. In Eclipse, I have project B specified as a library project.
However, when I connect my device and run project A (Run As -> Android Application), it crashes on the device and when I examine the LogCat output, there is a NoClassDefFoundError exception for one of the classes that exists in the jar files of project C.
When I unpack the B.jar file in Project B's bin folder, it does not contain anything else besides the META-INF/ folder with an empty MANIFEST.MF file. So this indicates that something seems to be going wrong someplace, but I'm unable to figure it out.
Could anybody help me with this issue?
Are you working with the latest ADT plugin and SDK revision? That is rev 22.x. If so there has been an important change to the dependency management.
Possible solution
For some reason the contents of the Order and Export tab has completely changed and you now have to export the Android Private Libraries from your library projects. See screenshot below:
More details
The tricky part of this change is that your project still compiles properly in Eclipse so you're not aware of any issues. Until you deploy the app on an emulator or device and you get the ClassDefNotFoundException on any call of a library project.
Not confirmed but I believe this is related to recent changes for maven support, also related to android studio preview
Similar change in the past
This reminds me of a similar change in the update to rev 17 where the lib folder suddenly changed to libs and all content from the original lib folder wasn't packaged so you wouldn't see any issues in eclipse. Only once installed on a device.
More information that 'issue' is available on this link. If you search on stackoverflow for "sdk 17" and "classdefnotfound' you'll also get enoug questions about that change.
I am using the google drive api for android in eclipse, how do I link the documentation so that when I hover over something, I can view the java doc for it.
Assuming you are using the Android Development Tools (ADT), see https://stackoverflow.com/a/11579339/1369991 on how to do it.
Note that the contents of the libs folder will be bundled with your application. So you really should put the source and Javadoc JARs in another folder or even keep them outside of your workspace. Everything described in that answer also works with external JARs -- on Windows you just have to use \\ or / instead of the usual \ as path separator.
I just found Google Plugin for Eclipse and the 3rd dot says Importing the latest Google APIs