Importing PhotoView? - java

Ok so I want to chisbanes PhotoView.. I'm pulling my hair out now, Been staring at the screen for over an hour and for the life of me, I cannot figure out how to get this to even import into eclipse.
I've downloaded the git so I have my PhotoView-master folder with plenty of things in there (Looks like a project tbh). But no jar?
I came across this question which was marked as answered but I simply could not figure this one out.
Android : import libraries Like PhotoView
I went through this
http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject
But once again, there's nothing even available for me to add.
Anyone know what I need to do to actually get this loaded into eclipse and ready to reference?
Cheers in advance

Ok so I managed to get it working after hours slaving away at the screen.
First you need to move everything under the java/uk folder to the src/ folder in Eclipse. Once you do it the src/uk/... should look as normal. Next you need to go the project properties, click on Android and then change the Target Build Path to match the project you will be importing the library into.
Then just follow the instructions on the android dev webpage and then you should be able to reference the required files.

Working with library is a pain in android.
Photo view is not a jar library it is a referenced library. so you have to download the zip and import it inot ecllipse. Also if the library is built using Android Studio then you have to change folders to make it work. For eg the source code in Android Studio is in java folder while in ecllipse it is in src.

Related

Android: Add themes to existing project

I have a really old app that I am updating and want to use modern theming methods, probably Material Design 3.
If I create a new Android project, it creates some special folder to res/values folder, which has two files - one for light and one for dark.
I am unable to figure out how to add this special folder to my existing project as it looks like this at the moment.
I couldn't find a tutorial online, and when I try to add a folder and call it themes, it doesn't have the same icon.
Can someone help me with this?
I managed to fix this myself. I compared, and made similar, files in the root project directory between the files in my project and a new Android project.
I had also edited .idea\name file.
Then I just did Build->Clean Project, and closed and re-opened the project in Android Studio, and the issue was fixed with the smart folder organisations automatically done by the IDE.

vscode can not use for native module?

I using react-native. When I implement native module, it pops up errors window all the place like "The import android cannot be resolved (Java)" when I import something like android.widget.Toast.
The code still run well but it cause very hard for me to developed. Any tips?
Open a new XCode window with the directory being the android folder, using code android when you are inside the react native folder. I am able to get autocomplete, intellisense and autoimport in this window.
maybe you can try to delete the caches of the project. as it was storaged under:
"C:\Users\UserName\AppData\Roaming\Code\User\workspaceStorage".
many folders under it, as a folder correspondence a project, delete the correspondence folder of this project(as you can identify it through the 'modified date').

After creating android project in Eclipse ADT, tons of errors show up

I'm using eclipse ADT (most recent version) to develop some android apps. I've followed the getting started tutorial at the dev.android.com and it worked just fine.
But when i tried to create another project with the same targets and sdk's, i've got nothing but errors:
Some errors and my sdk's:
That's the same sdk's i used before these errors started showing up.
What can be causing this?
EDIT: my project won't generate the R.java file
You might need to add a support library to your new project.
Check this link for downloading the support libraries -
http://developer.android.com/tools/support-library/setup.html#download
Please notice that you need to import them into your eclipse and then include one (preferably the newest, not sure about this) in your project.
EDIT:
Before downloading the support libraries you should first check if you have them already.
Try this, right click project folder in the eclipse package explorer, Properties>Android>Library>Add>select a library if you have one.
There might be an invalid library included in your project already, if that happens then you will see it in the Library>Add> menu, remove it and add a new one.
You might have clean your project ........
if yes.....you must check whether R.java file is present in **Project(your project)->gen->package name->R.java**
if not than u have to update Tool Folder in SDK manager

Importing libraries to existing project in eclipse causing a lot of trouble

So I'm trying to import an existing project to eclipse and it's causing me a lot of trouble. I'll explain step by step, exactly how I'm trying to import it and someone please help me finish the importing because no matter how I do it, I still keep getting errors.
So as soon as I finish importing the existing android application there is a red exclamation mark (!) next to the project folder in eclipse. So I right clicked it and selected 'configure build path'
I then click on every single jar and select a new path. First, I found android support v4 in sdk/extras/android/support/v4, then I found google-play-services_lib in sdk/extras/google/google_play_services/libproject/google-play-services_lib/bin, and the last one (google-play-services) is at google-play-services_lib/bin.
So now after I'm done setting paths for those jars, the red exclamation mark disappears and a new error appears.
Now I right clicked the project again and selected properties --> android and this is what I see:
I then imported google-play-services_lib in eclipse as 'library project', but the red cross remained there, so I tried adding it manually with 'add button'.
As for the other 2 missing libraries, I googled about it and found out that CaptureActivity is from zxing barcode scanned library. So I downloaded the newest zxing version (2.2) and imported the library manually, same as I did with google play services. Right after importing CaptureActivity in eclipse and before even adding it to my application, this is what happens and I have no idea how to fix it.
Even though the eclipse gave me an error when importing zxing 2.2, I still added it to my project's libraries and now some errors disappeared. The only error I'm still getting is on qr_portrait_camera in folder layout:
So I right clicked my imported project again to see build paths again and this is what I notice:
So this is it. This is where I'm stuck and can't go forward, I googled a lot, did every kind of research I could and I don't know what to do anymore.
These are the three remaining problems that I've got:
I need to import one more library and I don't know where to find it (PortraitQR):
CaptureActiviy imported library project still shows a lot of red errors and I don't know how to fix that.
There's a CaptureActivity.jar in build path that shows an error and I can't either remove it or find a path to it.
I really need to fix this as soon as possible, I will be very grateful for any kind of help!
I figured it out. I just had to put all jars in libs folder and then download all 3 libraries, The one missing was causing all the trouble.

Problems getting Jar file to link correctly. Verify Errors

I've been searching the web for a long time, and it seams that this VerifyError isn't that uncommon and can have multiple reasons for tripping. I have created a project, that I've exported as a jar file. It is built with android 2.2 (API 8). This part works fine. But I have a separate project that when I try to import it, I start having problems.
The only way I've been able to get it to work, is to import the jar into a libs folder I created. It then get's automatically added as an Android Dependency and I can use it fine, however I can't attach my javadoc file to it, and in my build configuration it says I can't modify the dependency. (Can't link to a javadoc).
What I thought I should be able to do is simply add it as an external jar, then link the javadoc and source. If I do this, the code that uses the jar shows no errors, and the javadoc comments work. However I keep getting a VerifyError when I run it. I've attached a stack trace that shows the errors. I'm completely out of ideas, does anyone have any suggestions? Am I building the jar file wrong? Am I importing it wrong?
If anyone can help point me in a constructive direction, it would be really appreciated.
Thanks
Stack trace:
Ok, so this was frustrating to solve. The solution took about 20 seconds when I spent over an hour researching the problem.
What I had to do was go to:
Properties -> Java Build Path -> Order and Export
But rather than just clicking the external jar, I had to move it up to the top of the list for the build path order.
Credit definitely goes to yorkw for pointing me in the right direction.
I believe that Android jar files are a little different.
You could try putting the JAR files into the Android "dx" tool
It's in the ~/android-sdk/platform-tools

Categories

Resources