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

Tuesday, September 6, 2011

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)



Scenario
The above is the error sometimes we get, when we try to load a DLL built using Microsoft Visual Studio. This error commonly happens when, one try to load a DLL built on his/her PC and distribute to others. In such situation, the library will be successfully loaded in the source machine in which the DLL is built, but will fail to get loaded in other machines causing the above error. This is due to the library dependencies that gets created when building DLL.

Reason
        This is due to the library dependencies as said above. Microsoft Visual Studio is highly sensitive on the Build configuration, due to which the generated DLL's dependencies may get affected. For example, the "sample.dll" built may have dependencies on some "XYZ.dll version a.b.c". This "XYZ.dll version a.b.c" may exist in multiple version on a machine due to various reasons, such as Visual Studio version installed, Internet explorer installed etc. Its responsibility of the System, or Application to find the dependencies correct version and load the required DLL. This responsibility factor is decided based on the RT_MANIFEST present in DLL generated.

Solution
Sol -1.There are various tools available for checking the dll dependencies. "Dependency Walker" is one of the common tool used to check such dependencies. Once you find the dll dependencies, try to copy these missing dll's in respective folders based on the dll category such as (System dll, application dll's). If all the dll's exist go for the next solution.

Sol -2. Build the DLL using "release" mode instead of "Debug". This avoids the Visual C++ Redistribution package DLL dependencies being getting added in the RT_MANIFEST. If still unable to load the library in java, go for the final solution below.

Sol -3. The Project Properties->Code Generation -> Runtime Library option play a crucial role in dll creation. Based on this many dependencies gets added or removed such as MSVCR80D.DLL, MSVCP80D.DLL, IESHIMS.DLL. One solution would be build the DLL as Multi threaded instead of Multi thread DLL as shown

Monday, June 27, 2011

Restore Default Ubuntu Panel

Restoring Default panel on ubuntu

Open gnome terminal type the below commands

gconftool-2 --shutdown


rm -rf ~/.gconf/apps/panel


pkill gnome-panel"

:) happy linuxing...

Sunday, June 5, 2011

To get Network Interface list in Android

The ifconfig command on android requires you specify an interface name
explicitly. Without argument, it doesn't show all interfaces.
To find out all interfaces on the device, you can use
#adb shell ls /sys/class/net
command.

Thursday, June 2, 2011

ANR keyDispatchingTimedOut

When developing android apps, we tend to use multithread architecture to improve the performance of our application. In such case, there is a high chance that we run in to ANR: keyDispatchingTimedOut error atleast initially. The below links may provide some help in resolving it.

"http://android-developers.blogspot.com/2009/05/painless-threading.html

http://stackoverflow.com/questions/704311/android-how-do-i-investigate-an-anr

http://developer.android.com/guide/appendix/faq/commontasks.html#threading"

Wednesday, January 12, 2011

Permission Denied "mount -t cifs"

On few occasions, while trying to mount a shared folder from windows to linux, using mount -t cifs options, we would have come across a common error that is, "error 13 Permission Denied". This problem is not anyway related to CIFS as most of them thought. This is the problem with the Windows shared folder access. If NETBIOS is disable in Network properties, the CIFS cannot mount the drive, since the permission would be denied while accessing. The solution is provided in microsoft support site. Please follow the below link for the solution 


http://support.microsoft.com/kb/318030


Happy mounting... :)