AChartEngine And Android Studio - android

I have to create an application that makes extensive use of charts.
Reading the web I chose achartengine that seems to have everything I need.
I downloaded the jar file, I plugged in the libs folder, I selected "add to library" and I lunch the gradlew clean.
Result in the sources where I do the import of org.achartengine.xxxx I always returned the error that fails to resolve symbols .
Do you have suggestions?
Thank you
Andrea

I am able to use this library in my Android Studio project, this topic explains how to add AChartEngine repo to your project.
What I did:
Added following to project-wide build.gradle (one from the project root):
allprojects {
repositories {
...
maven {
url "https://repository-achartengine.forge.cloudbees.com/snapshot/"
}
}
}
For every module that uses the library, add this to its build.gradle (you may put this to the top-level build.gradle if it should be included in all modules):
dependencies {
...
compile group: 'org.achartengine', name: 'achartengine', version: '1.2.0'
}
Now I can use the library in the project, I see the classes in code assist popups and build runs as succeeds.

It seems like the new version (1.2.0) is not available for download anymore in the http://www.achartengine.org/ site. and that's why the gradle/maven method doesn't work (or the snapshot file was removed).
I succeeded using and adding it to my project by downloading the jar file from here:
https://github.com/ddanny/achartengine/files/460139/achartengine-1.2.0.zip

Related

Jar file in parse sdk android studio

I am trying to setup parse server in android studio.the problem which i face i am not able to found parse jar file and how i add in lib folder??
where I found jar file how we connect with parse server
I refer this tutorial http://brainwashinc.com/2017/02/17/setting-parse-sdk-android/
Downloaded SDK
Put jar file in ‘libs’ dir same level as project ‘java’ dir under src/main
Added Gradle line for jar file to build.gradle (for app module, not project):
I notice the guide you linked doesn't mention specifying the fileTree for jars.
In your module-level build.gradle, make sure you have this line:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
...
}
This will tell gradle that it should look for .jar files in the libs directory. Without this line, gradle has no way of finding your jar file.
Please let me know if this solves your issue!
The tutorial you are referring to is very old (according to the url path), and contains outdated steps for importing Parse SDK into Android project.
So to answer your question and add little background:
where I found jar file how we connect with parse server
Parse stopped distributing SDK .jar artifacts in 2017, so there is no .jar file to download. (I'm not counting old artifacts still hanging around JFrog's Bintray) More background info here.
The current way of importing Parse SDK is to add it as a gradle dependency.
Since they're distributing artifacts via Jitpack, which is not included by default in new Android Studio project, you must add this to your root build.gradle.
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
And then add the library to your module build.gradle (In most cases this would mean app/build.gradle). You can find latest version on Jitpack project page.
dependencies {
implementation "com.github.parse-community.Parse-SDK-Android:parse:latest_version"
}
For more information and to avoid similar problems with outdated instructions, I recommend reading the official docs.

Error:(44, 13) Failed to resolve: org.achartengine:achartengine:1.2.0 [duplicate]

I have to create an application that makes extensive use of charts.
Reading the web I chose achartengine that seems to have everything I need.
I downloaded the jar file, I plugged in the libs folder, I selected "add to library" and I lunch the gradlew clean.
Result in the sources where I do the import of org.achartengine.xxxx I always returned the error that fails to resolve symbols .
Do you have suggestions?
Thank you
Andrea
I am able to use this library in my Android Studio project, this topic explains how to add AChartEngine repo to your project.
What I did:
Added following to project-wide build.gradle (one from the project root):
allprojects {
repositories {
...
maven {
url "https://repository-achartengine.forge.cloudbees.com/snapshot/"
}
}
}
For every module that uses the library, add this to its build.gradle (you may put this to the top-level build.gradle if it should be included in all modules):
dependencies {
...
compile group: 'org.achartengine', name: 'achartengine', version: '1.2.0'
}
Now I can use the library in the project, I see the classes in code assist popups and build runs as succeeds.
It seems like the new version (1.2.0) is not available for download anymore in the http://www.achartengine.org/ site. and that's why the gradle/maven method doesn't work (or the snapshot file was removed).
I succeeded using and adding it to my project by downloading the jar file from here:
https://github.com/ddanny/achartengine/files/460139/achartengine-1.2.0.zip

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.

Add an Android binary library to an Eclipse project without gradle

I have a legacy eclipse Android project. The classic old way without gradle.
Suppose I found a library I want to integrate with, for example 'commons-codec', than quoting from gradle manual https://docs.gradle.org/current/userguide/organizing_build_logic.html#sec:external_dependencies, I need to paste the below in my gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'commons-codec', name: 'commons-codec', version: '1.2'
}
}
Now my eclipse project does not use gradle.
The Question: Is there a way to get the binary lib & integrate with it in eclipse (something similar to download the library's jar and add it)? I know this question is bizarre since I need the jar to be in the repository, but I want to be sure I'm not overlooking anything.
Many Thanks!
If you're just using a jar, you can include it in the libs folder of the Eclipse project. But that's code only. If there's resources in the library, you'd need to build an Android Library project out of it and include that in your project. Which I'm not sure how you'd do without code.
If you are having .jar file the simply right click on your project then
Properties-->Java Build Path-->Libraries-->Add Jar/ Add External Jar--> Apply
And if you are having library in your workspace then
Properties-->Android-->Add-->locate your library-->Apply

Fragmentation in Android Studio version on include aar external Dependency

Many of the Android App Dev almost shifted to Android Studio which makes Dev life much more easier but few features works fine in one version will not work on another version but in next version it will work fine !
I'm talking about including aar external Dependency
See this comments:
Ref: SO
There are different ways to import an arr file but we need to tryout all methods find the solution for the version you are using !
I Found easy working solution for Android Studio 1.1.0 (not sure It works on other versions)
Simply add new module--> select AAR/JAR type
select the required .arr file, give the name or folder otherwise it will select same file name to folder name!
In above image shows if you shift from Android mode to project mode you can observe new lib module added which contains arr file!
and finally add compile project(':ndlib') to app gradle
Solutions that not worked:
allprojects {
repositories {
jcenter()
flatDir {
dirs 'aar'
}
}
dependencies {
compile(name:'myLibrary', ext:'aar')
}

Categories

Resources