Reputation: 1908
I am trying to build a JAR
plugin for an android application. The plugin has two dependencies :
android AsyncTask
which I have imported using maven (and looks fine) and android support which I am unable to import it correctly.
Specifically I need to import :
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
When I make this call, android.os
and android.util
are red, as if they can not be imported.
I am importing android support by using the Project Structure / Libraries tab
. I direct it to the android-support-v7-appcompact.jar
file located in my android sdk folder. I have imported this library and included it as a dependency in my jar module.
What am I doing wrong ?
Upvotes: 1
Views: 351
Reputation: 16976
The thing is, you were trying to add Android
's Handler
or os.Looper
from android without adding any libraries or...
in java, we can use : import java.util.logging.Handler;
instead of android.os.Handler
.
And as you said, you have to add that android.jar for supporting above imports into your java project.
Upvotes: 1
Reputation: 1908
I was mistaken. I did not need android support. What I needed was android.jar. This was located in %SDK%\platforms\android-23\android.jar
Upvotes: 1