Enterprise Mobile Solutions
For once mobile solutions seem to be grabbing the attention of folks in the Enterprise application space. Though the mobile content delivery industry existed in some form or another since the days of WAP 1.0 it is the Japanese Giant NTTDCoMo with their cHTML based imode service that popularized and to some extend defined the user experience for mobile browsing.
Desktop Synchronization
In reality a niche market already existed for large sized phones which were derived from the PDA or Hand held device. On a closer look we can see that hand held devices has their lineage in the popular electronic diaries and it is no wonder that they are modeled as connection less devices. To transfer content synchronization frameworks - call it hot sync ,active sync , intelli sync ,desktop redirector - were used. OMA went ahead and even defined a Synchronization Markup . It is only natural that when PDAs and Phones converged as PDA/Smart Phones they retained their synchronization capabilities.
Wireless Synchronization
Those applications that used desktop synchronization to add content or configuration now had a new channel to access data and thus was born the wireless synchronization libraries. This lead to another slew of applications which use the synchronization model taunting features like off line content viewing and scheduled synchronizations. This model became the mainstay for many mobile content providers (Avant Go,Mobileplay etc) and they established the market for mobile applications at a time when carrier bandwidth resembled the trickling water connections in third world countries.
Java and Games
Mobile gaming industry gradually hooked on and with the advent of BREW and J2ME / MIDP enabled phones application development became more rampant and so did the incompatibility issues with various models of phones. Connection speeds were another bottle neck. Many applications became true client server applications (Mobile IM ,Multi player Games ) which mad heavy demand of connection bandwidth. By the first 5 years of the new millennium mobile applications saw widespread acceptance and the no of users who use their mobile data connection for accessing web grew rapidly.
Elephants Dance
Carrier companies soon realized that with sloppy gprs connections they cannot sustain the growth and many took initiatives to offer better speeds now. A fully connection oriented content delivery model is now a viable option. However the challenges of trans coding the content to fit into the limited screen of the devices is a mammoth task. Some browsers (Blazer from Palm and Blackberry browser , browsers from Nokia etc ) do some restructuring and reformatting of content at the device side. The vast variety of content formats and the wide array of devices prevent the application developer from providing a one size fit's all solution to mobile content delivery.
Trans coding the new panache
Content trans coding proxy servers are the latest panache to these woes. Opera for example has a network of servers which transcode the content in a way ie suitable for the devices that use the opera mini browser. Again this requires the services of an intermediate proxy and possibly can work only with client applications from the same vendor. Here comes server side filters and trans coding agents. There are a variety of server side plug ins which reside in the server and actively trans code and do advanced services like pagination caching etc. This ensures that the content is accessible to desktop users and mobile users alike.
Which solution is the best
Product companies started eying this growing market of mobile enabled web services and thus was born the enterprise mobility frameworks. In this series we examine the various models and frameworks that are available for delivering content to the mobile users. Checkout this column for more ...
The author is the chief mentor for Crimson Computing which provides consulting in enterprise mobile solutions. He is an expert in the various mobile product frameworks and is currently assisting the mobilization efforts of IT divisions of major organizations.
Using JFreeChart to create chart images
On my recent project I've been on the lookout for a good charting tool. After evaluating many i realized that JFreeChart is the one . It is completely open source and available free.There is a great book about how to use that and in the true open source spirit i recommend that you buy the book if you need to learn more about JFreeChart and show your support for the folks behind this.
I needed a quick solution to put clickable image chart on my web application. If you too have the same requirement , this might help.
The java of the code is quite wrong, non static methods etc etc. but this is the initial working code that i wrote as a start ..so excuse the lack of elegance :-)..
The resulting chart is on the left
You could use this in a servlet as follows public class EventChart extends HttpServlet { private static final Logger LOGGER = Logger .getLogger(EventChart.class.getCanonicalName()); @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { SiteEventChart eventChart = new UsageChart(); eventChart.writeChar(response.getOutputStream()); } }
In the jsp use the code .....
package com.mobchannel.usagettracker.charts;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.DateTickUnit;
import org.jfree.chart.axis.TickUnits;
import org.jfree.chart.imagemap.ImageMapUtilities;
import org.jfree.chart.imagemap.StandardToolTipTagFragmentGenerator;
import org.jfree.chart.imagemap.StandardURLTagFragmentGenerator;
import org.jfree.chart.imagemap.URLTagFragmentGenerator;
import org.jfree.chart.labels.StandardXYToolTipGenerator;
import org.jfree.chart.labels.XYToolTipGenerator;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.urls.StandardXYURLGenerator;
import org.jfree.chart.urls.XYURLGenerator;
import org.jfree.data.time.RegularTimePeriod;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.time.Week;
public class UsageChart{
private static final Logger LOGGER
= Logger
.getLogger(usagettrackerChart.class.getCanonicalName());
public enum EventType
{
VIEW,
EDIT, DELETE, ALERT
}
public TimeSeries getTimeSeries(EventType type) {
final TimeSeries series = new TimeSeries(type.name().toUpperCase(),Week.class);
RegularTimePeriod
period = new Week();
for (int i
= 0; i < 5; i++) {
series.add(period,
(type.ordinal()+1)* 5);
period = period.next();
}
return series;
}
public String getImageMap() throws
IOException{
ChartRenderingInfo info = new ChartRenderingInfo();
generateChart(new ByteArrayOutputStream(),
info);
String map = ImageMapUtilities.getImageMap("CHART",
info,new StandardToolTipTagFragmentGenerator
(),new StandardURLTagFragmentGenerator());
LOGGER.log(Level.INFO,map);
return map;
}
public void writeChar(OutputStream outStream) throws IOException{
generateChart(outStream, new ChartRenderingInfo());
}
public void generateChart(OutputStream outStream,ChartRenderingInfo
info) throws IOException{
final TimeSeriesCollection dataSet = new TimeSeriesCollection();
dataSet.addSeries(getTimeSeries(EventType.VIEW));
dataSet.addSeries(getTimeSeries(EventType.ALERT));
dataSet.addSeries(getTimeSeries(EventType.EDIT));
dataSet.addSeries(getTimeSeries(EventType.DELETE));
final JFreeChart chart = ChartFactory.createXYLineChart(
"Site
Event Tracker", "Day", "Event", dataSet,
PlotOrientation.VERTICAL, true, true, false);
XYPlot plot = (XYPlot) chart.getPlot();
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(0, true);
renderer.setSeriesLinesVisible(1, true);
renderer.setSeriesShapesVisible(1, true);
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
renderer.setURLGenerator(new StandardXYURLGenerator());
plot.setRenderer(renderer);
plot.setDomainAxis(new DateAxis());
final DateAxis axis = (DateAxis) plot.getDomainAxis();
final TickUnits standardUnits = new TickUnits();
standardUnits.add(new DateTickUnit(DateTickUnit.DAY, 1,
new
SimpleDateFormat("MMM dd ''yy")));
standardUnits.add(new DateTickUnit(DateTickUnit.DAY, 7,
new
SimpleDateFormat("MMM dd ''yy")));
standardUnits.add(new DateTickUnit(DateTickUnit.MONTH, 1,
new
SimpleDateFormat("MMM ''yy")));
axis.setStandardTickUnits(standardUnits);
ChartUtilities.writeChartAsJPEG(outStream, chart, 400,
300,info);
}
}
Last but not the least , here is the web.xml to do the necessary configurations...
Cloud Computing - A platform Study..
7th , 9th no, You got it wrong. This is the geek question, if you aren't aware of what a cloud is you might as well lose your scalability expert credentials if you are one.
Clouds offer you an elastic solution to your application needs. When you are a start up all you would need would be a shared hosted environment , but how about if your app becomes the biggest hit on the planet. Addressing this issue has been the nightmare of all web entrepreneurs, what if i become hugely successful with my first launch.
Obviously you can't build an array of virtualized servers expecting that you are going to achieve sustainable growth.Out of a thousand web start ups only a handful survive the first 2 years and only a few are even venture funded .And out of those only a few survive after 5 years.For example I've been in business for close to 2 years now , but i haven't seen traffic yet that justifies my dedicated server sitting on an optic fiber from verizon. I don't even need that, but i may become successful by the end of this year and might have a billion users. How can i plan for that event. I cannot be building arrays of virtualized servers when i should be building my app. Nor have i got the skills necessary to maintain an array.I have to hire the experts and can i afford that now?. Even if i can , should i . Do i have an alternative?
Here is where a cloud can help me.The cloud removes you from the hassle of scalability planning. There aren't a quite a large number of providers, Amazon EC2 service and S3 environments offer completely owned virtual elastic environments. It allows you to host your own AMI(Amazon Machine Image) which is almost similar to VMWare's mechanism of bootstrapping images.But one obvious disadvantage is if you have to frequently change your image ,then you could be in trouble as each image is to be reinstalled and ec2 does not allow you to just change/upgrade your environment. I am not yet sure how you would manage an app upgrade without reinstalling an AMI.Few other cloud environments exist , google's App Engine allows you to run Python application which is good if you are a python programmer, but what if you want to do a project on ruby on rails , Engine Yard is there for you.What if you want to do java or .NET.
Hmm.. i wouldn't want to deploy my app on a platform which forces me to use a particular framework.I would wait for a solution which allows you to install applications but frees you from the task of installing and maintaining images. May be a new provider will come who offers virtualized linux servers in a cloud with elastic scalability and that solution would take away trophy of the best cloud platform . Till that i would give my vote for the best cloud platform to Amazon's S3 unless you are decided on python or rails as your app framework.