Thursday, March 28, 2013

Root Android Smartphone

1) Download SuperOneClick from
http://download.cnet.com/SuperOneClick/3000-2094_4-75447027.html

2) Connect your smartphone to your computer via USB port, turn on "USB Debugging Mode" (in setting) and unmount SD card.

3) Install SuperOneClick on your computer. If you have Samsung devices, choose "Samsung captivate" tab. Choose "Universal" tab for other devices.

4) Click Root and wait. The progress may take several minutes to complete.

5) Finally, restart your device.

Covert .apk(Android) to .bar(Blackbery Z10) file



This post shows you 8 steps to convert an Android app (.apk) to Blackberry Z10,Q10 app (.bar).
Step 0 : download file apk2bar-HaTaX.zip from http://www.mediafire.com/?m5d990yhbu2c070
Unzip this file into apk2bar folder. This folder will contain:
+ apk2bar-HaTaX.bat –> convert .apk file to .bar file
+ signbar-HaTaX.bat –> used to sign .bar file
+ bin folder –> tools to get *.p12

Step 1: (download Android SDK)
Download Android SDK at http://developer.android.com/sdk/index.html?
Step 2: ( Install Android SDK)
Setup Android SDK and remember its path. Run SDK Manager. Click SDK platform in Android 2.3.3 (API10) as follows
How to convert APK (Android) to BAR (Playbook) ?
Step 3: ( Edit path in apk2bar-HaTaX.bat)
Using notepad to edit file apk2bar-HaTaX.bat to change the path "ANDROIDSDK=" to Android SDK installed in step 2.
How to convert APK (Android) to BAR (Playbook)
Note: remove “\” after android-sdk
Step 4 : (Testing) convert APK –> BAR
This step tests above steps. If you drag file *.APK into file apk2bar-HaTaX.bat and obtain file *.bar without errors, you have done correctly.
Step 5 : (Register to receive file *.csj  (not *.p12))
Go to website :https://www.blackberry.com/SignedKeys/ to register to receive file and go to https://www.blackberry.com/SignedKeys/ to register another file.
Note: in the input PIN part, you can input any characters but you must remember it.
After registering, you may need to wait about 2 hours to receive 2 files *.csj.
- First file client-PBDT-xxxxxxxx.csj (x: client number)
- Second file client-RDK-xxxxxxxx.csj (x: client number)

Step 6 : get file *.p12
Step 6.1 : Open cmd.exe and change to \apk2bar\bin (in step 0) and copy files *.csj into this folder
How to convert APK (Android) to BAR (Playbook)
Step 6.2 : In cmd, type:
blackberry-signer  -csksetup  -cskpass <create_a_password>
How to convert APK (Android) to BAR (Playbook)
If you already had key, an error will occur.
CSK file already exists. Use -cskdelete to delete first
Don’t use command cskdelete to delete unless you forgot pass. If you forgot pass, you can delete CSK file and request new CSJ file from RIM.
Step 6.3 : Next, input
blackberry-signer -register -csjpin <PIN>-cskpass <csk password from step 6.2><CSJ_file>
How to convert APK (Android) to BAR (Playbook)
Note: PIN is the PIN number in Step 5.
In Step 5, we register 2 keys because we will get errors if using only one key.
Step 6.4: Input
blackberry-keytool -genkeypair -keystore -storepass –dname "cn=" -alias author
How to convert APK (Android) to BAR (Playbook)
Step 7: Config file signbar-HaTax.bat
Using notepad to edit file signbar-HaTaX.bat. Only edit the first part of this file.
How to convert APK (Android) to BAR (Playbook)
SET DEVCERTFILE : the path to *.p12 file created in Step 6.4.
SET DEVCertPASS : pass to protect file *.p12 created in Step 6.4
SET CSKPASS : pass CSK created in step 6.4.


Step 8 : sign file bar
Step 8.1 : Drag file *.apk into file apk2bar-HaTaX.bat to create file *.BAR
Step 8.2 : Drag *.bar created in Step 8.1 to file signbar-HaTaX.bat to sign file *.bar.

Done!

ClassFoundException vs NoClassDefFoundError

ClassFoundException vs NoClassDefFoundError
There are lots of exceptions in java but these three are the one who most haunted the java developer most mainly because these three are mostly related to environment issues and they all depends upon JVM and Classpath behaviour. Though they look similar there is slight difference between ClassFoundException and NoClassDefFoundError and UnSupportedClassVersionError and we will highlight those differences here for easy understanding and differentiating these three:

1)
ClassNotFoundException comes on Runtime when requested class is not available in classpath and mainly due to call to Class.forName () or Classloader.loadClass () or ClassLoader.findSystemClass ().

2)
NoClassDefFoundError comes when problematic class was present when your compiled your application but they are not in classpath while you running your program.

How to fix java.lang.ClassNotFoundException in Java

How to fix java.lang.ClassNotFoundException in Java
As you have seen from above examples its clear problem of classpath, so here is
my approach to fix or resolve java.lang.ClassNotFoundException:

1) First find out the jar file on which problematic class file is present for example in case of "
com.mysql.jdbc.driver" its mysql-connector-java.jar. If you don't know how to find which jar file a particular class you can see eclipse shortcuts to do that or you can simply do "Ctrl+T" in Eclipse and type the name of class, It will list all the jar in the order they appear in eclipse classpath.

2) Check whether your classpath contains that jar, if your classpath doesn't contain the jar then just add that class in your classpath.

3) If it’s present in your classpath then there is high chance that your classpath is getting overridden or application is using classpath specified in jar file or start-up script and to fix that you need to find the exact classpath used by your application.



java.lang.UnsupportedClassVersionError:

java.lang.UnsupportedClassVersionError: Bad version number in .class files Cause and Solution How to fix Bad version number in .class file "java.lang.UnsupportedClassVersionError: Bad version number in .class file" is common error in Java programming language which comes when you try to run a Java class file. In our last article we discussed that how to resolve Java.lang.UnSupportedClassVersionError and found that it comes when major and minor version of class is not supported by Java virtual machine or JRE running the program. Though "java.lang.UnsupportedClassVersionError: Bad version number in .class file" is little different than that in its manifestation and Cause. UnsupportedClassVersionError is not as difficult as Java.lang.OutOfMemoryError and neither its solution is too complex but what is hard is thinking in right direction because cause of different types of UnsupportedClassVersionError is different. Read more: http://javarevisited.blogspot.com/search?updated-min=2011-01-01T00:00:00-08:00&updated-max=2012-01-01T00:00:00-08:00&max-results=50#ixzz2OonQfcU1