22Mar

Mobile phone managment on Ubuntu with Wammu

I’ve been searching for a decent application for Ubuntu the enables me to manage my mobile phone and synchronizing it, non the less connecting to send/receive messages from the Laptop as it is much easier to be done from computer than tiny phone :P , and finally I found wammu which is Mobile phone manager using Gammu as its backend.
It works with any phone that Gammu supports, including many models from Nokia, Siemens, and Alcatel. It has complete support (read, edit, delete, copy) for contacts, todo, and calendar. It can read, save, and send SMS. It includes an SMS composer for multi-part SMS messages, and it can display SMS messages that include pictures. Currently, only text and predefined bitmaps or sounds can be edited in the SMS composer. It can export messages to an IMAP4 server (or other email storage).
This program does not support browsing files in phone, use gMobileMedia instead.

Homepage

to install it:

sudo apt-get install wammu

and thats it, very hard ha :)

it has a very friendly interface to manage the mobile phone and many features too… the most important one is the configuration wizard to add a new phone!

Posted in Ubuntu

07Mar

Creating first service

In the previous post we saw how to inject resources to bundles, and today we will make our first service it is going to be a Date formatting service.

you can download the source for this service from dateformattertar and now we will start creating our service…

go to in the same workspace we started before to get advantage of the target platform and the log4j configuration

File –> New –> Other…

And select to create Plug-in project

screenshot-new

Click next and name the project DateFormatter and don’t forget to change the target platform to “an OSGi Target”

screenshot-new-plug-in-project

Click Next and Finish.

In thee newly created project Open the MAINFEST.MF file in the META-INF folder and add the “org.apache.log4j” to the imported packages as we are going to use it.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: DateFormatter Plug-in
Bundle-SymbolicName: DateFormatter
Bundle-Version: 1.0.0
Bundle-Activator: dateformatter.Activator
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version=”1.3.0?,
org.apache.log4j

Now create a sub-package “dateformatter.app” And create a new Interface in it with the name DateFormatter

package dateformatter.app;

import java.util.Date;

public interface DateFormatter {

String formatDate(Date date);

}

Now create a sub-package “dateformatter.app.impl” And create a new Interface in it with the name DateFormatterImpl

package dateformatter.app.impl;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.log4j.Logger;

import dateformatter.app.DateFormatter;

public class DateFormatterImpl implements DateFormatter {

private String format;

private Logger logger = Logger.getLogger(DateFormatterImpl.class);

public String getFormat() {
return format;
}

public void setFormat(String format) {
this.format = format;
}

@Override
public String formatDate(Date date) {
logger.info(“formatting a new date”);
SimpleDateFormat formatter = new SimpleDateFormat(format);
return formatter.format(date);
}

}

Now all we need to do is to add a spring definition for our classes, spring looks for application context in the META-INF/spring/ so create your application context file there…

<?xml version=”1.0? encoding=”UTF-8??>
<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:context=”http://www.springframework.org/schema/context”
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd”>

<bean id=”formatterImpl” class=”dateformatter.app.impl.DateFormatterImpl”>
<property name=”format” value=”dd-MM-yyyy”></property>
</bean>
</beans>

Creating a Registration listener and Importing the service

Now it is very useful to use a registration listener for keeping track of your bundle, Spring DM offers a very good way for doing this, it is by making a new class containing at least two methods which there names are irrelevant -as the class name- but the only constraint is to make the arguments in the both methods take the first argument as reference to the service INTERFACE and the other as a Map to hold the service properties…

package dateformatter.listener;

import java.util.Map;

import dateformatter.app.DateFormatter;

public class RegListener {

public void reg(DateFormatter formatter, Map map) {
System.out.println(“am here”);
}

public void unReg(DateFormatter formatter, Map map) {
System.out.println(“am going away”);
}
}

Now a wrote another spring context file and put it in the spring folder too, this one to hold the OSGi beans:

<?xml version=”1.0? encoding=”UTF-8??>
<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:osgi=”http://www.springframework.org/schema/osgi”
xmlns:osgi-compendium=”http://www.springframework.org/schema/osgi-compendium”
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd”>

<osgi:service id=”formatter” interface=”dateformatter.app.DateFormatter” ref=”formatterImpl”>
<osgi:registration-listener  registration-method=”reg” unregistration-method=”unReg”>
<bean class=”dateformatter.listener.RegListener”>
</bean>
</osgi:registration-listener>
</osgi:service>
</beans>

this way I publish a service with a registration listener, to run it you need to run the target platform.

