Monday, October 29, 2012

android - Unable to create a new project in Eclipse after update to SDK Rev. 20

After updating the android SDK, if you are unable to create a "Android application project", or "New Android Activity", wherein everytime you try to create the following below popup comes in


Solution:-
     Open the SDK manager, delete the Android support package. Choose the current project, try install from the above popup. This should work. It worked for me. You can find the same below as a issue in code.google.com
http://code.google.com/p/android/issues/detail?id=33859

Friday, October 26, 2012

Android Support package not present in SDK Manager

Android Support package not present in SDK Manager:-

Solution:
"For some weird reason android-sdk decided to install everything in /extras/compatibility instead of /extras/support which eclipse recognises, so I renamed /extras/compatibility to /extras/support and now everything works fine."

Saturday, July 28, 2012

VIM as IDE

Install CTags for VIM
-------------------------------------
     sudo apt-get install exuberant-ctags

Install Cscope for VIM
--------------------------------------
    sudo apt-get install cscope

Install the following plugins for VIM
------------------------------------------------------------
1. Automatic Display of Declarations in the Context Window on the bottom in the (G)VIM window using the script named 'Source Explorer(srcexpl.vim)' :
    http://www.vim.org/scripts/script.php?script_id=2179

2. Symbol Windows For Each File on the left in the (G)VIM window (G)VIM using the script named 'taglist.vim':
    http://www.vim.org/scripts/script.php?script_id=273

3. Quick Access to All Files on the right in the (G)VIM window using the script named 'The NERD tree(NERD_tree.vim)':
    http://www.vim.org/scripts/script.php?script_id=1658

4. Cscope maps the keyboard shortcuts for various commands in cscope using the script named '(cscope_maps.vim)':
    http://cscope.sourceforge.net/cscope_maps.vim

4. Trinity manages all the above plugins and fit them in VIM to get the feel of source insight IDE using the script named '(trinity.vim)':
    http://www.vim.org/scripts/script.php?script_id=2347

4. You can change various options of each plugin in trinity.vim according to you request.


Additonal Info:
-------------------------
          After installing cscope its mandatory to build cscope DB for your project inorder to execute the commands inside VIM. If your project is c,cc,cpp project the following command will generate you a basic database. However you can tweak the same for your project requirements. Execute the following command at the top level project directory.

    find . -regex '.*\.\(c\|cpp\|h\)$' > cscope.files

    cscope -b

the above commands should generate a cscope.out DB file in your current working directory. If successfull, open VIM and type the following command

    :cscope add /home/xyz/cscope.out

some useful cscope commands:
  • Find this definition - :cs f g
  • Find functions called by this function - :cs f d
  • Find functions calling this function - :cs f c
  • Find this text string - :cs f t
  • Find this file - :cs f f
  • Find files #including this file - :cs f i
  • Find this C symbol - :cs f s
  • Find this egrep pattern - :cs f e

- Done and now you are ready to go. Happy VIM'ing.

Thursday, July 19, 2012

Chromium depot_tools download


During download of depot_tools of chromium browser using git in linux, we may get the following error

-------------------------------------------------------------------------------------------------------------------------
root@aphone-ubuntu:~/chromium_src# git clone https://git.chromium.org/chromium/tools/depot_tools.git
Initialized empty Git repository in /root/Chromium_Src/depot_tools/.git/
error: Couldn't resolve host 'git.chromium.org' while accessing https://git.chromium.org/chromium/tools/depot_tools.git/info/refs

fatal: HTTP request failed

--------------------------------------------------------------------------------------------------------------------------

this error may occur due to http proxy or firewall behind which we are trying to use git. Try setting the global htty proxy config for git. It worked for me.

git config --global http.proxy http://proxy:8080
// To check the proxy settings
git config --get http.proxy

After setting the above try  #git clone "url" .

Thursday, December 15, 2011

Android --no crunch error

Error Situation:
This error would arise in unexpected situation, wherein we tried to execute some application after doing some updates on eclipse or software that installed inside eclipse. This strange error is due to incomplete update of software inside eclipse.

Scenario:
Android SDK version 2.3.3, API level 10, and  updated the ADT to recent version 15 and tried to execute an app. But it failed due to this error. 

Reason:
  Incomplete update of Android SDK and ADT is recent version.

Solution:
To resolve this, update the Android SDK version that is being currently used from SDK Manager. After updating the Android SDK the problem disappeared. 

Thursday, September 22, 2011

Eclipse Content Assist Not Working

Eclipse sometimes goes clueless on assisting content when Ctrl + Space is pressed. Either it does'nt pops up the list, or else the popped up list would be empty without any suggestions. This can happen in any version of the eclipse begining from 3.2 to the latest 3.7 Eclipse Indigo. This is not due to the bug in eclipse. Its all about the configuration of eclipse editor and the Java project. Below are the four possible solutions that can help the user to get back the content assist

1.Create a New workspace project in Eclipse
Create a totally new workspace and import your existing project. Remember check “Copy projects into workspace” to copy all your existing work to new workspace.

2. Check the Content Assist Configuration
Configure Eclipse’s content assist, go “Preferences>Java>Editor>Content Assist>Advanced“. Make sure “1
Other Java Proposals” is ticked

3. Change Regional Setting option in Windows
Make sure “regional and language options” is in English language. For example, Windows, Control panel –> Region and language options –> Advance tab –> Language for non-unicode program –> Make sure English (United States) is selected.

4. Check the Lib folder in Current Project
Scenario -
There might be some class references with same name inside the jar's that are included in the library, or there might be chance of same "xyz.jar" included in two or more library jar's in the current project lib folder.
Solution -
1. Keep only one "xyz.jar". Remove "xyz.jar" from the jar's that include it, and keep only in current project lib.
2. Include it in any one of jar's inside the lib.

Wednesday, September 14, 2011

vlcj player with SWT


Find below the vlcj player embedding inside the eclipse plugin. It takes only few lines to get it embedded. The videocomposite below created should always be SWT.EMBEDDED, otherwise, it may give "Invalid Arugument" Error. For compiling and running add vlcj library and its dependecies JNA.jar and platform.jar libraries to the project. These libraries can be donwloaded from below reference.


/*VLC Player*/
org.eclipse.swt.widgets.Composite videoComposite = new org.eclipse.swt.widgets.Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
java.awt.Frame videoFrame = SWT_AWT.new_Frame(videoComposite);
java.awt.Canvas playerCanvas = new java.awt.Canvas();
playerCanvas.setBackground(java.awt.Color.black);
videoFrame.add(playerCanvas);
MediaPlayerFactory mpFactory = new MediaPlayerFactory();
EmbeddedMediaPlayer vlcPlayer = mpFactory.newMediaPlayer(null);
videoComposite.setBounds(5,5, 560,244);
videoComposite.setVisible(true);

ePlayer.setVideoSurface(playerCanvas);
/*end */


Additional reference
Java bindings for vlc media player
http://code.google.com/p/vlcj
http://code.google.com/p/vlcj/wiki/SwtExample
vlcj sources can be downloaded from
http://www.capricasoftware.co.uk/vlcj/downloads.php
vlcj tutorial
http://www.capricasoftware.co.uk/vlcj/tutorial.php