Cannot import com.android.internal.app in Eclipse - android

I cannot import com.android.internal.app in Eclipse. I created Android Project, but those apps are invisible. Should I change something in projet properties?
I want to import:
import com.android.internal.app.AlertActivity;
import com.android.internal.app.AlertController;
Thanks for any suggestions!

com.android.internal.* classes are internal classes of the Android Framework that are not intended to be public and thus they are not visible in the Android SDK. Those classes are subject to change from the Android Team without notice to developer. It is not recommend to use them for developing application as it is very likely that you app will be broken in the next Android release.

Related

How to import "android.support.wearable.watchface" in Eclipse for Android Wear?

I'm doing my best to figure out how to develop apps in Eclipse for Android Wear (I really don't like Android Studio). I have made a couple of apps so far for Android Wear in Eclipse that work perfectly fine, but I'm running into a big problem when trying to create a Watch Face.
I can't import the following:
import android.support.v7.graphics.Palette;
import android.support.wearable.watchface.CanvasWatchFaceService;
import android.support.wearable.watchface.WatchFaceService;
import android.support.wearable.watchface.WatchFaceStyle;
I have added the wearable-1.0.0.aar as a library as discussed here. I have tried adding as an external jar the "android-support-v7-appcomapt.jar" file located at "...sdk\extras\android\support\v7\appcompat\libs", but still no luck.
I am using the "Watchface" example given by google. When using it in Android Studio it works perfectly fine. The exact error I'm getting is:
CanvasWatchFaceService cannot be resolved to a type
Also, in my project under Android Private Libraries I have "classes.jar" and "android-support-v4.jar".
Does anyone have a fix? I figure it has something to do with external libraries and/or a jar I've missed.
Managed to figure it out. For anyone else who comes across this thread, the answer lies in the wearable-1.0.0 library in that it does not contain CanvasWatchFaceService. After looking through some of the other wearable projects, I found that the later versions have it. Just go to ...sdk\extras\google\m2repository\com\google\android\support\wearable. I chose the wearable-1.4.0 version.
Also, I added the external jar "android-support-v7-palette.jar" from the Android tools folder.
Now everything works perfectly for me.

Auto import namespace in IntelliJ

In IntelliJ you can press Ctrl-Alt-O to import namespaces for classes that are being referenced. I did this and it did import some classes but not others. I'm actually using Android Studio which is based on IntelliJ. The class I'm trying to import is IBinder but when I hover over the class name it indicates:
Cannot resolve symbol 'IBinder'
Since this is based on Gradle, am I suppose to manually include something in the build.gradle? Or does Android Studio automatically add the dependency for the classes I want to use? IBinder is a rather standard interface, so I can hardly believe I need to add something special.
You mean android.os.IBinder?
A simple import android.os.IBinder should work, shouldn't it?
BTW, on my Android Studio (default) installation, Ctrl-Alt-O organizes imports, but does not import them.

Google APIs: downloading and reading the sources

My goal is to understand every single bit of the following example:
http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager
I can run the example successfully, but now I want to understand every single
line of code in the example. For as far as the standard android APIs I can look
up their function by googling them up and looking at developer.android.com, but
for the other lines that come from the Google APIs I cannot find the up-to-date
1.6 sources on the web for clsses such as the following:
import com.google.api.client.extensions.android2.AndroidHttp;
import com.google.api.client.googleapis.auth.clientlogin.ClientLogin;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.InputStreamContent;
import com.google.api.client.util.DateTime;
import com.google.api.services.picasa.PicasaClient;
import com.google.api.services.picasa.PicasaUrl;
import com.google.api.services.picasa.model.AlbumEntry;
import com.google.api.services.picasa.model.UserFeed;
I cannot see any JavaDoc in eclipse, so the only alternative I have to learn about
these is to look at the code. How can I use mercurial to sign out up to date copies
of the Google APIs including those classes that can be used on android?
I think, since I cannot find what I want on the web is to grab the sources
as that seems to be the only way to learn what I need, but I don't know how
to use hg to do this, because I don't know how to use hg nor the site where
I can get the sources from.
Thank you for your help,
John Goche
If you are using Eclipse the following post might be useful:
Attaching Android platform source in Eclipse
I had the same problem before and read through the previous answer on how to setup the build environment for Android. Unfortunately, the build environment so far does not support Windows Box. So a quick way is to download the source for a particular android version (e.g. 2.2) and extract to a local directory. In your Eclipse project, right click on android.jar to open the properties dialog. click on Java Source Attachment and enter the root directory of your source. Then refresh your project. You're set to debug through the source on Windows.

how to import android licensed project in eclipse?

Can anyone help me to know how to import licensed project, while trying... the following classes cannot be imported.
import com.android.vending.licensing.LicenseChecker;
import com.android.vending.licensing.LicenseCheckerCallback;
import com.android.vending.licensing.ServerManagedPolicy;
import com.android.vending.licensing.AESObfuscator;
Any help will really be appreciated. Thanks
The latest version of the LVL seems to require
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;
import com.google.android.vending.licensing.AESObfuscator;
instead of
import com.android.vending.licensing.LicenseChecker;
...
(as the current document tells me to do)
It took me a half day to figure this out.. haha
LVL library can be downloaded using the SDK Manager
Link
The License Verification Library (LVL) is a collection of helper classes that greatly simplify the work that you need to do to add licensing to your application. In all cases, we recommend that you download the LVL and use it as the basis for the licensing implementation in your application.
The LVL is available as a downloadable component of the Android SDK. The component includes:
The LVL sources, stored inside an Android library project.
An example application called "sample" that depends on the LVL library project. The example illustrates how an application uses the library helper classes to check and enforce licensing.
To download the LVL component into your development environment, use the Android SDK and AVD Manager. Launch the Android SDK and AVD Manager and then select the "Market Licensing" component, as shown in the figure below. Accept the terms and click Install Selected to begin the download.

Getting error while creating android live wallpaper - "Wallpaperservice cannot be resolved a type"

I am developing live wallpaper for android.
I am getting error "Wallpaperservice cannot be resolved a type", so it seems like I need to import some package for the same.
I imported package android.app.Service package, but eclipse is showing that package is not available.
So, do I need to download this package manually or anything else.
Please guide.
You need
import android.service.wallpaper.WallpaperService;
But maybe your problem is your build target? You need to specify API 7 (Android 2.1) or higher.

Categories

Resources