if every thing goes will you will see something like the following:

screenshot-java-dateformatter-meta-inf-spring-dateformattercontext-osgixml-springsource-tool-suite

you can test the registration listener by stopping and running the service.

Next post we will write a client that uses this service…

Posted in JAVA

16Feb

OSGi and Spring DM Series

Soon I’ll be starting a series of posts about OSGi and Spring DM, this is from my experience about it (which is some kind new), And I will try to shed the light on the problems I faced but did not found enough resources about so I had to figure it out by trail and error! I hope it will be useful and I don’t think t is going to be on a regular bases!

shI will start with the basic definition from the wikipedia:

The OSGi Alliance (formerly known as the Open Services Gateway initiative, now an obsolete name) is an open standards organization founded in March 1999. The Alliance and its members have specified a Java-based service platform that can be remotely managed. The core part of the specifications is a framework that defines an application life cycle management model, a service registry, an Execution environment and Modules. Based on this framework, a large number of OSGi Layers, APIs, and Services have been defined.

Posted in JAVA

01Feb

1000!

I am very busy these days to post on my blog but I could not resist it when I saw that Real Media Converter 3.0 has passed the 1000 downloads in one month only!

I am very happy to announce that and I think when comparing it with the previous releases (1.0, 2.0, and 2.1) which in one year they had a total of 4500, I believe it is a very good figure :)

you can download it too from my downloads page

Also am very glad to announce that it is been added to the medibuntu repositories for the upcoming release of ubuntu, you can refer to this page on how to add the medibuntu repositories…

Posted in JAVA, Ubuntu

09Jan

Virtual bombs against real bombs!!!

Any Person that still have the least Humane feelings will stand speechless in front the crimes every day done by The mercenaries of the so called “Israel”, now am one of the people that against going to the streets to shout and then go home to continue watching TV with out doing any real thing to help.

A friend of mine passed this E-Mail to me to help telling the truth about the criminals of “Israel” the country of terror.

Finally, here is an intelligent and useful e-mail chain. Please transfer this e-mail to as many people as you can;

Get involved, it only takes up to 10 seconds

If you have a website, a blog, an on-line shop or a forum, please participate in this Google bombing operation!

The point is for this page to appear in the first position on Google when typing in “israel”

In order to do so, insert a link towards this website in as many pages with the anchor text: israel.
Here is the code to insert in your pages:

<a href="/website/http://www.israel-stop.com">israel</a>

Eventually, what you obtain should be: israel

• If you don’t have a website, you probably are a user of forum, youtube, dailymotion or leave comments on blogs: leave this link with your signature everywhere possible, but please do so without spamming as this would act against this website.

• If you don’t use websites and forum, transfer this e-mail to your contacts. Here is the example of e-mail,

• If you spot or know a website which would support this action, send an e-mail bearing this link. Here is an example of e-mail requesting for this link to appear.

We are looking for people able to translate this webpage in all possible languages: Arabic, Turkish, Chinese…

Join the Facebook group and invite all your contacts

Join Facebook for Israel Google washing

israel.stop@gmail.com

The success of such a method relies on the number of people taking part in it. This method worked in the past for pointless subjects, so let’s use it to support Palestine. This is a very serious challenge yet it is achievable. We can make it.

Posted in Personal

02Jan

Simple Real Media Converter 3.0 is released!

Finally I released the rmconverter 3.0 :)
Download Real Media converter

What is Real Media Converter?

Real Media Converter is a multi threaded gui that takes advantage from the mencoder and lame packages to generate wav and mp3 formats from real media files (ra, rm, and ram).

Real Media Converter may become a complete front end for the lame package, which is a program that can be used to create compressed audio files.Real Media Converter is a multi threaded gui that takes advantage from the mencoder and lame packages to generate wav and mp3 formats from real media files (ra, rm, and ram).

Why Real Media Converter?

The idea started when I began using Ubuntu, at that time I could not find any application to do that the easy way. so I started coding! the application evolved since that time and now it is becoming some kind a popular one :) .

License

Real Media Converter is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or(at your option) any later version.

Real Media Converter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details.

You should have received a copy of the GNU General Public Licence along with Real Media Converter; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Help Real Media Converter!

At this time am still working alone on this project but any help is welcomed Wink. you can help me by:

* making patches
* adding new features
* providing documentation
* translations
* packaging to fit any Linux ditros or even for mac!

the application is hosted on Launchpad.

Screen Shots

Posted in JAVA, Ubuntu