Showing posts with label Tricks. Show all posts
Showing posts with label Tricks. Show all posts

Wednesday, 1 February 2012

Eclipse: Setting max line width for auto formatting

Eclipse has the functionality to auto format code on CTRL+SHIFT+F key press. At a certain point, it wraps lines.


You can increase Maximum line width -

1] Open Eclipse > Window > Preferences,
2] On the left panel. Click Java > Code Style > Formatter
3] You need to create a new 'Active profile'. To create click New button. Type profile name. Choose 'Eclipse [built-in]' in drop-down list and click ok.
4] In the Profile window select 'Line Wrapping' tab. In 'General Settings' Increase the value of 'Maximum line width:' property and Apply.
5] Select the newly created profile in Active profiles list. Apply and click OK.
6] In code editor window, press CTRL+SHIFT+F to confirm changes.
7] Done

Friday, 30 December 2011

Android SDK Offline Installation

Steps for downloading android SDK Packages for offline use.

1] Download and install Android SDK and AVD Manager from
http://developer.android.com/sdk/index.html

2] Download Eclipse IDE from
http://www.eclipse.org/downloads/

3] Downloading Eclipse ADT Plugin directly as an archive from

http://dl.google.com/android/ADT-16.0.1.zip

To Install this plugin. GO to Eclipse > Help > Install New Software > and select ADT-16.0.1.zip.

4] Go to https://dl-ssl.google.com/android/repository/repository-5.xml
All the Android SDK Packages are listed in this XML file.


5] Locate the block of SDK version you want to download. Suppose you want to download the SDK version 2.3.3 then locate the block that looks like

<sdk:platform>
    <sdk:version>2.3.3</sdk:version>
    <sdk:api-level>10</sdk:api-level>
    <sdk:codename/>
    <sdk:revision>02</sdk:revision>
    <sdk:min-tools-rev>8</sdk:min-tools-rev>
    <sdk:description>Android SDK Platform 2.3.3._r2</sdk:description>
    <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
    <sdk:archives>
        <sdk:archive arch="any" os="any">
            <sdk:size>85470907</sdk:size>
            <sdk:checksum
               type="sha1">887e37783ec32f541ea33c2c649dda648e8e6fb3</sdk:checksum>
            <sdk:url>android-2.3.3_r02-linux.zip</sdk:url>
        </sdk:archive>
    </sdk:archives>
    <sdk:layoutlib>
        <sdk:api>4</sdk:api>
    </sdk:layoutlib>
</sdk:platform>

5] Append the repository url with <sdk:url> value.

So we get the new url of the SDK package as :
https://dl-ssl.google.com/android/repository/android-2.3.3_r02-linux.zip

6] Download the SDK Package.

7] Extract the downloaded SDK package to C:\Program Files\Android\android-sdk\platforms\

8] Locate the block of Platform-Tools. As shown bellow
<!-- PLATFORM-TOOLS ........................ -->
<sdk:platform-tool>
    <!-- Generated at Thu Dec 15 16:55:10 2011 from git_ics-mr1 @ 238992 -->
    <sdk:revision>10</sdk:revision>
    <sdk:archives>
        <sdk:archive arch="any" os="windows">
            <sdk:size>10007508</sdk:size>
            <sdk:checksum type="sha1">
            44ecef94d0ebf1fc4c8fc3f7f0bf1679618b1e94</sdk:checksum>
            <sdk:url>platform-tools_r10-windows.zip</sdk:url>
        </sdk:archive>
        <sdk:archive arch="any" os="linux">
            <sdk:size>9930673</sdk:size>
            <sdk:checksum type="sha1">
            5f6a36c5d5e51cfa51a964c0365a0533784b8c9f</sdk:checksum>
            <sdk:url>platform-tools_r10-linux.zip</sdk:url>
        </sdk:archive>
        <sdk:archive arch="any" os="macosx">
            <sdk:size>10001226</sdk:size>
            <sdk:checksum type="sha1">
            84fc063c555d2a84d8e8fa2092c1635c6bbe940f</sdk:checksum>
            <sdk:url>platform-tools_r10-macosx.zip</sdk:url>
        </sdk:archive>
    </sdk:archives>
</sdk:platform-tool>

9] To download the platform-tools, Append the repository url with <sdk:url> value.
The url of platform-tools for windows os : https://dl-ssl.google.com/android/repository/platform-tools_r10-windows.zip

10] Download the platform-tools and extract it to
C:\Program Files\Android\android-sdk

11] Open SDK Manager from Start Menu. You will notice that the Packages list shows Android 2.3.3 SDK Platform Status as Installed.

12] Open AVD Manager from Start Menu and create a new device and choose the target as the downloaded SDK(i.e Android 2.3.3)

13] Done.

Now you can start developing android apps in Eclipse IDE.

Thursday, 29 December 2011

Installing incompatible add-ons in Firefox

After updating the Firefox you may notice that some of your add-ons are disabled by the Firefox. This is because the old add-ons are not compatible with the newer version of firebox. For reliability purpose the incompatible add-ons are disabled.
If you want them back you need to find the updated compatible version of add-on on https://addons.mozilla.org/. But it may happen that the compatible version of that add-on is not available on the site since the developer has to update the add-on for new version of Firefox.
But it is not the case that the old add-ons can't  work with new Firefox. Many of these add-on could work efficiently but the only problem is that they are build fo nearticular versions of Firefox and the newer versions of Firefox won't allow them to install.

But we can bypass this incompatibility issue using following steps.
1] Open Firefox. Go to address bar and type about:config and hit enter.
2] Firefox will open a list of values. Right Click anywhere on the list, Select New and click Boolean.
3] Enter "extensions.checkCompatibility.[Version]" in the Name field.
     Version: Type the version no of your Firefox. you can find it in Help > about Firefox.
4] Select FALSE value and click OK.
5] Restart Firefox.
6] Done. Now you can install incompatible add-ons in Firefox.


About Us | Site Map | Privacy Policy | Contact Us | Blog Design | 2007 Company Name