This question already has answers here:
How to download libraries in Android Studio?
(4 answers)
Closed 5 years ago.
I am just a student with a very very slow internet connection and laptop. My problem is most methods of adding volley to my android studio projects requires me to use gradle online mode so it can download it.
My problem is my internet connection is very slow, and my laptop is also not that fast therefore gradle offline mode is the only thing keeping my laptop from dying everytime I use android studio.
Is there any manual way of adding volley to my project or any alternative you may know of?
Please help me, I am just a student so I do not know much.
You can use this volley library
compile 'com.mcxiaoke.volley:library-aar:1.1.0'
Download Volley Jar File from here https://drive.google.com/file/d/0B2HGUM4c0YwpZFp2aUlnNjJvV2c/view
Steps to add Jar file in Android Studio :
Put the Volley jar (in my case, volley.jar) into the libs folder
Right click it and hit 'Add as library'
After Adding Check your build.gradle at app module, you get it added implementation files('libs/volley.jar')
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:appcompat-v7:26.+'
testCompile 'junit:junit:4.12'
implementation files('libs/volley.jar')
}
Related
Why Firebase dynamic link could not be made , i just don't get the reason behind dynamic link not being detected .It says that what i will need to do is put the library 11.0.4 of firebase invites in gradle. But that is also not working since my android studio fails to recognize the following library. So i don't get the reason behind the bull-bulkshit done by Google Firebase.
DynamicLink dynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse("https://example.com/"))
.setDynamicLinkDomain("abc123.app.goo.gl")
// Open links with this app on Android
.setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
// Open links with com.example.ios on iOS
.setIosParameters(new DynamicLink.IosParameters.Builder("com.example.ios").build())
.buildDynamicLink();
This is my gradle dependencies
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-invites:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
If anyone could help with that? Then please help with the fact that How to use Firebase Invite Api Sending intent with the other applications instead of being bounded by only Email and sms service?
Well, i solved my issue by doing some updating and though in the so called automated world we are surrounded in, there are few things which we need to do them manually.
So go in the settings and reach to the sdk tools option by searching in the settings dialog box.
After going there
STEP 2: Select the SDK tools and see there the google repository
option
STEP 3: If it is not installed then please install it and if studio
is showing you the update then too update it to lateset version
STEP 4:
Taadaaa...And now you are done
Now you can use firebase-invites-11.0.4 and thus you can use DynamicLinks class
I'm new to Gradle and I need to make sure that my Android project has the latest dependencies with regards to RxAndroid and RxJava. Forgive me for my ignorance but could someone explain how I go about to make sure that the libraries I include in my project are the latest ones? Where does Gradle downloads these libraries from? Is there a central repository? Is GitHub the source? It's not clear from the code shown below:
build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
}
I would really appreciate if someone could shed some light with regards to this topic.
Gradle downloads them from Maven or other repos. I don't believe GitHub hosts the libraries themselves, but the link to download the libraries could be found on GitHub.
To ensure they are the latest version, you will have to go the library's web page(Git hub page usually) and check if a latest version has been released.
If I am not wrong, you could add a + sign at the end and when you sync Gradle with work in offline mode turned off, it should fetch the latest version of the library.
Eg:
compile 'com.android.support:appcompat-v7:23.3.0+'
compile 'io.reactivex:rxandroid:1.0.1+'
The above line will ensure that 1.0.1 is the min version that you will download and if there are any higher version, it will download that instead.
WARNING : this is not a safe thing to do, because the latest version of library will be automatically downloaded and the changes in the newer version of the library might have breaking changes, and break your app. For instance the methods you use from a library might be removed in the new library or even worse things could happen and it has to me. I suggest you set some time apart once every few weeks and see if there are new updates and consider if it is safe to update.
Deciding to add a library to your project must be carefully thought through, as you are making the project dependent on it and if that library dies out or is buggy, your project too will be screwed. Incase you didn't, I suggest you read this on how being careless with adding dependencies literally broke the internet.
You can just add a plus to the end of each, although it's not recommended as sometimes new libs will break your code.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0+'
compile 'io.reactivex:rxandroid:1.0.1+'
compile 'io.reactivex:rxjava:1.0.14+'
}
Here are the latest:
dependencies {
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'io.reactivex:rxandroid:1.2.0' // Upgraded
compile 'io.reactivex:rxjava:1.1.5' // Upgraded
testCompile 'junit:junit:4.12'
}
check here
I work with Android and I use some libraries on dependencies (build.gandle).
example:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1#aar'
compile 'com.daimajia.androidanimations:library:1.1.3#aar'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
}
I'm new in xamarin development and I wanna know if there something which i can use my android libraries on xamarin
thank you
I think you can make use of Xamarin.GradleBindings, Visual Studio extension, creates Xamarin Android Binding projects from external dependencies ids via gradle.
How do java developers add dependencies to their projects? Yes that's right, via gradle (something like this or that). As you can see some java-projects use those dependencies a lot (all you want to write is already written) so it'd be nice to use those huge amount of 3rd party libraries in your Xamarin project, right? I believe this Add-in for Visual Studio 2013 (and lately for Xamarin Studio) will help you with it:
Step 1: Execute the command over "References" folder
Step 2: Set an external dependency id and a name for Xamarin Android Binding Project (will be generated). This dialog will allow you to specify custom repositories as well soon.
The Plugin executes gradle scripts and receives dependencies list (including transitive ones). At this step you can select or deselect needed binaries (transitive dependencies are deselected by default).NOTE: you'd better use "Xamarin Components" or directly NuGet for Support dependencies(v4, RecyclerView, AppCompact, etc..).
Step 3: The binding project will be generated but you still may have to fix some issues via Metadata.xml because the Add-in is not smart enough.
Step 4: Now you are ready to use them! i.e. the Material Dialogs:
Reference :
https://visualstudiogallery.msdn.microsoft.com/3a3257c7-473a-4790-9610-9a561eed0b8c
https://github.com/cfraz89/xamarin-gradle-plugins
I'm using Crosswalk with graldes.
When i'm trying to load https from XWalkView, I'm getting a SSL Certifcate Error Alert.
I heard solutions working with Cordova that you need to edit files but, not even possible since I get my dependencies from gradles here:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'org.xwalk:xwalk_core_library_beta:11.40.277.6'
}
I also see that you could, with past version, override a Client, but it seems not to work with my version, and i don't want to get past version.
How can I resolve this SSL error?
I have an existing app which I have unfortunately haven't had time to update it in quite a long time. I am now trying to do some work on it but it won't compile.
It was originally an Eclipse project so I've now imported it into Android Studio, my build.gradle has the following:
dependencies {
/*compile 'com.google.android.gms:play-services-ads:7.0.0'
compile 'com.google.android.gms:play-services-drive:7.0.0'
compile 'com.google.android.gms:play-services-identity:7.0.0'*/
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/android-support-v4.jar')
compile files('libs/commons-codec-1.4-javadoc.jar')
compile files('libs/commons-codec-1.4-sources.jar')
compile files('libs/commons-codec-1.4.jar')
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.BoardiesITSolutions:CritiMon:1.0'
compile 'com.BoardiesITSolutions:Library:1.1'
compile 'com.google.android.gms:play-services:4.1.+'
compile('com.google.api-client:google-api-client-xml:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2+'
}
I am trying to point it at the old versions of Google Play Services, the bit of code below which was originally working but now it no longer is.
Drive service = getDriveService(credential);
String fileId = null;
FileList file = service.files().list().execute();
The problem is services.files() cannot be resolved.
I am assuming this is because of the Drive API being updated so is there a way that I can use the previous version that supports the above code.
At the moment I don't have time to update the Drive API but I need to fix a bug that someone's reported.
Update
I've found the following https://developers.google.com/drive/web/migration page which says that there aren't any real changes apart from a variable name for the file id but everything is the same so I don't understand why the service.files() function wouldn't be found.
To consolidate the comments (esp #kroikie) into an answer, you have confused the Java library for the REST API (which can run on Java/Android and is represented by com.google.api.services.drive.Drive) with the Google Drive API for Android ("GDAA" - which simply reads and writes to the Drive storage area on Android and lets the Android Drive app do the syncing, and is represented by com.google.android.gms.drive.Drive).
This guy The method permissions() is undefined for the type Drive has done the same thing, which suggests that the Google documentation is failing to make it clear that there are two different ways that Android-Drive integration can be achieved. I've seen people refer to the REST API as the "old api", which is a complete misnomer and suggests that some people have drawn the false conclusion that GDAA replaces the REST API which it most certainly doesn't.
So in your case, expunge com.google.android.gms.* from your app and you'll be fine.