MD5 (Message Digest) is a hashing algorithm that can be used to ensure data integrity, save and protect passwords/codes, generate unique keys of limited length against a long literal etc. It takes input as String and generates the Hash of that string.
In JAVA there is a built-in MD5 support in its Standard Edition (J2SE). But if we talk about its Micro Edition (J2ME) their is no support for MD5. The package of JAVA Standard Edition can also be used in Micro Edition if and only if the platform supports the SATSA-Crypto Optional Package (How to know that your platform supports SATSA-Crypto).
I have found and tested the Third-Party implementation that can generate MD5 hash and can be used in JAVA Micro Edition. You can get the MD5 source files from here.
rizzz86
Wednesday, January 12, 2011
MD5 Hashing in J2ME
Labels:
All,
Development,
J2ME,
J2SE,
Java,
MD5,
Mobile,
Open Source,
Testing
Wednesday, December 29, 2010
J2ME Default Emulator without asking for Permission
While running J2ME project with Default Emulator it will ask for Permissions in case of File Read/Write, HTTP Connectivity etc. To get rid of this Permission on every access you have to change the Security options of Emulator. In my case I am using NetBeans IDE, so to change these options I will go through following steps:
rizzz86
- Open Project Properties
- Click on Manage Emulators Button
- Go to Tools & Extension Tab and Click Open Preferences Option
- On Preferences Window click on Security option
- Select Security Policy to 'JTWI'
- Select Security Domain as 'trusted'
- Now run the project it will not ask for access Permissions
rizzz86
Labels:
All,
Development,
J2ME,
j2mepolish,
Java,
Mobile,
NetBeans,
Open Source,
Permission
Friday, September 10, 2010
Unit Testing for J2ME - JMUnit
In professional development environment it is a common practice to create Unit Tests. On Java platform there are lots of research and development done on Unit Tests for Enterprise Edition. As far as Java Micro Edition is concerned one of the framework available is JMUnit.
Creating and executing a test case using jmunit is quite simple and can be done without wasting much time to explore it. Following steps will guide you how to work with jmunit:
Your mobile test case is ready !
rizzz86
Creating and executing a test case using jmunit is quite simple and can be done without wasting much time to explore it. Following steps will guide you how to work with jmunit:
- In your mobile application right click on package (where you want to create a unit test) and select option 'New > Empty JMUnit Test'.
- It will create a unit test class for you that will look like this:
/*
* ABCTest.java
* JMUnit based test
*
*/
package hello;
import jmunit.framework.cldc10.*;
/**
* @author rizwan
*/
public class ABCTest extends TestCase {
public ABCTest() {
//The first parameter of inherited constructor is the number of test cases
super(0,"ABCTest");
}
public void test(int testNumber) throws Throwable {
}
} - Next you will create a test method in same class and call it in test() using switch cases.
- Total count of test cases will also be mentioned in unit class constructor.
- Now the code will look like this:
/*
* ABCTest.java
* JMUnit based test
*
*/
package hello;
import jmunit.framework.cldc10.*;
/**
* @author rizwan
*/
public class ABCTest extends TestCase {
public ABCTest() {
//The first parameter of inherited constructor is the number of test cases
super(1,"ABCTest");
}
public void test(int testNumber) throws Throwable {
switch(testNumber){
case 0:
testOne();
break;
}
}
private void testOne() throws Exception{
String tmp = "Hello Rizwan";
assertEquals(tmp, "Hello Rizwan");
}
} - After that you have to mention 'ABCTest' as your Midlet.
- Go into 'project properties > Application Descriptor > MIDlets' and define unit test name and package here.
- Run application and you will also get Test option on screen:
- Test the project and it will show you the results
Your mobile test case is ready !
rizzz86
Labels:
All,
Development,
Framework,
J2ME,
Java,
Mobile,
NetBeans,
Open Source,
Testing
Saturday, September 4, 2010
Open Transport Tycoon Deluxe (TTD)
TTD is one of my most favorite games that I have played and when I saw the 'Open' with it, I was really excited to install it on my Ubuntu OS.
The installation of Open TTD is difficult and you need to be a bit keera of shell scripting to do this job. I have followed all the steps on this link and managed to install OTTD successfully. After completing installation and launching the game I was really amazed by watching the same TTD main screen as what I was playing on my 'Windows OS' four years back.
The game is upgraded now and contains four different types of maps with each map containing different industries, disasters, vehicles etc. Maps are also really interesting with environment like a Desert area map, Snow area map, Toyland area map and a default one as well. I have some getty images of the game that are as follows:
All TTD lovers do enjoy this on your Linux OS.
rizzz86
The installation of Open TTD is difficult and you need to be a bit keera of shell scripting to do this job. I have followed all the steps on this link and managed to install OTTD successfully. After completing installation and launching the game I was really amazed by watching the same TTD main screen as what I was playing on my 'Windows OS' four years back.
The game is upgraded now and contains four different types of maps with each map containing different industries, disasters, vehicles etc. Maps are also really interesting with environment like a Desert area map, Snow area map, Toyland area map and a default one as well. I have some getty images of the game that are as follows:
All TTD lovers do enjoy this on your Linux OS.
rizzz86
Labels:
All,
Game,
Linux,
Open Source,
Operating System,
Scripting,
Software,
Ubuntu,
Windows
Friday, September 3, 2010
Amir, Asif & Salman - From Hero to Zero
Pakistani cricketers are again under a controversy and this time it is a serious one - the FIXING case :|
The trio who are Hero of last week are now Zero. In my last blog I am really excited of Pakistan's fighting win over England and now I am not much interested to even watch a cricket match.
Is it a non-professionalism or a trap or anything else - the trio-players has taken part in this show of money. The future of these players is still not clear and are at stake. But as a Pakistani I am still hoping these players will not have a life ban and will play cricket after completing their punishments.
rizzz86
Sunday, August 22, 2010
Pakistan beat England after 9 Years
A victory dedicated to the flood victims of Pakistan.
Pakistan beat England in England after 9 years in a Test Match is another huge achievement by a rookie team within a month. Previously they beat Australia after 15 years in a Test Match.
A good team work by Pakistani bowlers as well as batsmen has done the work for Pakistan. Taking a first inning lead and excellent comeback by Paki bowlers in the 2nd innings has provided them a victory. There are lots of moments and achievements in a match that really boost the team moral. Some of them includes 1) Wahab Riaz's superb debut 5 wicket hall, 2) M. Yousuf solid comeback in a International side, 3) M. Amir becomes the youngest bowler to take 5 wicket hall in England in a Test Match and become a Man of the Match, 4) Saeed Ajmal's Spin magic, 5) Azhar Ali's unbeaten rock knock of 92* in the first innings and 6) Kamran Akmal's shocking 8 catches to reach his 200 dismissals in a Test Match.
Also a big relief for a new captain Salman Butt to still remain in the series. We all are hoping to win the Lord's Test to level the series.
Yousuf is a class act.
rizzz86
Wednesday, August 18, 2010
Flood Relief Update Link
Following link contains the activities performed by a group of people ( from IT/Software Industry of Karachi) for flood victims:
http://floodreliefupdates.blogspot.com/
rizzz86
http://floodreliefupdates.blogspot.com/
rizzz86
Subscribe to:
Posts (Atom)









