Friday, November 29, 2013

Having Fun with XNA - Game Development - Fly Me Home

XNA is a framework which provide facilities you to create your own game very easily. To work with XNA you don't need any extra knowledge about programming. Simply you just need to understand the life cycle of xna engine. after that creating your game is nothing and xna enable you to create game for xbox, PC,  as well as the windows phones.

In 2nd semester of 4th year we had a subject call GD (Game development). Under that subject there was an assignment to create a 2D game using xna. Me and my friend proffa developed a game call "Fly Me Home".
In that game user is playing as a bird. what you have to do is collect the foods withing a given time period and flying safe to home.

This is a short video of that game. :D





Saturday, November 16, 2013

The Seeker - Mobile Security App

When we were in 3rd year in SLIIT there was a subject called MAD - Mobile Application Development. Under that subject we learned iPhone app and android app development. Under MAD we had to develop a n app using android & ios. For that we developed two different applications. Using ios Proffa(Krishantha) developed a puzzle game and for android I developed a mobile security application called "The Seeker" .

The seeker is working based on commands received using SMS messages. Of course, you can customize those commands. In this version (1.1) I created only several basic security functions. In later versions I'm going to  implement this with more features.

SIM
In this function rather than the codes you have to mention a trusted mobile number. If the SIM is changed the app will automatically send you the new SIM number and other details. If you want you can get IMEI or the SIM number using the codes at any time.

GPS
After you activated this function, the app will send you the coordinates of the current location where the phone is.This will send a message in every 3 minutes until you send the code again and disable that feature.

ALARM
Using this function you can ring an alarm. This alarm can be stopped only by sending the code again.

LOCK
This will lock your device, even the user unlock it by using your pattern or pin automatically again it will locked. To unlock you have to send the code again.

WIPE
Simple to wipe all your data this function can be used. To wipe all data several minutes will taken. This time is depending on the device.

The Seeker is now available in Google Play.


You can see a demonstration video below.

Tuesday, November 5, 2013

Location Based Advertisements And Indoor Navigation System For Shopping Malls (Research)

Project Name : Location Based Advertisements And Indoor Navigation System For Shopping Malls
Duration : 8 Months
My Contribution : 1. Android App
                                      2. Web Service 
                                      3. Staircases Patterns 



This was our final year research project. There were four members in our group. In this project we were focusing on indoor navigation and make it use in practical way. Based on that idea we were able to developed the Location based advertisements system for indoor environment.

My team. ( From Left - Thilina , Krishantha, My self and Chathura  )


Advertising is one of the most innovative concept present in our society today. It helps to keep the consumers informed about whatever new products or services that are available in the market at their disposal and to spread awareness about products or services that are of some use to consumer and potential buyers. The main aim of advertising, many believe is to sell. These are the kind of people who vehemently oppose anything that make advertising seem unethical. Advertising on the whole helps business as well as the economy to prosper and makes the consumer aware of the various choices that are available to him. Although the concept is pictured over different aspects, currently in places like shopping malls they use the same conventional ways of displaying advertisements. In this project we introduce a novel concept of delivering location based advertisements to hand held devices reside in large shopping malls while navigating the user to particular shops they chose to visit.

Modern researches over indoor navigation systems has gained a fresh impetus over last couple of years, making indoor spaces and indispensable part of current geospatial research. Navigational applications are one of the booming industries, focusing more and more on the indoor world. Even though there are number of researches took place using various technologies, none of these has been developed and distributed to consumers.

Therefore through this project we hope to build up a “Location Based Advertisements and Navigation System for Shopping Malls”, a self –contained , map-based, indoor navigation and advertisement system Making use of hand held devices with motion (accelerometers) and rotation(gyroscopes) sensors to continuously calculate their motion and position. All the sensing and computing technologies we accurately localize user’s route, and provide turn by turn instructions to their destination.

Location based Advertisements

System Diagram

There are several QR codes placed in each entry at every floor of the shopping mall.When user is entering to the shopping mall he can read those QR using his mobile. In the QR we stored the position of the user. Therefore after read the QR code we know the current place of the user meanwhile the app will star to track the user movements using the sensors.

In the map we have defined several regions. Each region contain 2-3 shops. So the user will get the advertisements corresponding to the region he is in. So where are advertisements coming from ? Those advertisements coming from the application server. The shop owners of the shop can feed their advertisements into our system using the web interface we provided to them.

Simply the location based ads process is this.
1. Shop owner feed advertisements to the system
2. Those advertisements stored in application server
3. When user in the shopping mall the advertisements will send to his mobile based on location


Home Page 

Register Shop Owner

Upload Advertisements

Random Advertisements, Search Advertisements & More... 
Not only in the shopping mall our app can be used even you're at home. When you're at home the app will show you advertisements which are selected randomly. If you like particular advertisement you can add them to your favorite list. If you want to find a advertisement , there is a search function which allow you to find your advertisement fast. If you want to view advertisements that are belong to particular category, for that you can view the advertisements by category. 

Demonstration 
To be more realistic we used this app for a shopping mall in Sri Lanka which is called as Majestic City.



