How to add two librarys with same name to Eclipse? - android

I'm trying to add Google Play Services and Google Play Services for froyo library to my proyect but Eclipse don't let me, the reason is I need the new library for Chromecast compatibility and need the old one to make work Admob on Android 2.2 devices.

Use same android-support-v4.jar library in both library and your main project.
To do this remove android-support-v4.jar file form both library and your main projects build path and then remove android-support-v4.jar from your libs path. Then reinsert same android-support-v4.jar in both library and main project. Then use add to build path to add lib to your projects.
This will solve your problem.
Please read more Error on add library project in eclipse

Consider the business proposition. Froyo devices account for exactly 1.0% of the market (as of 1-MAY-2014). How many $$ worth of effort do you to spend to cater to that 1%?
Suggest you drop support for advertising for Froyo devices. Let them run the game for free.

Related

Using selective APIs from Google Play Services in Eclipse

In my project I am integrating push notification for that I require classes from com.google.android.gms package.
Is it possible for me to include selected package from whole library?
I am using eclipse. actually there are lot more libraries required, due to which I am facing 65k multidex issue. Any solution?
If you really really want to use the Eclipse to compile this, you need to perform these steps:
Have someone with Android studio include your needed Google components as dependency.
Kidnap the components from exploded-aar Android studio folder and setup the components as your own Eclipse library.
But of course, this is highly not a recommended procedure, but this is for those people who desperately needs it as last resort. This also marks a disclaimer that the kidnapped libraries are already free from the developer's accountability, because you didn't compile it the right way.
PS. Did this with Google Maps
If you want to use selective components of the Google Play Services you will need to switch to Android studio.
Read this: (Source)
Important: Support for the Android Developer Tools (ADT) in Eclipse
has ended, per our announcement. You should migrate your app
development projects to Android Studio as soon as possible. For more
information on transitioning to Android Studio, see Migrating from
Eclipse ADT.
If you still want to continue using eclipse, you'll have to to the hard work yourself - of deleting the unwanted packages/components from the full source code and making sure it compiles and works fine.
Instructions of setting up selective APIs can be found on this page, for android studio. For Eclipse, as the documentation says nothing about setting up selective APIs, you just have to go with the whole set.
NO. you have to migrate your code to Android Studio.

Unable to find package com.google.cast

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.

Compatible with older versions of Android

http://developer.android.com/training/implementing-navigation/nav-drawer.html
I have implemented this feature, it quite well works on android 4.0 and up.
But I need to make this project compatible with android 2.2, 3.0 etc.
I tried to add android-support library but it does not work, since someone suggested to do so.
How can I achieve my goal?
It should work with adding the support v4 library jar. However, it is recently added and using an older version of this jar will result in errors.
Update your ADK & ADT and start a new Android project. This will create a new project with the latest and greatest support v4 library. Just copy-paste that in your libs/ folder of your own project to replace the old one.

Can't create Android App without Compatibility library?

I'm trying to create a small Android App, without the compatibility library for fragments and stuff. Just a simple app. When I get to the "install dependencies" step in Eclipse, the next and Finish are greyed out. How do I continue? Are all new apps really required to have compatibility library?
Anyway you can delete the compatibility library later in Eclipse from your project's libs folder and remove it from Build Path.
Why to do that though?

Purpose and Disadvantages of an Android Library Project

At the moment I have two versions of my App: normal and plus
When I puplish a new relese I export it and then change the packet name and export it a second time. The plus version has some additional features which get unlocked by the package name..
I just discovered Android Library Projects (http://bit.ly/voHVWe) and now I wonder if that could be solution for optimizing the workflow decribed above?
A further question is, are there any more (dis-)advantages of using library projects?
- or would you propose another workflow?
Library projects can help you do exactly what you're looking to do. They're essentially like having an external assembly. All shared code would be in the library project, and each application (in your case, normal and plus) could utilize or inherit from the shared library code.
One gotcha for the library projects is that you need to make sure the application projects are using the latest version of the library project if you make any changes to it. I've been bitten before when I made a change to a lib project, and built the application to find out that it was using the old code (in eclipse just select the greyed out project, right-click and refresh).
This is the preferred way of developing apps with common resources and source code. There are some considerations to be made that are covered in the Managing Projects Developer Guide article.

Categories

Resources