I am using Android Studio as an IDE to develop the Google Glass Application.
Here is the code I am using:
Intent intent = new Intent(context, com.google.zxing.client.android.CaptureActivity.class);
But it gives the error saying cannot resolve symbol 'android'.
I have added the Gradle dependency as below:
compile 'com.google.zxing:core:2.3.0'
Because of this, I cannot run the project. Please let me know what can be done to resolve the issue. Also if any other or better alternative is available, please let me know.
Since you are just including the ZXing core you won't have any of the Android code for ZXing.
Take a look at BarcodeEye: https://github.com/BarcodeEye/BarcodeEye
Adding core won't do anything if you are integrating by Intent. You need android-integration, if anything, to use IntentIntegrator. Starting the Intent as you show won't quite work. Also, you should use a much newer version -- 3.1.0, not 2.3.0. Finally you need to build and install the Glass app, which is in the project at glass/. I have not tested it with Intents but someone mentioned it works?
For scanning bar codes I'm using zbar libraries. I have downloaded and added the zbar.jar into the libs folder of my Android Studio Project and then added to the gradle dependencies like:
dependencies {
....
compile files('libs/zbar.jar')
}
Related
How to add this library (https://github.com/swapnil1104/CurveGraphView) to Android Studio project? I've tried so many things and still can't figure it out...
I just started to learn, so if you can in more detail. I tried to import through the build.gradle file, well, I constantly see an error enter image description here
You are tru to use this gradle link to implementation in gradle file.
implementation 'com.github.swapnil1104:CurveGraphView:2.1'
Hello I am new to flutter and i want to do native function calls using flutter, i wrote an sample native code app and it is working as expected. Now i want to use some packages on my android code, which is platform specific.
I have added my dependcies in my build.gradle file and it the gradle build is success,
But i cannot use the package there,
say for example: i have added the dependency for the com.squareup.okhttp3:okhttp:3.4.2 and gradle build is success and now icannot access their methods and other stuffs. Please let me know to what to do with it. Thanks in advance.enter image description here
Finally it worked, i opened the android project as an new android project in android studio which resolved the issue.
I am trying to implement file picker using droid ninja but it seems the version of droidninja doesn't have exact same functions I am using following an example. Can anyone suggest me correct version of droidninja with correct example.Both should be compatible. I am using Android studio 2.3.
Thanks in advance.
The latest version of this library is 2.0.3.
Just add your app's gradle file to this:
dependencies {
compile 'com.droidninja:filepicker:2.0.3'
}
This Link clearly shows the necessary instructions.
I have followed the procedure as described here : Setup
I have clicked on the little 'Sync project with Gradle' button. Gradle and Android Studio seem to find everything but then I can't actually use the gms code. If I try to import, I will get autocomplete for com.google.android.gms but no further. I have updated all the packages with Android SDK Manager.
I'm running Android Studio 0.4.2.
My minSdk is set to 9
my build.gradle includes compile 'com.google.android.gms:play-services:4.0.30'
As far as the procedure is concerned I should be ready to code, but it just doesn't work. Any ideas?
[Edit, added info]
I can find the ComGoogleAndroiddGmsPlayServices3265.aar file in my exploded bundles directory. Inside of that file I also find the common directory and inside that I find the GooglePlayServicesUtil.class (which is what's not being found in my app)
I am lost.
[Edit 2]
The problem is not specific to Google Play Services OR Android Studio. I tried adding another library (HoloColorPicker) and had the same results. However, I was able to add the library's resources to my project! I was able to add them in my XML layouts and view them in my application. I was able to interact with them, they worked fine. The problem arose again when I tried to reference them in the code. Exactly like the case with gms, I had code completion when trying to import up to the point of the actual class, and I could not declare the class in the code.
I was able to use the library by cloning it and importing the project.
Also, this is not an Android Studio problem because the same thing happens on the command line with "./gradlew clean build"
This is a current bug in Android Studio: https://code.google.com/p/android/issues/detail?id=64508 to be fixed this week.
The workaround is to close the project, delete the .iml files and .idea project and re-import the project.
Keep Your compile 'com.google.android.gms:play-services:4.0.30' as very first line in build.gradle dependencies like
dependencies {
compile 'com.google.android.gms:play-services:4.0.30'
compile 'com.android.support:support-v4:18.0.+'
compile 'com.android.support:appcompat-v7:+'
}
`
Open File> Project Structure and do the following steps
Select your main module in which you want to add dependency and click on OK.
Now try to import.
I think the most important question is what you want to achieve. Not all code is under this package. Not even sure which one is.
As noted before, this is a bug with Android Studio. It just don't recognize the path for classes and shows you like if there is an error. If you try compiling you'll see that everything just work fine.
A googler recently said it'll be addressed in this week release, so, be patient and lets see whats coming.
The fact that AS is in Preview mode tell us this sort of things are going to happen :)
Android studio is crazy one, I think.
It's removed "Import module" function and you can do "New module" only.
If you are developed on Eclipse, you need export all your projects to Gradle before switch to Androids studio (WTF?)
I prefer "IntelliJ IDEA Community Edition", although It's similar Android studio but it's better than Android studio (at least until now). You just import your project as eclipse format, IntelliJ IDEA will detect dependences libraries automatic (May be you need import jar libraries by hand) and rebuild project. That Done.
I am using android studio for app development and i am using it from its 1st release, i keep updating it whenever a patch is available.Recently I updated my android studio to latest version , that is 0.2.9 and now i am facing problem while creating new project.
every time i am getting this exception msg box
The following dependencies were not resolvable. See your build.gradle file for details.
- com.android.support:appcompat-v7:18.0.0
and i am clueless about what went wrong !!
p.s : previous projects are working fine
seeking suggestions on it :)
Make sure you download the Android Support Repository under Extras using the SDK Manager
The in your project module look for the second build.gradle file uncomment the dependencies section that is pointed in your case, the file provides some instruction on what you have to do.
With that in place save, build and test, happy coding!