I am developing an app in Android Studio with target for API 22. I have tried to use the Log class with the method d() but I did not find it. The helper shows only Log()...
What am I missing?
Just import the library import android.util.Log;
And just tips: use alt+space and alt+enter feature from Android Studio
Note:
Alt + Enter = Project quick fix (show intention actions and quick fixes)
Related
I'm confused.Why okio cannot find this package in IDE and android cannot use this packgae based on 'How to use java.nio.file package in android?', but okio still works? How can I do this like okio?
Hi i want to use ArcAnimator and ArcLayout in one android project .
for that i using this dependencys
compile 'com.ogaclejapan.arclayout:library:1.0.1#aar'
compile 'com.github.asyl.animation:arcanimator:1.0.0'
but i give this error message
cannot resolve symbol'SupportAnimator'
cannot resolve symbol'ViewAnimationUtils'
in import line
import io.codetail.animation.SupportAnimator;
import io.codetail.animation.ViewAnimationUtils;
and its strange because i do not give this error in this lines
import io.codetail.animation.arcanimator.ArcAnimator;
import io.codetail.animation.arcanimator.Side;
which is in same library.
can anyone help me about that?
You have to use other dependency to use Support Animator say https://github.com/kedzie/Support_v4_NineOldAndroids. Support Animator is not there in the package of the library that you have used. It’s not showing inside the package you have used, you can check at https://github.com/asyl/ArcAnimator/tree/master/animator/src/main/java/io/codetail/animation/arcanimator.
Also you can take help of some samples given here at https://github.com/ozodrukh/CircularReveal/releases.
I have an Android 2.2 targeted library project, whose MyLibraryGooglePlusSocialPlugin.java has a import com.google.android.gms.plus.GooglePlusUtil; being failed to compile (GooglePlusUtil cannot be resolved), while others are okay:
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.Scopes;
import com.google.android.gms.plus.PlusClient;
import com.google.android.gms.plus.PlusClient.OnPeopleLoadedListener;
import com.google.android.gms.plus.PlusClient.OnPersonLoadedListener;
import com.google.android.gms.plus.PlusShare;
import com.google.android.gms.plus.model.people.Person;
import com.google.android.gms.plus.model.people.PersonBuffer;
I've updated the related Google services through Android SDK manager today, and set the build path and dependencies.
The GooglePlusUtils class has been removed because you no longer need it. All of the existing error handling functionality has been integrated in a way that doesn't require developer intervention.
As an example of how you can migrate from using this (now deprecated) class, see the following change from the Google+ Photohunt Android client sample that resolves the issue:
https://github.com/gguuss/gplus-photohunt-client-android/commit/090c22b4721fde6859361aca210823822c218da8
I work it around by downgrading to a previous version where the AndroidManifest.xml in the google-play-services_lib goes like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms"
android:versionCode="3159130"
android:versionName="3.1.59 (744626-30)" >
<uses-sdk android:minSdkVersion="8"/>
</manifest>
UPDATE
I downgrade the library by reloading a lower version that was saved in my local disk. No idea how to downgrade through Android SDK manager.
Their documentation has not changed online, but it is indeed missing form the jar. I would look for a copy of the last version and use it for the time being.
** UPDATE **
You can do the same things with the GooglePlayServicesUtil and checking to see if they user has the correct package name for Google Plus.
The old GooglePlusUtil + error codes are not needed now, because even if the device has not installed GooglePlus application, GooglePlay services provides connection to user account. You can only check if GooglePlay services is present and updated using GooglePlayServicesUtil.isGooglePlayServicesAvailable and hide UI field with GooglePlus. In other case connection to user (GooglePlus) account will be made.
I am trying use the GPE code for App-Android Android-App communication. Both the two new created folders (Android, AppEngine) have errors. I think the problem is that there are
errors with the packages:
import com.google.web.bindery.requestfactory.shared.InstanceRequest;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.RequestFactory;
import com.google.web.bindery.requestfactory.shared.ServiceName;
It says "The import com.google.web cannot be resolved." I tried adding everything able to be checked checked in the build path. I also know I installed the Web Toolkit and everything. What is wrong?
Statements like the following also have error markings:
#ProxyForName(value = "com.glm.server.Message",
locator = "com.glm.server.MessageLocator") and actually there are so many errors it must be the imports.
I'm building a really simple Android project in ADT and using Maven. I have included both the slf4j-api and slf4j-android dependencies and I can see that everything is compiling properly. However, when I run or debug the application on my Nexus One, I don't see any log output. Is there a specific place I should be looking for these logs or should they be coming out in the Eclipse console?
For reference, here's my main activity:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.app.ListActivity;
import android.os.Bundle;
public class HomeActivity extends ListActivity {
private static Logger logger = LoggerFactory.getLogger(HomeActivity.class);
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
logger.debug("onCreate");
}
}
Android by default tells slf4j-android to not to log debug messages, and log4j is polite enough to honor that. Use the impolite https://github.com/mvysny/slf4j-handroid instead :)
I use slf4j as well for logging. The log output shows up on the LogCat window. I'm not sure if there's a way to see it in the Eclipse console. In the Eclipse top-level menu, navigate to: Window -> Show View -> Other. When the dialog appears, expand "Android", and select "LogCat". It doesn't show up by default, unfortunately.
HTH,
Kevin
You may want to have a look at using slf4j together with android-logging-log4j. Also see log4j support in Android.