Friday, July 27, 2012

Android Device Debugging Problem :: Device unknown in Eclipse

Android emulators are great to test the apps. However, the apps are run in real devices. The test should be performed in real device before releasing it.

If you are using Eclipse IDE, and have problem debugging (running) the apps directly in Android Phones with the device unknown ( ???? ) problem, then follow the below process to solve the problem.

Note :: I'm assuming you are running eclipse in Linux Ubuntu distro.

1. Create a file 51-android.rules in /etc/udev/rules.d/ directory. (If this file is not existed.)
       sudo vim /etc/udev/rules.d/51-android.rules


2. Insert the below line in this file.
      SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
      
3. Then execute
      chmod a+r /etc/udev/rules.d/51-android.rules


4. You may require to restart the eclipse (if still problem persists). Then you will have your real device ready to debug from eclipse. 


At step 2. Please note ATTR{idVendor}=="04e8".
idVendor value should be the USB Vendor ID of the Android Phone you are using to debug the apps.
In my case, I was using Samsung S II and it's USB vendor id is "04e8". You can accordingly edit the usb vendor id appropriate for your phone.

For the complete list of USB vendor ID's of Company, you can click the following link.

http://developer.android.com/tools/device.html#setting-up

Thank you.





Monday, March 12, 2012

Basic Commands for SVN

1. Creating a directory in Repo
For eg :: To create directory MobileApps, follow the following command.
svn mkdir http://xxx.xxx.xxx.xxx/svn/source/MobileApps -m "Adding Main Project Directory"

2. Importing project in SVN
svn import MyProject http://xxx.xxx.xxx.xx/svn/source/MobileApps -m "Adding Main Project Directory"
This command will import all the files within MyProject to MobileApps folder.

3. Deleting a directory in Repo
For eg :: To remove directory mobileapps-java, follow the following command.
svn delete http://xxx.xxx.xxx.xxx/svn/source/MobileApps/mobileapps-java -m "Deleting ..."

4. Creating a branch from trunk
svn copy http://xxx.xxx.xxx.xxx/svn/source/trunk/mobileapps-java/ http://xxx.xxx.xxx.xxx/svn/source/branches/mobileapps-java-mybranch/ -m "Creating branch for java apps"

Thursday, August 11, 2011

Install Awesome Window Manager (WM) in Ubuntu 10.10

Ubuntu 10.10 uses Gnome Desktop Environment (DE) version 2.32.0. We can also use Awesome Window Manager (WM) on it. To install awesome ..
1. Type :: sudo apt-get install awesome3

After successful Installation you have to make following changes using terminal
gconftool-2 --type bool --set /apps/nautilus/preferences/show_desktop    False
# Disable buggy Nautilus desktop thing
gconftool-2 --type string --set /desktop/gnome/applications/window_manager/current    /usr/bin/awesome
# Set awesome as your WM of choice

-If you cannot locate /usr/share/applications/awesome.desktop then add ~/.local/share/applications/awesome.desktop

2. In awesome.desktop file enter the following information
[Desktop Entry]
Version=1.0
Type=Application
Name=Awesome
Comment=The awesome launcher!
TryExec=awesome
Exec=awesome

Then restart your computer. It's done now.

While logging in the window .. Please choose awesome from panel below.

Then Awesome Window Manager is shown. Then you can explore Awesome WM :)






Wednesday, July 6, 2011

"Application is not installed on your phone " Problem while launching android app

Problem :: While launching the android app in emulator, when clicking the app icon to run the application in emulator, I couldnot run the app. The pop up comes stating "Application is not installed on your phone".

Cause :: This problem occurs if u have the duplicate Activity in the App Manifest file. For eg. The SplashScreenActivity has duplicate entry in Manifest file.

Solution :: Make sure u have declared single Activity class in Manifest file.

:)

Wednesday, March 16, 2011

Add external jar while building with ant tool

Just add binaryLibraries in <build> tag with jars separated by ; symbol.

Tuesday, February 15, 2011

Obfuscation problem while deploying J2mePolish App Jar in Web Application

To decrease the size of mobile application in J2ME Polish, it uses obfuscator(Proguard). It renames all the generated classes in it's own way. While deploying the same jar in web application, we cannot use the class name of app.

Eg. We use UseDTO class in J2ME Polish, then it is renamed as aa.class by Proguard.

To overcome the solution, use 'keep' option of obfuscator in build.xml file of J2ME Polish app.

