How to Realm setup in Android - android

I am facing an error when including Realm API in to my Android project
Please provide instructions to set it up in Android studio.

make sure you have included
compile 'io.realm:realm-android:0.80.0'
under dependencies in your build.gradle file

Related

Android Stripe integration

I have tried to integrate Stripe with my project. I have gone through the integration guide from https://stripe.com/docs/mobile/android. And I keep receiving an error Could not resolve com.stripe:stripe-android:6.1.2.
I have put into my build.gradle file Could not resolve com.stripe:stripe-android:8.0.0. Additionally, I have found the GitHub project that version varies from the one in the guide and I have tried it. The version number in the GitHub project is 8.0.0.
Full error log:
The short version of my dependencies in gradle:
dependencies {
...
implementation 'com.stripe:stripe-android:8.0.0'
...
}
Is there any additional maven repo or something that I should add to the gradle to be able to add this dependency to the project?
You might have enabled offline work for gradle,
Uncheck the box and sync the project again . It should fix the problem.

How do I use another library in my app?

The title is a little misleading but I honestly don't know how to word it in any other way. This is my project structure:
I want to use the highlighted (fasteranimationscontainer-master) in my current app that I'm working on. I imported it by putting the jar file in my library folder then adding it to my library through Android Studio. But I try to create an object of that imported library, it doesn't show up/import.
I'm still learning how to use android studio so any help would be much appreciated!
1. Library with only the Source Code
To include a library with only the source code (like FasterAnimationsContainer) to your project, you only need to import it as a module from File -> New-> Import Module in Android Studio:
There should be a dialog for the project folder, enter the path where your library reside.
Then you need to add the module to your app build.gradle as a dependency:
android {
...
dependencies {
...
compile project(':fasteranimationscontainer')
...
}
}
Now you can use it in your project.
2. Library from Maven or JCenter
To add dependencies to your project where the library has uploaded to maven or jcenter, you need to modify your app build.gradle file and add extra lines configuring the packages you require. For example, for certain Google or Android, dependencies look like:
android {
...
dependencies {
// Google Play Services
compile 'com.google.android.gms:play-services:6.5.+'
// Support Libraries
compile 'com.android.support:support-v4:22.2.1'
}
}
Try to always read the library README first.
Suggestion:
If you still learning using Android Studio, you can read Using Android Studio. Then read Getting Started with Gradle, because Android Studio is tightly related with Gradle.

Cannot create airbrake.jar file

I want to use Air brake SDK in my project
, but while creating the jar file I am getting the error.
BUILD FAILED
/Users/standarduser/Downloads/airbrake-android-master/build.xml:30: /usr/local/android_sdk/platforms/android-7 does not exist.
In the build.xml, I tried updating the
to
but again the same error. Please help.
if you are looking to use Airbrake Bug Tracker then you can easily add in gradle file if you are using Android Studio
dependencies {
compile 'io.airbrake:airbrake-java:2.2.8'
}

Android Studio Google Cloud Endpoints Run/Debug Config Error

I am a beginner for Android Cloud Endpoints. I am trying to create a backend module in Android Studio 1.0 RC2. Everything seems okay while creating a backend endpoint module (https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints). The gradle builds successfully. But when I wanted to debug locally, I found the problem. It said, "App Engine Gradle configuration not detected on module, maybe you need to Sync Project with Gradle".
I tried to rebuild the whole project, it builds successfully. But the error remains.
This is the screenshot: https://www.dropbox.com/s/tvuv52ldmr0yzvs/Screen%20Shot%202014-11-27%20at%204.21.14%20pm.png?dl=0
Thank a lot.
This was a recently introduced bug that has since been fixed in Android Studio 1.0.
I am not sure if it is the solution. But this is what I did. I created another new project (the problem happened in existing project that I migrated from Android Studio 0.8.9 to 1.0 RC2. I added new module for Google Cloud EndPoints. Initially it was same problem (there is same error in debug config as above, although it can build the whole project successfully.) But after I changed the build.gradle file in backend module to gradle-appengine-plugin:1.9.17 (latest), the new project backend was okay.
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.17'
}
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.17'
compile 'com.google.appengine:appengine-endpoints:1.9.17'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.17'
compile 'javax.servlet:servlet-api:2.5' }
I tried to change the build.gradle file in my migrated projects, but still failed. So, what I did was copy the content from new project
backend.iml
file into my migrated project backend.iml. And it works.

Adding Spring for android dependency to gradle + Android studio project

Official Spring for Android page mentions to add following dependency code.
dependencies {
compile 'org.springframework.android:spring-android:1.0.1.RELEASE'
}
which is latest version of build as of this time.(as per website)
I have added it in apps' build.gradle but I get an error as
Error:Failed to find: org.springframework.android:spring-android:1.0.1.RELEASE
What is the right way to do it?
I could add google play services as dependency in the same way.
Here is the correct dependency for the Rest Template module. I've corrected this on the Spring for Android project page. Thank you very much for pointing out this error.
dependencies {
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
}
You can find correct and lastest version on spring site. Under the Quick Start title.
http://projects.spring.io/spring-android/

Categories

Resources