tag:blogger.com,1999:blog-20801989131410810762024-02-20T00:32:37.646-08:00CodeHunkThe CodeHunk returns.CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2080198913141081076.post-572224385058179162014-01-30T08:59:00.001-08:002014-01-30T09:23:07.950-08:00iOS 6 Facebook Integration Tutorial - How to login to your Facebook account? How to fetch Facebook home timeline using graph API?<div dir="ltr" style="text-align: left;" trbidi="on">
This tutorial talks about the complete walk through to facebook account login and then fetching home timeline.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-Z0kii7nvTTk/UuqKYsUZF-I/AAAAAAAAAJk/jxGxJCSjks8/s1600/images.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-Z0kii7nvTTk/UuqKYsUZF-I/AAAAAAAAAJk/jxGxJCSjks8/s1600/images.jpg" /></a></div>
<br />
Beginning with iOS6+ you can now make use of the integrated facebook sdk for easy app development. Facebook has released their iOS integrated sdk to enable developers easy connectivity and action to the facebook account in their apps.<br />
<br />
That means there's no more OAuth hassles and complex integration headaches. So let's just quickly get started with login to our facebook account through our app.<br />
<br />
<b>Login to your facebook account using Facebook-iOS6 integration:</b><br />
<b><br /></b>The first step is to get our app id from facebook, if you don't already have it you can get it by signing up your app from the facebook developers site this APP ID enables your app to connect:<br />
<br />
<div>
<pre class="brush:java">ACAccountStore *accountStore = [[ACAccountStore alloc] init];
NSString *appID = @"yourAppId";</pre>
</div>
<br />
<br />
Then the next step is to get permission from the user to allow our app all access to his facebook account and we do this as shown in the small method below:<br />
<br />
<div>
<pre class="brush:java">-(void)requestAccessFromUser{
//This line declares that we are looking for a facebook account
ACAccountType *accountTypeFacebook= [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
//This line asks user what are the things we need permission for
NSDictionary *fbDictionary = [NSDictionary dictionaryWithObjectsAndKeys:appID,ACFacebookAppIdKey,@[@"email",@"user_photos", @"user_videos", @"read_stream"],ACFacebookPermissionsKey, nil];
[self.accountStore requestAccessToAccountsWithType:accountTypeFacebook options:fbDictionary completion:^(BOOL granted, NSError *error) {
if (granted)
{
NSArray *fbAccounts = [self.accountStore accountsWithAccountType:accountTypeFacebook];
ACAccount *acc=[fbAccounts objectAtIndex:0];
NSString *username=[acc username];
//If the permission is granted we have successfully fetched the user name
NSLog(@"fb username:: %@", username);
} else {
NSLog(@"Access denied:: %@",error);
}
}];
}</pre>
</div>
<br />
<br />
<b>Fetch user facebook timeline using Facebook-iOS6 integration:</b><br />
<br />
Once we have been granted access by the user the next task is to fetch the news feed of the user which we do as shown below:<br />
<br />
<div>
<pre class="brush:java">-(void)userTimeline{
ACAccountType *accountTypeFacebook= [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
//Again we ask user his permission to access his timeline
NSDictionary *fbDictionary = [NSDictionary dictionaryWithObjectsAndKeys:self.appID,ACFacebookAppIdKey,@[@"read_stream"],ACFacebookPermissionsKey, nil];
[self.accountStore requestAccessToAccountsWithType:accountTypeFacebook options:fbDictionary completion: ^(BOOL granted, NSError *e) {
if (granted) {
//If granted to access his permission we will now fetch his timeline
[self getTimeline];
} else {
NSLog(@"error %@",e);
}
}];
}</pre>
</div>
<br />
<br />
<br />
<div>
<pre class="brush:java">-(void)getTimeline{
ACAccountType *accountTypeFB= [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
//Below is our graph api url to hit to fetch the timeline
NSURL *requestURL = [NSURL URLWithString:@"https://graph.facebook.com/me/home"];
//We can define the number of feeds we need from facebook below using the limit parameter
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"15", @"limit", nil];
//This is a GET request!
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:requestURL
parameters:params];
request.account = [[self.accountStore accountsWithAccountType:accountTypeFB] objectAtIndex:0];
self.facebookAccount=[[self.accountStore accountsWithAccountType:accountTypeFB] objectAtIndex:0];
[request performRequestWithHandler:^(NSData *data, NSHTTPURLResponse *response, NSError *error) {
if(!error){
//The timeline returned from facebook is a JSON data which we need to parse later on.
NSMutableDictionary *timelineData =[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSLog(@"Here's our timeline: %@" , timelineData);
//with every data there's paging url which we can use to get to next or previous feeds
}else{
NSLog(@"error: %@",error);
}
}];
}</pre>
</div>
<br />
<br />
<br />
<b>How to post status on facebook with location and image?</b><br />
<br />
Let's try to post a status on our facebook wall! Before we try to post a status that includes location and image we need to first get the latitude and longitude using the native apple location libraries. Once we are with the latitude, longitude and image we make the call something like this<br />
<br />
<div>
<pre class="brush:java">-(void)postUserStatus:(NSString*)statusMessage withImage:(UIImage*)postImage andLatitude:(NSString*)latitude andLongitude:(NSString*)longitude{
__block NSString *placeID;
ACAccountStore *acStore = [[ACAccountStore alloc] init];
ACAccountType *FBaccountType= [acStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary *permissionDictionary = @{ACFacebookAppIdKey: appID,
ACFacebookPermissionsKey: @[@"publish_actions", @"publish_stream"],
ACFacebookAudienceKey: ACFacebookAudienceFriends
};
[acStore requestAccessToAccountsWithType:FBaccountType options:permissionDictionary completion:
^(BOOL granted, NSError *error) {
if (granted) {
//Now we have the permission to post a status message
NSLog(@"permission granted");
NSArray *accounts = [acStore accountsWithAccountType:FBaccountType];
self.facebookAccount = [accounts objectAtIndex:0];
NSURL *requestURL = [NSURL URLWithString:@"https://graph.facebook.com/fql"];
//This is crucial, normally when posting location I look for a good range (distance) with at least 10 check ins at that place so we don't end up getting irrelevant place id like 'my garage' etc
NSMutableDictionary * params = [NSMutableDictionary
dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"SELECT page_id, name, description, display_subtext FROM place WHERE distance(latitude, longitude, '%@', '%@') < 1000 AND checkin_count > 10", latitude, longitude], @"q", nil];
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:requestURL
parameters:params];
request.account = self.facebookAccount;
[request performRequestWithHandler:^(NSData *data, NSHTTPURLResponse *response, NSError *error) {
if(!error){
NSDictionary *locationDictionary = [[NSDictionary alloc] init];
*locationDictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
placeID = *locationDictionary objectForKey:@"data"] objectAtIndex:0] valueForKey:@"page_id"];
NSData *imageData = UIImageJPEGRepresentation(postImage, 90);
[self shareStatus:imageData withCaption:statusMessage!=nil?statusMessage:@"" andLocationPageId:placeID];
}else{
NSLog(@"error :: %@",error);
}
];
}
}else{
NSLog(@"error posting::%@", error);
}
}];
}</pre>
</div>
<br />
And here's our share status method that makes the call to post our status:<br />
<br />
<div>
<pre class="brush:java">- (void)shareStatus:(NSData*)imageData withCaption:(NSString*)imageCaption andLocationPageId:(NSString*)locationPageId{
NSURL *picURL = [NSURL URLWithString:@"https://graph.facebook.com/me/photos"];
NSDictionary *params;
//The status now becomes the caption of our image and location is added with it
params = @{@"name": imageCaption, @"place": [NSString stringWithFormat:@"%@", locationPageId]};
SLRequest *merequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodPOST
URL:picURL
parameters:params];
[merequest addMultipartData:imageData
withName:@"source"
type:@"photo/jpeg"
filename:@"myImage"];
merequest.account = self.facebookAccount;
[merequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
NSString *response= [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
if(!error){
NSLog(@"post success::%@", response);
}else
NSLog(@"error %@", error.localizedDescription);
}];
}
</pre>
</div>
<br />
<br />
Now, That's it use the dictionary and parse the data show it up on your view and design it the way like! In the next post we will talk about likes, comments and their count for a post, also how to post a comment or like a post. Follow the blog for more.<br />
<br />
<br /></div>
CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-78919991715547329682013-08-15T05:53:00.000-07:002013-08-22T08:45:46.778-07:00How to send email using Java and Gmail smtp server?<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: small;">Send verification link to email or send an email for verification.</span></h3>
<div>
Sending an email from your java code is quite simple. If you need to send multiple emails or email for multiple users (cc/bcc) the best and simplest way is to use the already available java mail api for the purpose.</div>
<div>
<br /></div>
<div>
The javax.mail jar contains many classes that deals with various aspects of emailing, the MIME helps you configure properties of the email content, the BodyPart enables content to be send in body, the Message covers over all content and etc.<br />
<br />
Now, before starting you should know about SMTP.<br />
<br />
An SMTP stands for <b>Simple Mail Transfer Protocol</b> that establishes and configure the mail server, for our example we will be using easily available Gmail SMTP server. Before you start sending emails you need to configure your SMTP server and set properties according to our requirements.<br />
<br />
Also, check if the SMTP port on your system is open and available, the common port for SMTP server is 25. In case it is blocked by admin you may configure it using one of the good resources freely available on internet - <a href="http://www.pmail.com/downloads_s3_t.htm" target="_blank"><span style="color: blue;">Mercury</span></a><br />
<br />
All setup, let's get started:<br />
<br />
<pre class="brush:java">//System properties
Properties props = new Properties();
// Setup our mail server
props.put("mail.smtp.host", SMTP_HOST);
props.put("mail.smtp.user",FROM_NAME);
props.put("mail.smtp.ssl.enable", "true");
props.put("mail.smtp.port", "25");
props.put("mail.debug", "true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.EnableSSL.enable","true");
props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.port", "465");
props.setProperty("mail.smtp.socketFactory.port", "465");</pre>
</div>
<br />
Now, SMTP_HOST is gmail, FROM_ADDRESS is the sender's email address, TO_ADDRESS is the receiver's email and so configure all of them in our private variables:<br />
<br />
<pre class="brush:java">private String SMTP_HOST = "smtp.gmail.com";
private String FROM_ADDRESS = "youremail@gmail.com";
private String FROM_PASSWORD = "yourgmailpassword";
private String TO_ADDRESS = "anotheremail@gmail.com";
private String FROM_NAME = "CodeHunk Email Verification";
private String SERVER_URL= "http://localhost:8080/EmailServer/EmailServlet?"; </pre>
<div>
<br /></div>
<div>
You see that we are using our own localhost server where we will want the user to be redirected once he clicks the verification link received in his email.</div>
<br />
Next, setup our Message and MIME.<br />
<br />
<pre class="brush:java">//Session object.
Session session = Session.getInstance(props, new AuthorizeEmail());
//PasswordAuthentication validates the user at first
class AuthorizeEmail extends Authenticator {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(FROM_ADDRESS, FROM_PASSWORD);
}
}
try{
// Get the default Mime object.
MimeMessage message = new MimeMessage(session);//if only text
// Set our FromAddress.
message.setFrom(new InternetAddress(FROM_ADDRESS));
// Set our ToAddress.
message.addRecipient(Message.RecipientType.TO, new InternetAddress(TO_ADDRESS));
// Set our subject for the mail.
message.setSubject("CodeHunk Email Verification Test");
}</pre>
<br />
<br />
If you wish to send email to many people you can add "<span style="color: orange;">Message.RecipientType.CC</span>" or "<span style="color: orange;">Message.RecipientType.BCC</span>" in your addRecipient field.<br />
<br />
The next thing is to set the message string, you can use html in your string and that's perfectly legal and fine.<br />
<br />
// Now set the actual message<br />
<pre class="brush:java">String verificationID= "verificationID=100";
String htmlMessageContent = "<h3 align='center'>In order to proceed with CodeHunk registration click the link.</h3> <br> <h4 align = 'center' \"background-color:cyan\">Verification link: <a href = \""+SERVER_URL+verificationID+"\">Click to verify your email</a></h4>";</pre>
<br />
<br />
<br />
The verificationID will ensure only the receiver clicked the link<br />
<br />
<pre class="brush:java">//for the moment we comment out below line
//message.setText(htmlMessageContent, "text/html");
//set "text/plain" if you don't need html in your message</pre>
<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
If you need to send images also in your email you can also do that:<br />
Let's take this image for our email:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-UqYPBFp4dKk/Ugy_yIA56_I/AAAAAAAAAIk/3j9X-c_kjj0/s1600/hello.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="http://4.bp.blogspot.com/-UqYPBFp4dKk/Ugy_yIA56_I/AAAAAAAAAIk/3j9X-c_kjj0/s200/hello.jpg" width="140" /></a></div>
</div>
<div style="width: 80%; margin: 0px auto;">
<br /></br></br>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F41e43e42-20ac-40ef-9e81-6d6a96fecc9e&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F41e43e42-20ac-40ef-9e81-6d6a96fecc9e&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
</div>
<div>
<pre class="brush:java">// Create the message part for SENDING IMAGE
//This HTML mail have to 2 part, the BODY and the embedded image
MimeMultipart multipart = new MimeMultipart("related");
// first part (the html)
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText = "<H3 ><font color=\"red\" face=\"Comic sans MS\" size=\"2\">Hello CodeHunk Visitor!</font></H3><center><img src=\"cid:image\"></center><br>" + htmlMessageContent;
messageBodyPart.setContent(htmlText, "text/html");</pre>
</div>
<br />
<div>
<br /></div>
<div>
It is important to give your image an id like cid:image<br />
<br /></div>
<div>
<br /></div>
<div>
<pre class="brush:java">// add it
multipart.addBodyPart(messageBodyPart);</pre>
</div>
<div>
</div>
<div>
<br /></div>
<div>
<pre class="brush:java">// second part (the image)
messageBodyPart = new MimeBodyPart();
messageBodyPart.setDisposition(MimeBodyPart.INLINE);// show image with msg content
DataSource dataSource = new FileDataSource("D:\\hello.jpg");
messageBodyPart.setDataHandler(new DataHandler(dataSource));
messageBodyPart.setHeader("Content-ID","<image>");</pre>
</div>
<div>
<br /></div>
<div>
<pre class="brush:java">// add it
multipart.addBodyPart(messageBodyPart);</pre>
</div>
<br />
<div>
<pre class="brush:java">// put everything together
message.setContent(multipart);
//finally send our email:
Transport.send(message);</pre>
</div>
<div>
</div>
<br />
<div>
<br />
Finally, let's put everything together at one place.<br />
<br />
<b><u>The SendEmail Class:</u></b><br />
<br />
<pre class="brush:java">package com.codehunk.email;
import java.util.HashMap;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.Authenticator;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
/**
*
* @author Atif Imran 2013
* @blog codehunk.blogspot.in
* @website www.strizen.com
*
*/
public class SendEmail {
private String SMTP_HOST = "smtp.gmail.com";
private String FROM_ADDRESS = "youremail@gmail.com";
private String FROM_PASSWORD = "yourpassword";
private String TO_ADDRESS = "anotheremail@gmail.com";
private String FROM_NAME = "CodeHunk Email Verification";
private String SERVER_URL = "http://localhost:8080/EmailServer/EmailServlet?";
//PasswordAuthentication validates the user at first
class AuthorizeEmail extends Authenticator {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(FROM_ADDRESS, FROM_PASSWORD);
}
}
public static void main(String[] args){
SendEmail se = new SendEmail();
se.sendEmail();
}
public void sendEmail(){
//verify a user before registering
// System properties
Properties props = new Properties();
// Setup our mail server
props.put("mail.smtp.host", SMTP_HOST);
props.put("mail.smtp.user",FROM_NAME);
props.put("mail.smtp.ssl.enable", "true");
props.put("mail.smtp.port", "25");
props.put("mail.debug", "true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.EnableSSL.enable","true");
props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.port", "465");
props.setProperty("mail.smtp.socketFactory.port", "465");
// Session object.
Session session = Session.getInstance(props, new AuthorizeEmail());
try{
// Get the default Mime object.
MimeMessage message = new MimeMessage(session);//if only text
// Set our FromAddress.
message.setFrom(new InternetAddress(FROM_ADDRESS));
// Set our ToAddress.
message.addRecipient(Message.RecipientType.TO, new InternetAddress(TO_ADDRESS));
// Set our subject for the mail.
message.setSubject("CodeHunk Email Verification Test");
// Now set the actual message
String verificationID= "verificationID=100";
String htmlMessageContent = "<h3 align="center">
In order to proceed with CodeHunk registration click the link.</h3>
<h4 align="center" background-color:cyan="">
Verification link: <a href="http://www.blogger.com/" verificationid="">Click to verify your email</a></h4>
";
//for the moment we comment out below line
//message.setText(htmlMessageContent, "text/html");
//set "text/plain" if you don't need html in your message
// Create the message part for SENDING IMAGE
// This HTML mail have to 2 part, the BODY and the embedded image
MimeMultipart multipart = new MimeMultipart("related");
// first part (the html)
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText = "<h3>
<span ms="" omic="" red="" sans="" style="color: \; font-family: \;">Hello CodeHunk Visitor!</span></h3>
<center>
<img cid:image="" src="\" /></center>
" + htmlMessageContent;
messageBodyPart.setContent(htmlText, "text/html");
// add it
multipart.addBodyPart(messageBodyPart);
// second part (the image)
messageBodyPart = new MimeBodyPart();
messageBodyPart.setDisposition(MimeBodyPart.INLINE);// show image with msg content
DataSource dataSource = new FileDataSource("D:\\hello.jpg");
messageBodyPart.setDataHandler(new DataHandler(dataSource));
messageBodyPart.setHeader("Content-ID","<img />");
// add it
multipart.addBodyPart(messageBodyPart);
// put everything together
message.setContent(multipart);
// Send message
Transport.send(message);
}catch (MessagingException mex) {
System.out.println("MessagingException: "+mex.getMessage());
mex.printStackTrace();
}
}
}</pre>
<b><u>The EmailServlet:</u></b><br />
<br />
<pre class="brush:java">package com.codehunk.email;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class EmailServlet
*/
public class EmailServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public EmailServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//check if the parameter contains verificationID
response.setContentType("text/html");
PrintWriter out = response.getWriter();
if(request.getParameter("verificationID")!=null && request.getParameter("verificationID").equals("100")){
out.write(""+
"<html><head><title>Success</title></head>"+
"<body><h3>
Email successfully verified!</h3>
</body></html>");
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}</pre>
<br />
<b><u>The Result:</u></b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-4pdNtTD96tc/UgzOT6UhloI/AAAAAAAAAI0/dz7ceXNGBZc/s1600/email.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="http://4.bp.blogspot.com/-4pdNtTD96tc/UgzOT6UhloI/AAAAAAAAAI0/dz7ceXNGBZc/s640/email.png" width="640" /></a></div>
<br />
<br />
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u>When verification link is clicked:</u></b><br />
<b><u><br /></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-ihbv9UpNCZM/UgzOUnUyOII/AAAAAAAAAI8/Q1j0EvSoq3Y/s1600/success.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-ihbv9UpNCZM/UgzOUnUyOII/AAAAAAAAAI8/Q1j0EvSoq3Y/s1600/success.png" /></a></div>
<b><u><br /></u></b>
<b><u><br /></u></b>
That's all. I hope you've enjoyed it. Cheers ;)</div>
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-14932466604716362882013-07-02T09:32:00.001-07:002013-08-22T08:56:06.005-07:00Mavenize your BlackBerry project<div dir="ltr" style="text-align: left;" trbidi="on">
<b>How to create and build your BlackBerry project through Maven?</b><br />
<div dir="ltr">
<b><br /></b></div>
<div dir="ltr">
I was recently faced with a situation where it was required to mavenize my BlackBerry project. The purpose was to get automated builds through Hudson.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
<b>The problem:</b> There isn't any Maven plugin for BlackBerry! </div>
<div dir="ltr">
<b>The solution:</b> Get it done manually.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
So here's what I did:<br />
Since there wasn't any plugin I realized that I needed to manually create a maven structure and then use command line to build it.</div>
<div dir="ltr">
Once I had created the structure and completed the initial steps I was faced with an even bigger issue.</div>
<div dir="ltr">
The localization I used in my project won't compile and package through maven. </div>
<div dir="ltr">
BlackBerry application creates <b>.crb</b> files against its localization files. Somehow these files are not generated through maven and so the application is not packaged. </div>
<div dir="ltr">
The work around I used was to create a <b>.properties</b> file for my localization and put my localized strings in it like a key-value pair. The <b>pom.xml</b> file should add plugin for these resource files to be incuded in the build.</div>
<div dir="ltr">
Now we know our work arounds, its time to start with coding.</div>
<div dir="ltr">
<br /></div>
<div class="MsoNormal">
The BlackBerry Maven project requires the following
prerequisites to be achieved.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><u><span style="font-family: inherit;">System
Requirements:<o:p></o:p></span></u></b></div>
<ul style="margin-top: 0in;" type="disc">
<li class="MsoNormal"><span style="font-family: inherit;">Java
SE JDK v6.0</span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Eclipse
3.4 (the JDE plugin does not run on 3.5 yet)</span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Windows
2000 SPI or later, or Windows XP</span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Windows
Vista (BlackBerry JDE v4.2.1 and higher)</span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Monitor
with a resolution of 1024 x 768 or higher</span></li>
</ul>
<div class="MsoNormal">
<b><u><span style="font-family: inherit;">Development setup:<o:p></o:p></span></u></b></div>
<ul style="margin-top: 0in;" type="disc">
<li class="MsoNormal"><span style="font-family: inherit;">Windows OS (Blackberry
tools do not support Linux and Mac OS yet. Cross platform support is
finally on the roadmap for some time this year) </span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Java SE JDK v6.0 (check
with java --version on the command line)</span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Eclipse IDE with
Blackberry JDE plugin</span></li>
<li class="MsoNormal"><span style="font-family: inherit;">Maven2</span></li>
<li class="MsoNormal"><span style="font-family: inherit;"><b>RIM_JDE_HOME</b> environment variable must be set. This point to
the directory where the RIM JDE development environment is installed. On
machine this values looks like:</span></li>
</ul>
<div class="MsoNormal" style="margin-left: .5in;">
<i>C:\projects\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\lib <o:p></o:p></i></div>
<div align="center" class="MsoNormal" style="margin-left: .5in; text-align: center;">
<b><i>OR<o:p></o:p></i></b></div>
<div class="MsoNormal" style="margin-left: .5in;">
<i>D:\EclipseBlackBerry\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components\lib<o:p></o:p></i></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<b><u>Maven configuration and installation:<o:p></o:p></u></b></div>
<div class="MsoNormal" style="margin-left: 1.0in; mso-list: l1 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;"> </span><!--[endif]-->Download
Maven from Apache Maven project: <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a></div>
<div class="MsoNormal" style="margin-left: 1.0in; mso-list: l1 level1 lfo3; text-align: justify; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Extract the zip/tar.gz to the location of your
choice. Preferably <b>C:\Program Files</b> </div>
<div class="MsoNormal" style="margin-left: 1.0in; mso-list: l1 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]--><b>3.<span style="font-size: 7pt; font-weight: normal;">
</span></b><!--[endif]-->Add <b>PATH</b>
to the Environment Variables. <b><span style="color: #7030a0;"><o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .75in;">
<b>PATH</b>= <b><span style="color: #38761d;">C:\Program Files\apache-maven-2.2.1\bin</span>;<span style="color: #365f91;">C:\ProgramFiles\Java\jdk1.6.0_21\bin</span></b>;<b><span style="color: #cc0000;">D:\BlackBerryEclipseIDE\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components\bin</span></b></div>
<div class="MsoNormal" style="margin-left: .5in;">
<br />
By default when the project is run
from the maven <b>.m2</b> repository is
created in the local maven repository <b>C:\Documents and Settings\username\.m2.
</b> This path can be changed in the <b>setting.xml
</b>file.<o:p></o:p></div>
<div style="background: #F7F7F9; border: solid #D1D1E8 1.0pt; mso-border-alt: solid #D1D1E8 .75pt; mso-element: para-border-div; padding: 8.0pt 8.0pt 8.0pt 8.0pt;">
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<b><span style="font-family: 'Courier New'; font-size: 10pt;"><settings></span></b><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><i><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><!--
localRepository</span></i><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<i><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> | The path to the local repository maven
will use to store artifacts.</span></i><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<i><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> |</span></i><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<i><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> | Default: ~/.m2/repository</span></i><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<i><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">
<localRepository>/path/to/local/repo</localRepository></span></i><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<i><span style="color: grey; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> --></span></i><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<br /></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; margin-bottom: 15pt; padding: 0in;">
<b><span style="font-family: 'Courier New'; font-size: 10pt;"><localRepository></span></b><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">D:/maven_repo</span><b><span style="font-family: 'Courier New'; font-size: 10pt;"></localRepository></span></b><span style="color: #333333; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
</div>
<div dir="ltr">
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p><br /></o:p></div>
<div class="MsoNormal">
Now we have all the development environment setup. Let’s
start with the project.</div>
<div class="MsoNormal" style="text-align: justify;">
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u>Setting up Maven Project:<o:p></o:p></u></b></div>
<div class="MsoNormal" style="margin-left: .75in; mso-list: l2 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;"> </span><!--[endif]-->Setup
a maven project in your workspace or any other location. Keep in mind that choosing
a location like C:\Documents and Settings\username\MyProject will cause trouble
as Maven doesn’t recognize any white spaces as we see between “<b>Documents^and^Settings”.</b></div>
<div class="MsoNormal" style="margin-left: .75in; mso-list: l2 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;"> </span><!--[endif]-->Put
the <b>pom.xml</b> file in the project
directory.</div>
<div class="MsoNormal" style="margin-left: .75in; mso-list: l2 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;"> </span><!--[endif]-->Create
maven like folder structure in the project directory like this: </div>
<ul style="margin-top: 0in;" type="disc">
<ul style="margin-top: 0in;" type="circle">
<ul style="margin-top: 0in;" type="square">
<li class="MsoNormal">src\main\java
</li>
<li class="MsoNormal">src\main\resources </li>
</ul>
</ul>
</ul>
<div class="MsoNormal" style="margin-left: .75in; mso-list: l2 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;"> </span><!--[endif]-->On
the command line (cmd) type <b>mvn eclipse:eclipse</b></div>
<div class="MsoNormal">
That’s it this
should create a mavenized project structure for the moment. It will also create
the necessary project settings files. Now open the Eclipse and create a
new BlackBerry project using existing source option. Give path to our maven
project we created above. The structure should look like this:</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-6bgFRvuz4ww/UdL9pvvQwCI/AAAAAAAAAG4/fE8EveAZRvM/s245/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-6bgFRvuz4ww/UdL9pvvQwCI/AAAAAAAAAG4/fE8EveAZRvM/s245/Untitled.png" /></a></div>
<div class="MsoNormal">
<br /></div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F87b239e1-59dd-455d-b427-6585d77198c5&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F87b239e1-59dd-455d-b427-6585d77198c5&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
<div align="center" class="MsoNormal" style="margin-left: .5in; text-align: center;">
<br />
<!--[endif]--></div>
<div class="MsoNormal" style="margin-left: .25in; mso-list: l1 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">v<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Create the Java file that contains our code and
put it under src/main/java: <b>HelloBB.java<o:p></o:p></b></div>
<div class="MsoNormal" style="margin-left: .25in; mso-list: l1 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">v<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Desirably add an icon to the src/main/resources
for our project: <b>icon.png<o:p></o:p></b></div>
<div class="MsoNormal" style="margin-left: .25in; mso-list: l1 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">v<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->Add application configuration file: <b>app.rapc<o:p></o:p></b></div>
<div class="MsoNormal">
Run and deploy the application on Simulator:</div>
<div class="MsoNormal">
<o:p>
</o:p></div>
<div class="MsoNormal">
Run the following command in cmd: <b>mvn clean package. </b>This will create the necessary .cod files that
can be run on a simulator using the <b>“Load
Java Program”</b> option.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now, the below figure shows the eclipse project structure that appears
finally.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-JVOb4UD_Mio/UdL99Ip-UPI/AAAAAAAAAHA/V9unRl1v4Gg/s531/Untitl.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://3.bp.blogspot.com/-JVOb4UD_Mio/UdL99Ip-UPI/AAAAAAAAAHA/V9unRl1v4Gg/s531/Untitl.png" width="330" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<b><u>The app.rapc <o:p></o:p></u></b></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MIDlet-Name</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: HelloBB<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MIDlet-Version</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: 1.0<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MIDlet-Vendor</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: Your Name Here<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MIDlet-Jar-URL</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: hellobb.jar<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MIDlet-Jar-Size</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: 0<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MicroEdition-Profile</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: MIDP-2.0<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MicroEdition-Configuration</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: CLDC-1.1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Courier New"; font-size: 10.0pt;">MIDlet-1</span></b><span style="font-family: "Courier New"; font-size: 10.0pt;">: ,icon.png,<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal">
<b><span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">RIM-MIDlet-Flags-1</span></b><span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">: 1<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<b><u>The HelloBB.java<o:p></o:p></u></b></div>
<div>
<pre class="brush:java">import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;
public class HelloBB extends UiApplication
{ public static void main(String[] args)
{
UiApplication app = new HelloBB();
app.enterEventDispatcher();
}
public void activate()
{
this.pushScreen(new HelloBBScreen());
}
//create a new screen that extends MainScreen, which provides
//default standard behavior for BlackBerry applications
private static final class HelloBBScreen extends MainScreen
{
private HelloBBScreen()
{
//invoke the MainScreen constructor
super();
//add a title to the screen
LabelField title = new LabelField("HelloBB", LabelField.ELLIPSIS
| LabelField.USE_ALL_WIDTH);
setTitle(title);
//add the text "Hello Blackberry!!" to the screen
add(new RichTextField("Hello Blackberry!!"));
}
//override the onClose() method to display a dialog box to the user
//with "Goodbye!!" when the application is closed
public boolean onClose()
{
Dialog.alert("Good Bye!!");
//exits the app cleanly
System.exit(0);
return true;
}
}
}
</pre>
</div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal">
<div class="MsoNormal">
<b><u>The pom.xml<o:p></o:p></u></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">project</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">xmlns</span>=<i><span style="color: #2a00ff;">"http://maven.apache.org/POM/4.0.0"</span></i><span style="color: #7f007f;">xmlns:xsi</span>=<i><span style="color: #2a00ff;">"http://www.w3.org/2001/XMLSchema-instance"</span></i><span style="color: #7f007f;">xsi:schemaLocation</span>=<i><span style="color: #2a00ff;">"http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">modelVersion</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">4.0.0</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">modelVersion</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">org.hello.bb</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><u><span style="font-family: 'Courier New'; font-size: 10pt;">hellobb</span></u><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">name</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">HelloBB</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">name</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">packaging</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">jar</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">packaging</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">1.0</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><!--</span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"> Specifies the RIM API version..All RIM device software is
backward</span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"> compatible</span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;">--></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">properties</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version.net.rim.api</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">5.0.0</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version.net.rim.api</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">properties</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">dependencies</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">dependency</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">net.rim</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">net_rim_api</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">${version.net.rim.api}</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">scope</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">system</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">scope</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">systemPath</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">${env.RIM_JDE_HOME}\net_rim_api.jar</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">systemPath</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">dependency</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">dependencies</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">build</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugins</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">org.apache.maven.plugins</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><u><span style="font-family: 'Courier New'; font-size: 10pt;">maven</span></u><span style="font-family: 'Courier New'; font-size: 10pt;">-eclipse-<u>plugin</u></span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">outputDirectory</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">bin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">outputDirectory</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><!--makes sure the
Application code is JDK 1.2 compliant since that’s what RIM devices
mandate--></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">org.apache.maven.plugins</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">maven-compiler-plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">source</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">1.2</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">source</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">target</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">1.2</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">target</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><!-- makes proper
environmental setup check --></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">org.apache.maven.plugins</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">maven-antrun-plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">executions</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">execution</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">id</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">OS_Environment_Validation</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">id</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">phase</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">validate</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">phase</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> <</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">tasks</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">property</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">environment</span>=<i><span style="color: #2a00ff;">"env"</span></i>
<span style="color: teal;">/></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">fail</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">message</span>=<i><span style="color: #2a00ff;">"RIM_JDE_HOME environment variable must be set to
the home directory of the Blackberry JDE Environment. For instance, when using
the eclipse JDE plugin, it could look something like:
C:\projects\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">condition</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">and</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">os</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">family</span>=<i><span style="color: #2a00ff;">"windows"</span></i>
<span style="color: teal;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">not</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">isset</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">property</span>=<i><span style="color: #2a00ff;">"env.RIM_JDE_HOME"</span></i>
<span style="color: teal;">/></</span><span style="color: #3f7f7f;">not</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">and</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">condition</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">fail</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">tasks</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goals</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goal</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">run</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goal</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goals</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">execution</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">execution</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">id</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">App_Creation_Deployment</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">id</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">phase</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">package</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">phase</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;">
<span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;"> <tasks</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 84pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">property</span><span style="font-family: "Courier New"; font-size: 10.0pt;">
<span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"preverify_target"</span></i> <span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"${basedir}\target\app-binary"</span></i> <span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">property</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"preverify_src" </span></i> v<span style="color: #7f007f;">alue</span>=<i><span style="color: #2a00ff;">"${basedir}\target\${project.artifactId}.jar"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in; text-indent: 24pt;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">property</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"rapc_src"
</span></i><span style="color: #7f007f;"> value</span>=<i><span style="color: #2a00ff;">"${preverify_target}\${project.artifactId}.jar"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">property</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"rapc_config"</span></i>
<span style="color: #7f007f;">value</span>=<i><span style="color: #2a00ff;">"${basedir}\app.rapc"</span></i> <span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">delete</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">dir</span>=<i><span style="color: #2a00ff;">"${preverify_target}"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">delete</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">file</span>=<i><span style="color: #2a00ff;">"${preverify_src}"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">mkdir</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">dir</span>=<i><span style="color: #2a00ff;">"${preverify_target}"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">jar</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">file</span>=<i><span style="color: #2a00ff;">"${preverify_src}"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in; text-indent: 0.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">fileset</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">dir</span>=<i><span style="color: #2a00ff;">"${basedir}\target\classes"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">jar</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">Generating the BlackBerry App....</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">Preverifying....</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">exec</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">dir</span>=<i><span style="color: #2a00ff;">"${preverify_target}"</span></i>
<span style="color: #7f007f;">executable</span>=<i><span style="color: #2a00ff;">"preverify"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 1.5in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">arg </span><span style="color: #7f007f; font-family: "Courier New"; font-size: 10.0pt;">line</span><span style="font-family: 'Courier New'; font-size: 10pt;">=</span><i><span style="color: #2a00ff; font-family: "Courier New"; font-size: 10.0pt;">"-classpath ${env.RIM_JDE_HOME}\net_rim_api.jar -d
${preverify_target} ${preverify_src}"</span></i><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">exec</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">Generating the Executable....</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">exec</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">dir</span>=<i><span style="color: #2a00ff;">"${preverify_target}"</span></i>
<span style="color: #7f007f;">executable</span>=<i><span style="color: #2a00ff;">"rapc"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">arg </span><span style="color: #7f007f; font-family: "Courier New"; font-size: 10.0pt;">line</span><span style="font-family: 'Courier New'; font-size: 10pt;">=</span><i><span style="color: #2a00ff; font-family: "Courier New"; font-size: 10.0pt;">"import=${env.RIM_JDE_HOME}\net_rim_api.jar
codename=${project.name} ${rapc_config} ${rapc_src}"</span></i><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">exec</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: teal;"><</span><span style="color: #3f7f7f;">echo</span><span style="color: teal;">></span>Deploying the App into the Simulator....<span style="color: teal;"></</span><span style="color: #3f7f7f;">echo</span><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">copy</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">todir</span>=<i><span style="color: #2a00ff;">"${env.RIM_JDE_HOME}\simulator"</span></i>
<span style="color: #7f007f;">overwrite</span>=<i><span style="color: #2a00ff;">"true"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">fileset</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">dir</span>=<i><span style="color: #2a00ff;">"${basedir}\target\app-binary"</span></i><span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">include</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"*.cod"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">include</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">name</span>=<i><span style="color: #2a00ff;">"*.debug"</span></i>
<span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">fileset</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">copy</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">Generating the
Desktop Application Loader......</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">echo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">copy</span><span style="font-family: "Courier New"; font-size: 10.0pt;"> <span style="color: #7f007f;">todir</span>=<i><span style="color: #2a00ff;">"${basedir}\target\app-binary"</span></i>
<span style="color: #7f007f;">overwrite</span>=<i><span style="color: #2a00ff;">"true"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt;"> f<span style="color: #7f007f;">ile</span>=<i><span style="color: #2a00ff;">"${basedir}\app.alx"</span></i><span style="color: teal;">/></span> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">tasks</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goals</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goal</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">run</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goal</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goals</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">execution</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">executions</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugins</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">build</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">project</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="color: teal; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: inherit;"><span style="line-height: 14px;">Now, we need to update our pom.xml to serve our purpose. Here's what I did:</span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: inherit; font-size: x-small;"><span style="line-height: 14px;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<strong><span style="font-weight: normal;"><span style="font-family: inherit;">We need to create a .properties
file and use them as our localization bundle files.<o:p></o:p></span></span></strong></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<strong><span style="font-weight: normal;"><span style="font-family: inherit;">Create .properties file in
eclipse and fill it with key=value pair for our localization. Create method in
class files that fetches localized string from these files whenever required.<o:p></o:p></span></span></strong></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<strong><i><span style="font-family: "Calibri","sans-serif"; font-weight: normal; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-weight: bold;">Inform maven about the use of properties file.<o:p></o:p></span></i></strong></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<strong><span style="font-family: "Calibri","sans-serif"; font-weight: normal; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-weight: bold;">We need to update the pom.xml as
shown:<o:p></o:p></span></strong></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><!-- add more resources to
build project --></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">org.apache.maven.plugins</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">maven-resources-plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">2.4</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: 'Courier New'; font-size: 10pt; line-height: 115%;"> <</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">/</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt; line-height: 115%;">></span><strong><span style="font-family: "Calibri","sans-serif"; font-weight: normal; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-weight: bold;"><o:p></o:p></span></strong></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNoSpacing">
<strong><span style="font-family: "Calibri","sans-serif"; font-weight: normal; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-weight: bold;">The above plugin tag is required to inform maven about the use of
resource files in our project. <o:p></o:p></span></strong></div>
<div class="MsoNoSpacing">
<strong><span style="font-family: "Calibri","sans-serif"; font-weight: normal; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-weight: bold;">Now, add the resource file and its location in the pom.xml<o:p></o:p></span></strong></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><!-- Adding .properties file
to project --></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">org.codehaus.mojo</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">groupId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">properties-maven-plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">artifactId</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">1.0-alpha-2</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">version</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">executions</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">execution</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">phase</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">initialize</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">phase</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goals</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goal</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">read-project-properties</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goal</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">goals</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">files</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">file</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">src\main\resources\LocaleBundleES.properties</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">file</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"><</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">file</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: 'Courier New'; font-size: 10pt;">src\main\resources\LocaleBundleEN.properties</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">file</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: 'Courier New'; font-size: 10pt;"></</span><span style="color: #3f7f7f; font-family: 'Courier New'; font-size: 10pt;">files</span><span style="color: teal; font-family: 'Courier New'; font-size: 10pt;">></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">configuration</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">execution</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">executions</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;"></</span><span style="color: #3f7f7f; font-family: "Courier New"; font-size: 10.0pt;">plugin</span><span style="color: teal; font-family: "Courier New"; font-size: 10.0pt;">></span><span style="font-family: "Courier New"; font-size: 10.0pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
</div>
<div class="MsoNoSpacing">
<span style="font-family: 'Courier New'; font-size: 10pt;"> </span><span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><!-- Adding
.properties file to project --><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><br /></span></div>
<div class="MsoNoSpacing">
<span style="color: #3f5fbf; font-family: "Courier New"; font-size: 10.0pt;"><br /></span></div>
<div class="MsoNoSpacing">
<span style="font-family: inherit;">And that's all. Run it through maven. Enjoy :)</span></div>
</div>
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-51940326364719801412013-05-16T11:12:00.000-07:002013-08-22T08:55:47.403-07:00Google maps on BlackBerry: Add location markers using KML<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr">
<b>Google maps for Blackberry</b> </div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
Today we will be starting with a BlackBerry application that invokes the google map with our given latitude/longitude location sets. We will learn how to make our application more appealing with the 'google' effect ;)</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
Right, so you're actually bored with the native BlackBerry maps application that comes with the BlackBerry device?</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
No? Really?You can't say that! </div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
Well I too was a bit uncomfortable developing maps applications using the native BlackBerry maps. To be honest it never gave me the correct direction from one place to another and so I decided to go with the Google maps that not only has an enhanced UI experience but is quite accurate too.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
So first thing first. What do we need?</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
1. An eclipse IDE that comes bundled with BlackBerry JDE these days. Get that bundle here: <a href="https://developer.blackberry.com/java/download/eclipse/">https://developer.blackberry.com/java/download/eclipse/</a></div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
2. Install Google maps on the simulator/device. You can go to <a href="http://www.google.com/mobile/maps/">http://www.google.com/mobile/maps/</a> from BlackBerry browser and install the Google maps application from there.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
3. A public url (You can't upload your .kml file to your local server like tomcat) to upload the KML file to be used in our application. (The url must not be 'https', otherwise we are going to get an error: <i><b>"The community map could not be displayed because it contains errors"</b></i>). I prefer using google sites for uploading my kml files.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
Next, it's time to start coding our application. Here we go! </div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
First we need to know if Google map is installed on the mobile phone. We do this by passing as string the module name to the code module manager.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
<pre class="brush:java">int mh = CodeModuleManager.getModuleHandle("GoogleMaps");</pre>
</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
If the value of mh is 0 it means Google map is not installed. </div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
Now , we will create our KML file by clicking in Eclipse's File menu then creating a file with the extention .kml. The file contains our locations to be marked on the map. </div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
The KML file's full path should be provided to the Application Descriptor. Again the file should not be uploaded on our internal server and the url must not be https.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
The KML file looks like this:<br />
<div>
<pre class="brush:xml"><kml xmlns="http://www.opengis.net/kml/2.2">
<document>
<folder>
<style id="highlightPlacemark">
<iconstyle>
<icon>
<href>http://maps.google.com/mapfiles/kml/paddle/red-stars.png</href>
</Icon>
</IconStyle>
</style>
<style id="normalPlacemark">
<iconstyle>
<icon>
<href>http://maps.google.com/mapfiles/kml/paddle/red-blank.png</href>
</Icon>
</IconStyle>
</style>
<stylemap id="exampleStyleMap">
<pair>
<key>normal</key>
<styleurl>#normalPlacemark</styleurl>
</pair>
<pair>
<key>highlight</key>
<styleurl>#highlightPlacemark</styleurl>
</pair>
</stylemap>
<placemark>
<styleurl>#exampleStyleMap</styleurl>
<name>Title - My Home</name>
<description>Location description</description>
<point>
<coordinates>55.274124,25.197645</coordinates>
</point>
</placemark>
<placemark>
<styleurl>#exampleStyleMap</styleurl>
<name>Title - My Car Park</name>
<description>Location description</description>
<point>
<coordinates>55.279789,25.197315</coordinates>
</point>
</placemark>
</folder>
</document>
</kml></pre>
</div>
<br /></div>
<div dir="ltr">
<pre class="brush:xml"></pre>
</div>
<div dir="ltr">
</div>
<div dir="ltr">
<kml xmlns="http://www.opengis.net/kml/2.2"><document><folder><placemark><point></point></placemark></folder></document></kml>
</div>
</div>
The normal placemark and highlighted placemark can be used to change marker colour or icon and add styles for markers when highlighted (by rolling over icon) or in normal state.
The markers are invoked inside the placemark tag of the location.
<br />
<pre class="brush:java">
String[] args = {"http://sites.google.com/site/mygooglesite/Home/location.kml"};
ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(mh)[0];
ApplicationDescriptor appdes = new ApplicationDescriptor(ad, args);
</pre>
<div dir="ltr">
That's it, its time to invoke the google maps application and voila!</div>
<div dir="ltr">
<pre class="brush:java">ApplicationManager.getApplicationManager().runApplication(appdes, true);</pre>
</div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F87b239e1-59dd-455d-b427-6585d77198c5&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F87b239e1-59dd-455d-b427-6585d77198c5&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
Let's see the screenshots of the above code result:
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-qZTZdlf43II/UZXML2rNmEI/AAAAAAAAAGc/6MA3eICT_0w/s1600/9800-01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-qZTZdlf43II/UZXML2rNmEI/AAAAAAAAAGc/6MA3eICT_0w/s1600/9800-01.jpg" height="640" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-mC8QCdRrhqk/UZXMLxoEJDI/AAAAAAAAAGg/PZavgyvYUkY/s1600/9800.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-mC8QCdRrhqk/UZXMLxoEJDI/AAAAAAAAAGg/PZavgyvYUkY/s1600/9800.jpg" height="640" width="320" /></a></div>
<br />
<div id="ss">
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-45549248875984373182012-11-26T08:55:00.003-08:002013-08-22T08:59:31.910-07:00Samsung galaxy note 2! <div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr">
Finally I have with me the incredibly creative Samsung galaxy note 2! It's amazing to have this beast with me. So far I have been reading alot about it on the web and the blogs all over the Internet. </div>
<div dir="ltr">
And yes after reading alot about it I was convinced that this is the cell phone I was looking for. An absolute stunner. </div>
<div dir="ltr">
Now, I think it's time to personally summarize few great features of the note 2. I wont go much into its specifications rather I would make it more of an eye candy for every reader! </div>
<div dir="ltr">
So let's get started. The first thing that anyone would notice is obviously the huge screen, a huge 5.5 inch Super AMOLED HD.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-UFt-Kuy5uU0/ULxqIbIrPmI/AAAAAAAAAFo/QRnBfpbUh6k/s1600/Screenshot_2012-12-03-14-12-01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://4.bp.blogspot.com/-UFt-Kuy5uU0/ULxqIbIrPmI/AAAAAAAAAFo/QRnBfpbUh6k/s1600/Screenshot_2012-12-03-14-12-01.png" width="360" /></a></div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
The touch and feel of this phone is slightly on the heavier side especially if you're coming from a smaller screen which most of us would have come from. But then after a couple of days you will start getting comfortable with it. I seem to enjoy it now!</div>
<div dir="ltr">
Now let's have a look at its first screen.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh4.ggpht.com/-aVk1rjsOVhg/ULt0H99hwYI/AAAAAAAAAFY/qamQtTJwG9w/s640/Screenshot_2012-11-26-21-59-45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh4.ggpht.com/-aVk1rjsOVhg/ULt0H99hwYI/AAAAAAAAAFY/qamQtTJwG9w/s640/Screenshot_2012-11-26-21-59-45.png" /></a></div>
<div dir="ltr">
A nice crystal display. </div>
<div dir="ltr">
Great!! Let's go into the applications screen. Another great feel about the display and smooth touch, I have hardly seen any lags. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh6.ggpht.com/-n0Ubay9foSs/ULOjuKnSewI/AAAAAAAAAEM/MPGru65g_3A/s640/Screenshots_2012-11-26-22-12-45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh6.ggpht.com/-n0Ubay9foSs/ULOjuKnSewI/AAAAAAAAAEM/MPGru65g_3A/s640/Screenshots_2012-11-26-22-12-45.png" /></a></div>
<div dir="ltr">
Now on the left we see a tray for multi tasking. It can be enabled or disabled via a long back button press. I have found this really cool, a great feature to have in your mobile. Only disadvantage is that you can't put your own apps in the tray :(</div>
<div dir="ltr">
Let's have a look at the screen shot while I was doing a demo of multi tasking for the blog.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh6.ggpht.com/-jKCAHDFhXxo/ULOiPtDIuxI/AAAAAAAAAD0/17auLxLkc4w/s640/Screenshots_2012-11-26-22-14-42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh6.ggpht.com/-jKCAHDFhXxo/ULOiPtDIuxI/AAAAAAAAAD0/17auLxLkc4w/s640/Screenshots_2012-11-26-22-14-42.png" /></a></div>
<div dir="ltr">
On the top is the S Note window that is one of the master piece that has been included in note 2. It gives you a next to real hand typing feel.You can also record your notes just by clicking the little red dot at the top. Largely smooth and comfortable. At the bottom is the browser that I was using just to show you and in between there is a highly customized pop up video player window that you can see. You can adjust the size of the window, drag it and take it anywhere on the screen. </div>
<div dir="ltr">
Good!</div>
<div dir="ltr">
OK let's go ahead. <br />
There's something interesting in the music player. You can control the music player with your voice commands for pause, next, back, volume. Really cool.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh3.ggpht.com/-sv6twBJ_gvg/ULtuD2z097I/AAAAAAAAAEg/mqeSFvKA2qM/s640/Screenshot_2012-11-26-22-58-31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh3.ggpht.com/-sv6twBJ_gvg/ULtuD2z097I/AAAAAAAAAEg/mqeSFvKA2qM/s640/Screenshot_2012-11-26-22-58-31.png" /></a></div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F654bccab-5ce7-499f-97d3-49c3747a774b&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F654bccab-5ce7-499f-97d3-49c3747a774b&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
<div dir="ltr">
I don't know about many instances but the cover art of your music files might be some random picture from your gallery, I guess that is when you do play around with your system files or may be when you do something tricky with some anti virus application. They seem to be the culprits.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
All right, now another interesting thing is the S-Pen. It comes with a lot of feature especially for some quick notes and tasks in the middle of something. For eg. just double tap while pressing the pen button and you get the S-Note popup at any screen. You can edit, paint, draw things to almost perfection, hovering over albums, video time line would give you the thumbnail view of them, long press the screen while pressing the button would capture a screenshot for you.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh4.ggpht.com/-SE7glUfoQE0/ULtwKR6nl_I/AAAAAAAAAFA/torHks4z9cA/s640/Screenshots_2012-11-26-22-11-58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh4.ggpht.com/-SE7glUfoQE0/ULtwKR6nl_I/AAAAAAAAAFA/torHks4z9cA/s640/Screenshots_2012-11-26-22-11-58.png" /></a></div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
Another thing that you can do is call, email, sms with the S-pen by drawing some gestures on quick command window. </div>
<div dir="ltr">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh4.ggpht.com/-2i7-vzXlzIM/ULtuHMI4tAI/AAAAAAAAAEo/kfonrMBLhCs/s640/Screenshots_2012-12-02-20-26-46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh4.ggpht.com/-2i7-vzXlzIM/ULtuHMI4tAI/AAAAAAAAAEo/kfonrMBLhCs/s640/Screenshots_2012-12-02-20-26-46.png" /></a></div>
<div dir="ltr">
You can enable that by swiping vertically to top on screen while pressing the button. You can scroll down the list or document by simply hovering over at the screen bottom or top. Very useful and a great addition to the set. </div>
<div dir="ltr">
Let's have a look at the gallery:</div>
<div dir="ltr">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh4.ggpht.com/-Nb6uRwdnE-g/ULtwCRuTdKI/AAAAAAAAAEw/Cq9BaAO-bvM/s640/Screenshots_2012-11-26-22-02-58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh4.ggpht.com/-Nb6uRwdnE-g/ULtwCRuTdKI/AAAAAAAAAEw/Cq9BaAO-bvM/s640/Screenshots_2012-11-26-22-02-58.png" /></a></div>
<div dir="ltr">
Different views of the gallery:</div>
<div dir="ltr">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh4.ggpht.com/-FW0WR3PJFOU/ULtwGyvxduI/AAAAAAAAAE4/lIeoXeJoGDc/s640/Screenshots_2012-11-26-22-03-21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh4.ggpht.com/-FW0WR3PJFOU/ULtwGyvxduI/AAAAAAAAAE4/lIeoXeJoGDc/s640/Screenshots_2012-11-26-22-03-21.png" /></a></div>
<div dir="ltr">
The helix - spiral view:</div>
<div dir="ltr">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://lh4.ggpht.com/-nxP7rZoefOI/ULtwPgXSqkI/AAAAAAAAAFI/KMYqSHfqAF8/s640/Screenshots_2012-11-26-22-04-03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://lh4.ggpht.com/-nxP7rZoefOI/ULtwPgXSqkI/AAAAAAAAAFI/KMYqSHfqAF8/s640/Screenshots_2012-11-26-22-04-03.png" /></a></div>
<div dir="ltr">
Actually, the list of items that you can do is a lot. I have only mentioned a few.</div>
<div dir="ltr">
With its powerful processor and speed the gaming experience is very good and so Note 2 is certainly a device to have :)</div>
<div dir="ltr">
Well I hope you've enjoyed the post. I'm still learning and exploring the device. So, watch out for more as I add more updates to the post. See you until then. </div>
<div dir="ltr">
~Peace~</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
</div>
<!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh4.ggpht.com%2F-nxP7rZoefOI%2FULtwPgXSqkI%2FAAAAAAAAAFI%2FKMYqSHfqAF8%2Fs640%2FScreenshots_2012-11-26-22-04-03.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh4.ggpht.com/-nxP7rZoefOI/ULtwPgXSqkI/AAAAAAAAAFI/KMYqSHfqAF8/s640/Screenshots_2012-11-26-22-04-03.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh4.ggpht.com%2F-aVk1rjsOVhg%2FULt0H99hwYI%2FAAAAAAAAAFY%2FqamQtTJwG9w%2Fs640%2FScreenshot_2012-11-26-21-59-45.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh4.ggpht.com/-aVk1rjsOVhg/ULt0H99hwYI/AAAAAAAAAFY/qamQtTJwG9w/s640/Screenshot_2012-11-26-21-59-45.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh6.ggpht.com%2F-n0Ubay9foSs%2FULOjuKnSewI%2FAAAAAAAAAEM%2FMPGru65g_3A%2Fs640%2FScreenshots_2012-11-26-22-12-45.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh6.ggpht.com/-n0Ubay9foSs/ULOjuKnSewI/AAAAAAAAAEM/MPGru65g_3A/s640/Screenshots_2012-11-26-22-12-45.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh4.ggpht.com%2F-2i7-vzXlzIM%2FULtuHMI4tAI%2FAAAAAAAAAEo%2FkfonrMBLhCs%2Fs640%2FScreenshots_2012-12-02-20-26-46.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh4.ggpht.com/-2i7-vzXlzIM/ULtuHMI4tAI/AAAAAAAAAEo/kfonrMBLhCs/s640/Screenshots_2012-12-02-20-26-46.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh3.ggpht.com%2F-sv6twBJ_gvg%2FULtuD2z097I%2FAAAAAAAAAEg%2FmqeSFvKA2qM%2Fs640%2FScreenshot_2012-11-26-22-58-31.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh3.ggpht.com/-sv6twBJ_gvg/ULtuD2z097I/AAAAAAAAAEg/mqeSFvKA2qM/s640/Screenshot_2012-11-26-22-58-31.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh6.ggpht.com%2F-jKCAHDFhXxo%2FULOiPtDIuxI%2FAAAAAAAAAD0%2F17auLxLkc4w%2Fs640%2FScreenshots_2012-11-26-22-14-42.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh6.ggpht.com/-jKCAHDFhXxo/ULOiPtDIuxI/AAAAAAAAAD0/17auLxLkc4w/s640/Screenshots_2012-11-26-22-14-42.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh4.ggpht.com%2F-SE7glUfoQE0%2FULtwKR6nl_I%2FAAAAAAAAAFA%2FtorHks4z9cA%2Fs640%2FScreenshots_2012-11-26-22-11-58.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh4.ggpht.com/-SE7glUfoQE0/ULtwKR6nl_I/AAAAAAAAAFA/torHks4z9cA/s640/Screenshots_2012-11-26-22-11-58.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh4.ggpht.com%2F-Nb6uRwdnE-g%2FULtwCRuTdKI%2FAAAAAAAAAEw%2FCq9BaAO-bvM%2Fs640%2FScreenshots_2012-11-26-22-02-58.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh4.ggpht.com/-Nb6uRwdnE-g/ULtwCRuTdKI/AAAAAAAAAEw/Cq9BaAO-bvM/s640/Screenshots_2012-11-26-22-02-58.png" --><!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Flh4.ggpht.com%2F-FW0WR3PJFOU%2FULtwGyvxduI%2FAAAAAAAAAE4%2FlIeoXeJoGDc%2Fs640%2FScreenshots_2012-11-26-22-03-21.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://lh4.ggpht.com/-FW0WR3PJFOU/ULtwGyvxduI/AAAAAAAAAE4/lIeoXeJoGDc/s640/Screenshots_2012-11-26-22-03-21.png" -->CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-62821758454178196312012-09-23T03:50:00.001-07:002013-08-22T09:04:06.740-07:00How to localize (Internationalization/i18n) an iPhone application.<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Localization inside the application without using iPhone language settings.</h2>
<div>
<div>
<br /></div>
<div>
Today we will start with the internationalization of an iPhone app from within the application. This is something most of us want to do as it not only helps the user experience but also prevents us from changing the iphone's language setting every time we want a different language for the app.</div>
<div>
<br /></div>
<div>
So quickly lets get started. We create a project in xcode and name it as you like it.</div>
<div>
<br /></div>
<div>
Now, the way to go about localizing the app is to create a ".strings" file in the app which can be created from resource like this:</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-yy0A62-rv8I/UF7kASGzwdI/AAAAAAAAADI/R5r5eCnZwZE/s1600/strf.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/-yy0A62-rv8I/UF7kASGzwdI/AAAAAAAAADI/R5r5eCnZwZE/s1600/strf.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Create a Localizable.strings file from resource</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
By default the name of our created language resource string file is '<span style="color: #b45f06;"><span style="font-family: Courier New, Courier, monospace;"><span style="background-color: white; font-size: 13px; line-height: 18.200000762939453px;">Localizable.strings</span></span> </span>'</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-UXC6Fq2dSF8/UF7n80_lOXI/AAAAAAAAADg/_GInQOZoCYo/s1600/g.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="189" src="http://2.bp.blogspot.com/-UXC6Fq2dSF8/UF7n80_lOXI/AAAAAAAAADg/_GInQOZoCYo/s320/g.png" width="320" /></a></div>
<div>
<br /></div>
<div>
What we have our app title at the moment is like this:</div>
<div>
<br />
<pre class="brush:oc">self.titleLabel.text = @"Welcome to CodeHunk!";</pre>
</div>
<div>
But we want to create our localization string taking values from our ".strings" file so we actually use a macro for this task which is <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">NSLocalizedString</span> and we use it like this:</div>
<div>
<br />
<pre class="brush:oc">self.titleLabel.text = NSLocalizedString(@"title", nil);
</pre>
</div>
<div>
Now if you go deep into NSLocalizedString in the definition you will find that it actually issomething like this:</div>
<div>
<br />
<pre class="brush:oc">#define NSLocalizedString(key, comment)
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]</pre>
</div>
<div>
<br />
this is responsible for getting the default strings file and search for the localized string we have passed in the method <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">NSLocalizedString</span>. The comment parameter is nothing but just to let you(as a translator) understand the use of key in our string file. So don't worry about that you can even leave it nil. More information can be found here in the Apple's reference doc.</div>
<div>
<br /></div>
<div>
Now is the most important and precise part of the application according to our demand. How do we manually guide the localizedStringForKey to pick our localized string from the ."strings" file(s) we have already created?</div>
<div>
<br /></div>
<div>
now if you look more into it you will find that the '<span style="color: #b45f06; font-family: Courier New, Courier, monospace;">Localizable.strings</span>' file has the following architecture.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-VV009y2a2e4/UF7m7wJzNtI/AAAAAAAAADY/ELnA114lmkY/s1600/fdh.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-VV009y2a2e4/UF7m7wJzNtI/AAAAAAAAADY/ELnA114lmkY/s1600/fdh.png" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Alright, now it is time we add our second language, let's take Spanish.</div>
<div>
we need to create a second file for Spanish. So there's a project folder created for each of our language like 'en.lproj' and 'es.lproj' and inside we have our<span style="color: #b45f06; font-family: Courier New, Courier, monospace;"> Localizable.strings</span> files.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-p16WIMmqnkA/UF7l5q8qxsI/AAAAAAAAADQ/n9jIlCQG6ic/s1600/loc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-p16WIMmqnkA/UF7l5q8qxsI/AAAAAAAAADQ/n9jIlCQG6ic/s1600/loc.png" /></a></div>
<div>
<br /></div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
<div>
<br /></div>
<div>
Our motive is to make use of these files as and when the user desires to change the language from within the application. </div>
<div>
<br /></div>
<div>
Here comes the most interesting part.</div>
<div>
<br /></div>
<div>
We will create a method lets say <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">languageSelectedStringForKey </span>and pass a <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">NSString </span>parameter called 'key'</div>
<div>
Our method is created in place of default <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">NSLocalizedString </span>to be able to pick a specific language bundle from within the application which is actually our prime focus!</div>
<div>
<br /></div>
<div>
Consider this:</div>
<div>
<br /></div>
<div>
Let's say we are getting our language from some LanguageManager class of say ConfigurationManager class in our application or for the time being we can simply take en or es. </div>
<div>
So we take the language in a</div>
<div>
<br />
<pre class="brush:oc">NSString *lang = [ ConfigurationManager language];
</pre>
</div>
<div>
Next, based on the language received we pick the pathForResource i.e en.lproj or es.lproj and take the value in an another</div>
<div>
<span style="color: #b45f06; font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<pre class="brush:oc">NSString *path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"];</pre>
</div>
<div>
<br /></div>
<div>
and that's it, </div>
<div>
<br /></div>
<div>
finally we providethe <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">NSBundle </span>to pick the localized string as per the lang that was provided from the user like this:</div>
<div>
<br />
<pre class="brush:oc">NSBundle* languageBundle = [NSBundle bundleWithPath:path];</pre>
</div>
and make use of <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">localizedStringForKey </span>like this:<br />
<br /></div>
<div>
<br />
<pre class="brush:oc">NSString* str=[languageBundle localizedStringForKey:key value:@"" table:nil];</pre>
</div>
<div>
Simple isn't it?</div>
<div>
return the 'str' string for the value of the localized string.</div>
<div>
<br /></div>
<div>
So finally our custom method looks like this, you can now call this method where ever you need to localize a string in your app:</div>
<div>
<br /></div>
<div>
<br />
<pre class="brush:oc">/*
@param: key(gives value of the key from Localizable.strings file)
*/
+(NSString*)languageSelectedStringForKey:(NSString *)key{
NSString *lang = [ ConfigurationManager language];
NSString *path;
if([lang isEqualToString:@"en"])
path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"];
else if([lang isEqualToString:@"es"])
path = [[NSBundle mainBundle] pathForResource:@"es" ofType:@"lproj"];
NSBundle* languageBundle = [NSBundle bundleWithPath:path];
NSString* str=[languageBundle localizedStringForKey:key value:@"" table:nil];
return str;
}</pre>
<br />
<div>
<br /></div>
<div>
Hope you've enjoyed the post!</div>
<div>
Follow CodeHunk for more.</div>
</div>
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com1tag:blogger.com,1999:blog-2080198913141081076.post-51576192619903026222012-09-22T01:59:00.002-07:002013-08-22T09:04:56.230-07:00Apple and patents: You decide. <div dir="ltr" style="text-align: left;" trbidi="on">
<i><span style="font-family: inherit;">"HTC’s stock price has been sent into a tumble, after imports of new HTC handsets</span> into the US were blocked in customs by an Apple complaint to the ITC"</i><br />
<div>
<i><br /></i></div>
<div>
<i>"Apple wins preliminary injunction against Galaxy Tab 10.1 in US, Samsung appeals but in vain"</i></div>
<div>
<i><br /></i></div>
<div>
<i>"Apples wins over HTC...</i></div>
<div>
<i>"Apple wins over Samsung...</i></div>
<div>
<i><br /></i></div>
<div>
<i>10 years later</i></div>
<div>
<i>"Apple wins over nature" OMG!</i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-02vAO405GjE/UF19uwX1JNI/AAAAAAAAAC0/_hpX0bntcE8/s1600/asg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-02vAO405GjE/UF19uwX1JNI/AAAAAAAAAC0/_hpX0bntcE8/s1600/asg.png" /></a></div>
<div>
<i><br /></i></div>
<div>
<i>and so on...</i></div>
<div>
<i><br /></i></div>
<div>
<i><br /></i></div>
<div>
Hmm..seems like Apple's made its mind on now what could be the ever growing and fierce patent wars. Hold on Apple guys give me a break!, that's getting really nervy now.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Apple patents a mockery to open source?</b></div>
<div>
<br /></div>
<div>
I have no idea what might be the position of the Open Source community at the moment. Sitting ducks? well quite comfortably. Open source with its heart, soul and mind will always be OPEN! No one could say you can not take that advantage of robust and short code while designing your web page. Its for god's sake open and for the advantage of the technological upgrades to the society. </div>
<div>
<br /></div>
<div>
I am actually deeply hurt by the court ruling the other day that gave Apple the somewhat ridiculous and absurd win over Samsung making a mockery of some legit lawsuits over some unthinkable reasons.</div>
<div>
<br /></div>
<div>
I have read the clauses of the lawsuit saying that it is not just the code, it could be a design, a metaphor, an approach. Now if you see an application making use of a Dock, watch out for Apple lawyers.</div>
<div>
<br /></div>
<div>
So hold on James Gosling is coming to you to sue over the use of using Java in your code.</div>
<div>
Coming to the rivalry, Samsung could actually reply back to Apple on numerous patent breaches, one that I personally think is I see Apple making use of the notification bar which was actually an invention of Android. Then Apple could reply back to Samsung on the shapes and so its like passing the ball game, which is eternal.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-fzgDHdzeg8U/Tqf5M_S2UtI/AAAAAAAAKq4/lOXMg5HGk54/slide-to-unlock.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="146" src="http://3.bp.blogspot.com/-fzgDHdzeg8U/Tqf5M_S2UtI/AAAAAAAAKq4/lOXMg5HGk54/slide-to-unlock.jpg" width="200" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
And so let me give you some idea about how this could go down. Its like a beast hovering over you for any of your movement waiting to catch you by your throat.</div>
<div>
<br /></div>
<div>
You see where is this all going to? It is like suing you of how you prepare your favorite dish. Its like suing you over the use of geometry in engineering, its like suing you over the use of a curved handle of your Grand Pa's walking stick. Phew! Come on this is never ending now...</div>
<div>
<br /></div>
<div>
This torn patent system is now taking us to a point where a patent holder controls the use of our imagination, creativity and advancement in creating the next step technological concepts.</div>
<div>
<br /></div>
<div>
<b>Are we too harsh on Apple?</b></div>
<div>
<b><br /></b></div>
<div>
We believe that the true sense of innovation could come only through an unbiased and fair open source model, but wait. </div>
<div>
Isn't it the fact that for many years now Linux and open source model have been working on the Mac designs and UI for their systems? we know there has been a lot of achievements that came as a result of concepts originating from the open source model. </div>
<div>
<br /></div>
<div>
But it is also a fact that for quite some time now Apple has been the driving force of all sorts of innovation to the latest technology in computing, hardware, gadgets and obviously the concepts(iPod, iPad, iPhone etc).</div>
<div>
<br /></div>
<div>
It is also a fact that the open source hasn't lately arrived with anything as revolutionizing as Apples hardware/software which has revolutionized the market beyond any recognition.</div>
<div>
<br /></div>
<div>
Also most of us are already eager to criticize on Apples idea and concepts out of our emotions and feelings for what we hear, do and for the sake of open source.</div>
<div>
And most of them hasn't even used any Apple product to back any comparisons they make.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
In the end what really offend us are the trolling patents of Apple which has screwed up Apple's reputation big time. Just for an example there was a news where Apple is taking issue with the trademark of an online grocery store that goes by the name A.pl.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://images.pcworld.com/images/article/2012/09/apple_logos-11405868.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="189" src="http://images.pcworld.com/images/article/2012/09/apple_logos-11405868.jpg" width="320" /></a></div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
<div>
<br /></div>
<div>
Apple reasons that the store is deliberately using the similarity to promote itself while trying to confuse people with Apple's products. </div>
<div>
<br /></div>
<div>
Imagine people getting confused over and iPhone and A.pl products.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-D4jxUIe3NOI/UF183Ulg2EI/AAAAAAAAACs/18o7Xqw-6hI/s1600/avp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="http://3.bp.blogspot.com/-D4jxUIe3NOI/UF183Ulg2EI/AAAAAAAAACs/18o7Xqw-6hI/s320/avp.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Here's what the stackoverflow has to say about patents. Take a look here</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://blog.flattr.net/wp-content/uploads/2011/09/stackoverflow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://blog.flattr.net/wp-content/uploads/2011/09/stackoverflow.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://blog.stackoverflow.com/2012/09/askpatents-com-a-stack-exchange-to-prevent-bad-patents/?cb=1" style="background-color: #fdfdfd; font-family: 'Helvetica Neue', Helvetica, Arial, Sans-seris; font-size: 22px; line-height: 1.3;" target="_blank">A Stack Exchange To Prevent Bad Patents</a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the end really it's up to you to decide.</div>
<div>
<br /></div>
<div>
<br /></div>
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-89421051988830862772012-09-18T09:58:00.001-07:002013-08-22T09:05:15.456-07:00The iPhone 5 launch: Disappointing?<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: inherit;">Alright so Apple's iPhone 5 has broken all expectations about its sale and has smashed all records before hitting the shelves with more than 2 million pre-orders of the coveted smartphone in its first 24 Hours of launch on 12 September.</span><br />
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">And the launch was no less dramatic as Apple gave the world the biggest hint in the shadow of number '5'.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-HP80_T7mEcQ/UFifgLMMOYI/AAAAAAAAACU/zty8iyzMTps/s1600/i5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-HP80_T7mEcQ/UFifgLMMOYI/AAAAAAAAACU/zty8iyzMTps/s1600/i5.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
Now what was expected?</div>
<div>
A hell lot. Yup and so the old reminiscence of Steve Jobs's defining the use of the <i>'iPod Pocket'</i> in our jeans at the launch of iPod then was there in our minds.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-qRp8c1JD5yw/UFihWf5TAuI/AAAAAAAAACc/xzplZS_2lco/s1600/i5vs3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-qRp8c1JD5yw/UFihWf5TAuI/AAAAAAAAACc/xzplZS_2lco/s1600/i5vs3.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
<div>
Honestly, to me it was disappointing to see Apple missing out on many areas to its contenders, specially Samsung Galaxy S3. </div>
<div>
<br /></div>
<div>
Here's the top 3 areas I found was a bit of let down some may say, take a look:</div>
<div>
<ol>
<li>The biggest disappointment to me was from the developer's point of view where the bigger screen of the new iPhone demands changes in the old and running Apps of many publishers. That now requires some upgrades thanks to the bigger screen and not the hardware architecture mind you!</li>
<li>There is no <a href="http://gizmodo.com/5707321/what-is-near+field-communication" target="_blank">NFC</a> feature for the new iPhone 5 and that's a real a let down considering the fact that much hype was created before the launch of iPhone 5 and for all the waiting buyers, well it is some disappointment. </li>
<li>The possible price without carrier remains a concern for less extravagant buyers. Well expected price, take $650 for now!</li>
</ol>
<div>
Beside the above three areas I think the others are less concerning and I say it because I have found the iPhone 5 to be more luxurious than driven towards some substantial tech upgrades.</div>
</div>
<div>
<br /></div>
<div>
But again somehow Apple has its own charm. Touch is aw-some with no lags and of course the graphics has always attracted many of us. The introduction of 4G-LTE, the enhanced battery life and many more.</div>
<div>
<br /></div>
<div>
Well next I am going to talk about the best free iPhone apps available. </div>
<div>
See ya folks !</div>
<div>
<br />
<br />
<span style="color: #0c343d;"><b>Here's something interesting about the iPhone 5:</b></span><br />
<span style="color: #0c343d;"><b><br /></b></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/NA3GhZals5c?feature=player_embedded' frameborder='0'></iframe></div>
<span style="color: #0c343d;"><b><br /></b></span>
<span style="color: #0c343d;"><b><br /></b></span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0tag:blogger.com,1999:blog-2080198913141081076.post-35052012985186164242012-09-15T01:19:00.002-07:002013-08-22T09:05:33.598-07:00Cell height as per text length: iPhone Development<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<a href="http://4.bp.blogspot.com/-PwWCZBVc2j4/UFQ7NZ3_pvI/AAAAAAAAABI/hGCgrAfvhNM/s1600/iphonedev.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-PwWCZBVc2j4/UFQ7NZ3_pvI/AAAAAAAAABI/hGCgrAfvhNM/s1600/iphonedev.jpg" /></a>
How to dynamically adjust cell's height as per the text length in iPhone development?</h2>
<div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Well today I am going to start with a method that will calculate the cell's height appropriate to the length of text and then adjust the cell's height accordingly in an iPhone development.</div>
<div>
<br /></div>
<div>
The iPhone SDK comes with lots of interesting features and lets you design some of your custom made methods.</div>
<div>
<br /></div>
<div>
I was recently faced with a situation where my text was dynamic and hence I had to display it inside the cell that will automatically expand for the text's size. </div>
<div>
Previously my text would be half chunked! And so I came up with this solution.</div>
<div>
<br /></div>
<div>
Let's get started.</div>
<div>
<br /></div>
<div>
First we get our titles and subtitles for the display screen (If any)</div>
<div>
<br />
<pre class="brush:oc">NSString * title = @"Your title";
NSString * subTitle = @"Your Subtitle";</pre>
</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: inherit;">we can add it to the cell's height if we want like this:</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<br />
<pre class="brush:oc">[self heightOfCellWithTitle:title andSubtitle:subtitle]
</pre>
</div>
<div>
Next we need to over ride the method "<span style="color: #b45f06; font-family: Courier New, Courier, monospace;">heightForRowAtIndexPath</span>":</div>
<div>
<br /></div>
<br />
<pre class="brush:oc">- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath</pre>
<div>
<div>
<br /></div>
<div>
If we are getting our text of the cell dynamically, we can do something like this:</div>
<div>
Here we pick the text from our sections located at <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">indexPath.section</span>:</div>
<div>
<br />
<pre class="brush:oc">NSString* dynamicText = [[[sections objectAtIndex:indexPath.section] objectForKey:@"fields"] objectAtIndex:indexPath.row];</pre>
</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
Next we define our dynamic text with font and its size, I preferred 12.0f.</div>
<div>
<br />
<pre class="brush:oc">dynamicText sizeWithFont:[UIFont systemFontOfSize:12.0f]</pre>
</div>
<div>
<br /></div>
<div style="width: 70%; margin: 0px auto;"><br/><br/>
<SCRIPT charset="utf-8" type="text/javascript" src="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=GetScriptTemplate"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-in.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=IN&ID=V20070822%2FIN%2Fcodehunk-21%2F8010%2F46da4d01-6bff-497d-9c29-f3b972a8fbad&Operation=NoScript">Amazon.in Widgets</A></NOSCRIPT>
<br/></div>
<div>
What we need next is the most important part, here we code what to expect from our cell when it receives our dynamic text:</div>
<div>
We will ask the text to be constrained inside the width of the cell and so we do something like this:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<br />
<pre class="brush:oc">[constrainedToSize:CGSizeMake(220.0, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap].height
</pre>
<pre class="brush:oc"></pre>
</div>
<div>
We have set the <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">CGFLOAT </span>to <span style="color: #b45f06; font-family: Courier New, Courier, monospace;">MAX </span>and we have also employed a wrap for our text this way it does not get chunked. And hence calculated the height of the dynamic text of the cell.</div>
</div>
<div>
<br /></div>
<div>
Finally we apply some constant to the above factor on its height this can be 0 or something. In my case it worked for an accurate 44.0!</div>
<div>
<br /></div>
<div>
So, finally our method code looks like this:</div>
<div>
<span style="color: #b45f06;"><br /></span></div>
<div>
<div>
<br />
<pre class="brush:oc">- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString* dynamicText =[[[sections objectAtIndex:indexPath.section] objectForKey:@"fields"] objectAtIndex:indexPath.row];
return [ dynamicText sizeWithFont:[UIFont systemFontOfSize:12.0f] constrainedToSize:
CGSizeMake(220.0, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap].height + 44.0;
}</pre>
</div>
</div>
<div>
<span style="font-family: inherit;">Beautiful isn't it ;)</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">Hope this helps you as it did helped me. Alright guys keep coming back for more. See u then.</span></div>
<div>
<span style="font-family: inherit;">Hasta la vista!</span></div>
</div>CodeHunkhttp://www.blogger.com/profile/10414443596831560074noreply@blogger.com0