How to access Java std Library Source Code when Android Sources Plugin is installed? - android-source

Have installed Android Sources Eclipse Plugin, and wonder how can I access the source code to Java standard library classes, e.g., java.lang.String?
Indeed, I could extend the sources.zip-file (installed by the plugin) with the missing source files, like the java.* packages source files, but is there any other more seamless way to deal with this?

The sources of java library are situated in the project libcore. The full path libcore/luni/src/main/java There you can find java.lang package where String class is defined.
So you have two possibilities to look into resources:
Download the sources of AOSP
Browse sources in the Internet.

Related

outside lib in GitHub

I just recently used Github, and when I was trying to upload my java project I realized that I was using some external libraries like apahce poi in this project, and these files have to be stored in libs for my application to function, do I need to upload these files because I realize that might violate some issues(maybe ?).
If yes, then what is the correct way to upload or maybe just post a link to those dependency
Use a tool that provides a dependency management system such as Maven or Gradle (these are both common choices in the Java ecosystem). Your project will then include a configuration file that Maven or Gradle will use to download dependencies so you don't need to distribute them with your project.

IntelliJ download the libraries once and use in multiple projects

I have an IntelliJ with Scala plugin intalled on the server. The server is disconnected from the global internet and all the updates can be done ocsasionally only.
Would like to download some libraries once (e.g. Spark libraries, some libraries from Java) and use them in IntelliJ in the multiple projects without need of downloading them, but loading from local direcories. Also it would be great to have a 'full' bundle of libraries (e.g. all Spark libraries) and be able to use only particular classes when it's necessary (e.g. Spark Context only).
TK
P.S. Question is somewhat related to the: Use Scala on computer without internet connection
As #MarioGalic sugested, the cluse was to move a required libraries to the ~/.ivy2 directory.
Somethimes the case is to add libraries manually in IntelliJ project setup, insted of using SBT or Maven to manage the dependencies.

Use javascript in Scala.js compiled jars

I have a Scala.js jar, foo_sjs0.6_2.11-0.1-SNAPSHOT.jar, which contains javascript for my web server, and a separated Play project for controlers/views/etc.
Is there any way to compile and load .js files at runtime when I run the Play project, given it has foo_sjs0.6_2.11-0.1-SNAPSHOT.jar as a dependency?
P/S: I'm well aware of Play-Scala.js multi-project settings https://github.com/vmunier/play-with-scalajs-example, and I don't want that.
It's possible. You just have to use the Scala.js Tools API programmatically to link the .sjsir files in the jars into a .js file. Look at how the CLI linker does it for inspiration.

importing library project + different projects into Android Studio from Eclipse

Looks like the time has come for me to start using Android Studio, as I need some features that unfortunately have not been ported to Eclipse :(
Fortunately Android Studio is able to nearly-flawlessly import my projects, although I'm concerned if I'm doing it correctly
My Eclipse Workspace Layout is as follows:
LIB-CODEBASE is a big library project that contains most of the application beef
APP-KINDLE is a runnable project that uses the former, and provides some additional classes and activities for the KINDLE version of the app
APP-FIRETV is the same, but targeted to Amazon FireTV devices
APP-GOOGLE is the same, but targeted to Google-Play certified devices
APP-GCAST is the same, but targeted to modern devices supporting Chromecast.
When I import into Android Studio any of the APP-XXXX projects, it creates a copy of LIB-CODEBASE inside. So for each APP-XXXX project I have a full copy of LIB-CODEBASE inside their folders.
Is there an easy way to make all APP-XXXX projects to just share, link or include the LIB-CODEBASE project?
Inside a project you can refer an external module.
Just use:
Project
|__build.gradle
|__settings.gradle
|__app (application module)
|__build.gradle
In settings.gradle:
include ':app'
include ':codeBaseLib'
project(':codeBaseLib').projectDir=new File('pathLibrary')
In app/build.gradle:
dependencies {
compile project(':codeBaseLib')
}
Pay attention to codeBaseLib.
You have to use the path of the library inside the other project, not the root of the project.
Also for your APP-XXXX projects check if you can use a single project with different flavors.

Download dependency Jar's with with source and Javadoc with Play framework

Is it possible to specify sources and/or javadocs to be included in dependency JAR's with the Play Framework?
I want to be able to browse the source and javadocs for 3rd party libraries in Eclipse. The Maven Eclipse plugin can apparently be configured to provide this functionality as seen here, I'm wondering if Play provides similar facilities as well.
Have you looked at the Maven plugin? http://www.playframework.org/modules/maven
It explicitly mentions source and javadocs in its description.
Expected behavior this module:
Allow declaration dependencies in pom.xml, without putting
explicitly unless the transitive dependency does not work (for older
version or depending on undesirable big jar file)
Able to download all dependencies not provided by Play into lib
folder, with src and javadoc
Able to download source/javadoc artifiacts to depsrc folder for
declared or transitive dependency which is provided by Play, for
easier debugging (using command mvn:play-src)