<obfuscator name="Proguard" unless="test">
    <keep class="com.abc.UseDTO">
</obfuscator>


What the above statement does is obfuscate all the class except UserDTO.

Now you can use UserDTO class in web application or any other project.

Thanks

Thursday, December 2, 2010

Tomcat Start Problem After Successful Installation in Windows

After installing Tomcat Server in Windows, Tomcat couldnot be restarted. In it's log file, following error is logged.

[2010-12-03 12:17:20] [986 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll

.................





Solution :: Just copy msvcr71.dll file located in c:\Programs Files\Java\jdk1.6.0\bin to C:\Windows\system32 folder.

Now try to start Tomcat Server. Your problem should be solved now.

Wednesday, November 10, 2010

Netbeans + Ubuntu - Caused: java.io.IOException: read past EOF

I had unexpected shutdown of my PC due to power failure. After I restarted my PC and opened the Netbeans (version 6.7.1), I got error
java.io.IOException : Caused: java.io.IOException: read past EOF.
Due to it I couldnot be able to auto complete the code.


For the above mentioned problem, I found a simple solution.


JUST REMOVE THE .netbeans folder in ur home directory.

Thanks

Wednesday, October 20, 2010

Phpmyadmin login problem

I have started my MySQL server. I can successfully login using the command line. ie..,

mysql> mysql -u root -p password
However, I couldnot login in phpmyadmin with the same username and password.


The solution to above problem is ...

1. Open the hosts.allow file in /etc directory.
$sudo vim /etc/hosts.allow

2. Add the following line in it.
mysqld: 127.0.0.1: ALLOW

Then, u can successfully login in phpmyadmin.

Thanks.

Friday, June 11, 2010

Handle KeyPress Event in List

Let's take a scenario, where we provide the feature for user to select an option from the given list of options and press RIGHT key in the mobile to select that option. To implement this scenario in J2ME, we don't have other options but to use Canvas Class to track which key is pressed by the user.

However, we can implement this feature in J2MEPolish easily. For that we need to use the class de.enough.polish.ui.List and override the method " public void keyPressed(int keyCode)" in the List. However don't forget to override this method by "super.keyPressed(code)".

:-))

Loving J2MEPolish !! ;-)

Tuesday, April 27, 2010

Cannot call actionListener method on <a4j:commandLink/> with javascript

If you have problem with calling the actionListener method in JSF with 4j:commandLink and the javascript method for validation ...

javascript code ::

function confirmAdd(){

var flag=false;

if(confirm("Are you sure to add ??")){
flag=true;
}

}

and the JSF a4j:commandLink ::
<a4j:commandlink actionlistener="#{bean.addValues}" value="AddConfirm" onclick="return confirmAdd();" ajaxsingle="true">
<f:param value="#{bean.value}"/>
</a4j:commandLink>

then the method addValues in actionListener is not called ..

For that the Solution is ::

<a4j:commandlink actionlistener="#{bean.addValues}" value="AddConfirm" onclick="if(!confirmAdd()){return false;}" ajaxsingle="true">
<f:param value="#{bean.value}"/>
</a4j:commandLink>

then the method addValues in actionListener get called and the values are added.

Wednesday, January 6, 2010

Ubuntu 9.10 and Samba Shares (testparm error)

Recently I got this error when trying to share a folder from within my Home folder in Ubuntu 9.10 (Karmic Koala) :

Failed to execute child process "testparm" (No such file or directory)

The fix was extremely simple – just install ’samba-common-bin’ with the command.

$ sudo apt-get install samba-common-bin

Then, there you are done.

No reboot is needed, just go back to your folder and share it again.

Sunday, January 3, 2010

passing parameter through h:commandButton in JSF

In JSF, <h:commandButton> doesnot support <f:param> so that we cannot use it to pass parameter. However, it is supported in <h:commandLink> . So, in order to pass parameter through , <h:commandButton> we can use <f:attribute> . An example is shown to demonstrate this:

<h:commandButton actionListener=#{bean.callAction}/>
<f:attribute name="parameterName" value="parameterValue"/>
</h:commandButton>

In backing bean,

public void callAction(ActionEvent ae){
String paramValue = (String) ae.getComponent().getAttributes().get("parameterName");
System.out.println("Parameter value is :: "+paramValue);
}

The output is -
Parameter value is :: parameterValue

which is in the value attribute of f:attribute tag.