When I open the android jar I'm not able to see .java files , it shows .class files in it .
Please suggest me how to add android jar to eclipse.
Waiting for an early response.
If you want to check the java code of android you should better visit Andrdoid x-86 branch wesite and follow the instructions there.
But you can not see the java code by adding its JAR file in the eclipse project class path.
Related
I want to use the included tile packager from osmdroid's solution to use maps offline since Mobile Atlas Creator didn't work for me (I want 16x zoom levels which is not possible using this tool).
The instructions say that should run a .jar file using a command line, but there are no .jar files in the package and there are only source code files which when I run with netbeans IDE, gives me an error about unresolved dependency issues.
Anyone have any suggestions on how I can do this?
The answer given here didn't work for me as the .jar file always gave me a manifest (main class) error. So what I ended up doing was:
Download the project from github
run a 'gradle build' in the top folder (you can comment out the included libraries in the settings.gradle file if there is any problem with the Android SDK and you only need to use the tile packager)
run a 'gradle run' in the OSMMapTilePackager folder
by now gradle should have generated the following folder: OSMMapTilePackager/build/distributions/ and inside that folder you should have a zip file called something like OSMMapTilePackager-5.6-SNAPSHOT.zip. Unzip it
Go to the bin folder and run ./OSMMapTilePackager -gui
A window should have opened asking you for the parameters to download the tiles.
Got the procedure from this issue discussion.
Hope this helps anyone.
Just call gradle compileJava in OSMMapTilePackager directory. The jar should be in the tagret directory.
I'm trying to import a jar named Security.jar into an Android app that I'm currently working on, however, no matter what I do I cannot get AS to recognize the package that I'm importing. I pasted the jar into the libs folder that I created for the app and synced the gradle files, as well as modified the dependancies, all to no avail. If anyone sees ANYTHING that's wrong please let me know! Here's a link to some pictures pertaining to the issue.
http://imgur.com/a/sEoXi
error log build.gradle
I believe that you should do this:
compile files('libs/your.api.jar')
When you've pasted the jar file in the libs folder. Give it a shot.
A good way to add external JARs to your Android project or any Java project is:
right click on your project ..
then goto properties..
then click on java build path..
then click on libraries...
then click on add External JARs..
select jar file ..
click on ok
The current Jsoup release 1.7.3 has a known issue that it is using String.isEmpty() which is not supported by Android API Level 8.
I can see crash report of my app so I tried to fix this by change the source code of Jsoup and build my own jsoup.fix.jar. I test this jar with JAVA application and it worked fine on my PC.
I noticed that when I remove the original jsoup-1.7.3.jar from my project, there is errors complaining cannot find jsoup stuff, and the those errors are gone after I add the jsoup.fix.jar which seems to be good. I also check the JAVA build path and the exporting configurations, jsoup.fix.jar are all set as it should.
However, when I tried to run the APP on my Android devices, the APP crashed and saying it cannot find org.jsoup.Jsoup.
I checked the jsoup.fix.jar, opened it with JD-GUI and find the classes are all there, but I used my dex2jar to convert the classes.dex in my /bin directory, I cannot see nay org.jsoup stuff.
Just replace my jar file with the original jar will not have the same issue reproduced.
I also noticed that in my jar, the MANIFEST.MF file only have one line of content, but in the released jsoup-1.7.3.jar, the MANIFEST.MF contains a lot of content.
I am confused now, questions:
Am I doing wrong when build my own jar?
Why the APK still cannot include the jsoup pacakage even I configured it to do so?
Finally I found the reason might be the jar is exported from a JAVA project.
I have tried to create an Android project and copy the source files into it and then export another jar file, and it works!
Could anybody explain why?
I'm not actually working on android devices, but I'd like to use the android java std lib for a project of mine. I'm extracting the android java std lib from the android ADT here:
http://developer.android.com/sdk/index.html
After unzipping the bundle, it's in
adt-bundle-windows-x86_64-20130729\sdk\platforms\android-18\android.jar
However, when I open this up in Intellij, it doesn't show any source code: all methods are just labelled as "compiled code"
Is there any way to get the source code (in a jar or otherwise) for the android.jar so I can hook it up to the IDE so I can nicely browse the source code of the standard library? I've dug through the sdk download bundle and haven't found anything.
-Haoyi
but I'd like to use the android java std lib for a project of mine
I have no idea why you think that would work, any more than trying to use a Windows DLL on Linux.
Is there any way to get the source code (in a jar or otherwise) for the android.jar so I can hook it up to the IDE so I can nicely browse the source code of the standard library?
The source code for Android is at the Android Open Source Project. The source code for the android.jar is mostly in the platform_frameworks_base repo (GitHub mirror), but the JAR is really an output of a firmware build.
In your Android SDK root directory, go to the sources folder. Here you will find the source files for the different platforms you have downloaded.
Note: This gives you the Java code for Android libraries such as Activity
Unpacking the jar is way more than you need to worry about. Android is open source, so you can get everything you need online. To start, you can browse most of the source on Android's GitHub account, or download the source tree on the Android Open Source Project website. You can also view most (if not all) sources on GrepCode.
If you really want to go through the trouble of extracting the jar and decompiling the source, you can use JD-GUI.
As you use eclipse, use
jadclipse
which extrach any jar that in eclipse, u can view any source code with out download and also without internet. It has also export source code, As a developer It help u most times. :->
link to download
I want to use weka with java.
I downloaded and installed weka and also downloaded the api weka-oneclass.jar. I am using netbeans IDE and so added this external jar file. But now when I start importing this package of weka, it says weka package does not exist. The package is listed in the classpath too. Can anyone help me fix this problem?
Can you see it in the Libraries section down the left hand side of the main screen in Netbeans?
If you right click on your project, and go to the libraries section, is your jar file listed in the compile tab?
Finally, if you open up the jar file in the libraries section, does it have the classes your after?
If thats all correct, I would try clean and build your project again.