For the demonstration we selected simple area of MC and draw our map. In below video you can see how the app is working.



Monday, November 4, 2013

SKOLAYA - The School Management & Intelligent Results Prediction System (Research)

Project Name : SKOLAYA - A School Management & Intelligent Results Prediction System
Duration : 1 Month
What I Implemented : Complete System



“Talent wins games, but teamwork and intelligence wins championships.”
Michael Jordan

After we collect the all the requirements, we started to develop the system. Basically it is a school management system. In schools there are several streams that can be chosen when you're at grade 12. So managing those were little bit tricky. Using this system, the administrator level users should be able to create time tables for all classes. Implementing that was a one of hardest part of that project. We have implemented the system that the user can view the particular class time table as well as the time tables of all the classes in a particular grade. It will make user easier to handle overlaps when he is creating the time table.

Apart of that, as the research module the system will analyze the results of previous years, previous terms and predict the result of a student for each subject. And that was the second hardest part of this system.

This is a short video of that system.



Here you can see a video which describe most of the important functions of the system.




Sunday, November 3, 2013

SMS Management System

Project Name : SMS Management System
Client : iZone Developers
Duration : 12 Months
What I learned  Java , JSP , Hibernate, Maven , Spring, JavaScript, Agile , JqueryUI, Jquery ,  MVC
What I Implemented : 1. Scheduled SMS
                                     2. SMS gateway server 

This was my 3rd year project. We developed this system for the iZone developers. In this project I have worked on the server development. We were able to finish this withing 6 months. To do this project we followed the agile methodology and we used the bitbucket as our repository. From here I'll explain a bit about our project. 

SMS Management System is a concept of integration of mobile technology with information management system. This allows consistent connection with the enterprise no matter where the clients are located. Short messaging services in mobile technology as a tool to manipulate enterprise data and services reduces traditional traveling costs, communicational costs for both the enterprise and the customers. The main objective of the system is to reduce the cost involved with traditional communication methods and stay in touch with the clients for various business endeavors those results in efficiency and increased productivity.



System Diagram


The system consists of few components. The front-end web application developed using Java Server Pages will be used for basic configuration and SMS manipulation. This application uses a remotely hosted database for storing the clients’ information, configuration and the monitoring of SMSs received, sent and to be sent. The gateway application will use various 3g dongles to send and receive SMSs to/from clients while being 24 hours responsive. The administrator can define the SMS campaigns and the configuration to send and receive SMSs. Once received a SMS it will be checked whether it is valid .If it is a valid SMS that needs response from the system the response will be taken from the database and will route the outgoing SMS to the appropriate port with a working dongle attached. When sending SMSs the user can define the content, receivers and the time for sending the SMSs. The server periodically will check for pending SMSs and send the messages if it is the appropriate situation to send the SMS.

The core part of this system is the Gateway Server. It's managing thousands of sms and selecting relevant dongle to send sms considering the budget. It is capable of sending messages from all the dongles simultaneously. Messages are sending according to an algorithm which is guaranteed that the recipient will received the message very quickly. In algorithm each SMS will assigned to a priority level, because of that user can send an emergency SMS at anytime he want and no matter how many messages are in the queue the algorithm will give the first place to the messages who has the higher priority. 

In below you can see a simple video of our project. Note that in the video I'm highlighting the area which was developed by me.So the video will not contain the all project functions.




Transparent JButton, JLabel...J-anything you want

When I was doing my 2nd year project I wanted to transparent a jpanel and several buttons. After searching and reading several posts I founded a way to do it easier. Using this you can transparent most of swing controls. To do this is very easy. you just need to rewrite the class that you want to transparent with adding alpha value. 

public class TransparentButton extends JButton{
     static float value = 1.0f;
    public TransparentButton(float t) {
        super();
        value=t;
        setOpaque(false); 
    }

    @Override
    public void paint(Graphics g) { 
            Graphics2D g2 = (Graphics2D) g.create(); 
            g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, value)); 
            super.paint(g2); 
            g2.dispose(); 
        } 
}

Here you can see I have extended the JButton class and creating another jbutton called TransparentButton. "value" is the alpha value. After I implemented a constructor to pass that alpha value. So I can use that when I'm creating the button. It's not a must to declare the value variable as static. Finally override the paint method and add your alpha value. 

Now you have to do is run this constructor when you're creating a button. I'll show you how to do it in Netbeans.

First drag and drop the button you want to transparent. I'll add two buttons and I'm going to transparent the right button.





Then right click on that button and from the list choose Customize Code... 

In the code customizer window you can see the constructor of button is there. Now we have to change that constructor and run our constructor there. To change that, from the drop down menu select custom creation.



Then you can edit the constructor. Delete the Jbutton constructor and run the TransparentButton's constructor with passing the alpha value.




Now save the project and run. Tadaa !!!



Like this you can extend most of the swing controls like Jlabel, JToggleButton, JPanel, ... etc.  
You can download a sample project by clicking the link below. 

TransparentTuteAnjula GitHub Project