Friday, September 30, 2016

How to import Android libraries from GitHub/dandar3 into Eclipse workspace

Showing you today an easier way of importing Android Support and Google Play Services libraries for Android from repositories into your Eclipse workspace.


Navigate to:

Choose the project you want to import (e.g. android-support-v7-appcompat).

Scroll down to SVN Checkout section, right-click the Team Project Set URL and choose Copy link to copy it to clipboard.

Switch to Eclipse then navigate to File > Import > Team > Team Project Set.

Paste the address into the URL field (if not already pre-populated from clipboard), then click Finish.

The download (import) may take a short while dependening on your Internet connection.

Once finished, wait for Eclipse to rebuild all projects or manually choose Project > Clean > Clean all projects and check the Start a build immediately both with Build the entire workspace option.

Then you can add the library (or libraries) as a dependency to your application.

Tuesday, September 6, 2016

Eclipse: Setting "derived" folders - AutoDeriv plugin

Using Eclipse with Java or Android projects you may notice that "Open Resource" (CTRL+SHIFT+R on Windows) is showing files from bin (or gen or other) folders, that were copied or generated by the build process, that you really don't want to edit as they will get overwritten on next build, resulting only in frustration and wasted time if you do.

Eclipse documentation for Derived resources:
Many resources get created in the course of translating, compiling, copying, or otherwise processing files that the user creates and edits. Derived resources are resources that are not original data, and can be recreated from their source files.  It is common for derived files to be excluded from certain kinds of processing.
You can manually update derived the flag on each resource in Properties page but as the resource will not be persisted in a source repository the flag won't as well. So that when you are checking out or downloading the project it will not be set, or when manually removing and recreating the particular resource in the case of a folder.

AutoDeriv plugin comes to help as it relies on configuration stored in a .derived file in your project that can be commited in a source repository. When the project is created the plugin will automatically mark as derived the resources matched in the configuration file.

The plugin also has a preferences page where you can change certain things like presentation.