How to add a github function to an existing android studio program - java

In the past I could load a github program to work in my android studio program but with the last update either I went full stupid or something is wrong. I am trying to get this https://github.com/barteksc/AndroidPdfViewer in my program and I am adding my compile in my app and downloading and unzipping the program. When I add the view to my app it breaks. I hope you guys can help because I feel a bit crazy at the moment.
Thank you.

If you are trying to load the project, you may import as a eclipse project to migrate to AS + gradle.
If you are trying to use as library, AndroidStudio made it difficult to add libraries that are not as a artefact loaded by gradle.
So usually you find the gradle dependency into the project page and add it into your gradle, in your case it is exactly:
compile 'com.github.barteksc:android-pdf-viewer:2.7.0'

Related

I am a new app developer and I am unsure on how to insert a project from github into my android studio app

So I recently started an android project on android studio and I wanted to use something from github in my project. I watched countless videos but still do not understand. So this is the loading animation I want to use: https://github.com/ybq/Android-SpinKit. In the tutorial, the person is simply copy pasting the Gradle dependency and this : maven{ url"https://jitpack.io"} in the build.gradle scripts. When I further proceed in my XML file, it is not recognizing when I type out Spinkit, whereas in the video it is. When I go to the class to type in the progress bar code, it is giving me errors that it can't recognize the word ProgressBar. I am very lost so any guidance can help? Thanks for being patient:)
build.gradle here is where I am typing the maven code thing
build.gradle, here is where I am typing the implementation code copy pasted from github
this is the XML file where I believe is the issue: the line starting with
here is the java class where I am getting the errors
I understand that I am a very inexperienced developer but I just need a little guidance on this issue
When you click on that github link, you can find a button that says "Clone or download", click there and download the zip file to the code.
Unzip it, drag it to the desktop folder for example.
Open AndroidStudio, File, Open, then choose that file.
You should sync your project so it can recognize your changes in gradle.
Just above your code it's showing you a message asking you to sync project first.

Gradle 'APP' project refresh failed Cause:Java.Lang.NullPointerException

sincerely, I tried almost EVERYTHING that is on the internet.Even not directly related to this specific problem.This problem is happening in Android Studio even before I Installed the latest version.I was about a month without working in Android Studio.The only thing related to Gradle that I messed with, was adding the LibGDX to Eclipse for a University work.I may be talking nonsense, but a think the problem appeared after that, because I had to install the SDK for Eclipse and this may be caused the issue.
When I open Android, I can't build my apk.So I made several changes to the app and noticed that nothing changed.So I Looked to the Gradle build and saw:
Error:Failed to complete Gradle execution. Cause: unknown.
in Gradle Sync I got:
Gradle 'BluetoothConnector' project refresh failed
So I tried:PrintScreen of the Android Studio error
◘Updating Android Studio
◘Turning off Oflline mode.
◘Reinstalling(I did it several times with false hopes) every thing
related to Java(JDK,Java,JRE,Eclipse,Android Studio).
◘Checked the project Structure, add Dependecies entries.
◘Invalidade Cache/Restart
◘Export/Reimport.
So as you fellow programmers can see, I'm kind of struggling hard with this problem.Before I ask a question, a very long battle has already been going on for quite a while.And I simply don't know what else to do.
I tried starting a new application, and the same refresh error appears. All my other apps as well.
Unfortunely the only solution was a clean formating of the PC.I have no Idea what caused this, but it was the only thing left to do.And it worked.If Anyone come across this issue, that's really what do to.
Try this, it worked for me.
1. Change compile to implementation or api (As compile is now deprecated)
2. Clean the project
Check following links for more details:
Gradle Project refresh failed error
Use the new dependency configurations

Migrating Eclipse Project to Android Studio with dependencies

Imported an Eclipse Project to Android Studio having library dependencies of Sliding Menu, ViewPager, PullToRefresh. Import was successful but after syncing grade files getting duplication errors in values.xml.
~/app/build/intermediates/res/merged/debug/values/values.xml
Can anyone suggest me how to resolve this issue?
Please make sure that you migrated your project in a standard way. You should use Android migration tools for this. Then, it will give you a summary of changes and failures. So, you can spot your issue and find its solution. Make sure you keep the default setting in order to make a clean Android studio project. Please follow this post step by step and let me know if you still have issue.
https://stackoverflow.com/a/36533889/5475941
I hope it helps.

How do I integrate the Box SDK into my android application for OAuth?

I've been trying to follow the directions posted on the box-android-sdk github, however I have been highly unsuccessful. I've tried adding compile 'com.box:box-java-sdk:1.1.0' to my build.gradle file without any luck and have not been able to find a jar file to use.
I've also tried loading the box-content-sdk project into Android Studio but it comes back with an error stating the Gradle project sync failed and basic functionality will not work properly.
Has anybody been successful with creating a basic OAuth application for Box and if so can you please help me find the way?
I was able to get it to work by putting compile project (':box-content-sdk') in my build.gradle file.

After adding library to android project, the XML tag is still "unallowed in Android resource files"

I've been trying to add a library called 'Android Plot' into my project, however I cannot seem to get past this error. Screen shots are below. This library has worked in other test projects I have done before.
I am using Android Studio. Suggestions about how I can get past this would be great. Thanks
Figured it out. AndroidStudio is still in it's "ghetto" stage so if you try to add a library dependency in typical IntelliJ fashion you get a warning telling you that whatever you do in the project/module dialog (which shows up when you select it) actually has no effect on your build and that you must edit build.gradle manually.
In the case of Androidplot 0.5.2 heres what you do:
Add androidplot-core-0.5.2.jar into your /libs dir
In the dependencies section of build. gradle add:
compile files('libs/androidplot-core-0.5.2.jar')
Once you've done this you should be OK.
Nick

Categories

Resources