Observer and Observable

alkathirikhalid

Using JAVA Implementation

Message Board (Observable)

package com.alkathirikhalid.demo;

import java.util.Observable;

/**
  * <p>
  * Message Board as Observable.</p>
  * <p>
  * It can be observed for new message changes, it can also have one or more
  * observers, when an observable object is newly created, its set of observers
  * is always empty at first.</p>
  *
  * @author alkathirikhalid
  */
public class MessageBoard extends Observable {

    /**
      * The message on the Message Board
      */
     private String message;

    /**
      * Getter
      *
      * @return message Board
      */
     public String getMessage() {
         return message;
     }

    /**
      * Setter
      *
      * @param message Board
      */
     public void setMessage(String message) {
         this.message = message;
         // Marks this Observable object as having been changed
         setChanged();
         // notify all of Message Board observers
         notifyObservers();
     }
}

User (Observer)

package com.alkathirikhalid.demo;

import java.util.Observable;
import java.util.Observer;

/**
  * <p>
  * User as Observer.</p>
  * <p>
  * Gets updated messages based on changes in observable Message Board.</p>
  *
  * @author alkathirikhalid
  */
public class User implements Observer {

    /**
      * Observable Message Board
      */
     private final MessageBoard messageBoard;
     /**
      * User In box message
      */
     private String inbox;

    /**
      * Constructor
      *
      * @param messageBoard the user is Observing
      */
     public User(MessageBoard messageBoard) {
         this.messageBoard = messageBoard;
     }

    /**
      * Getter
      *
      * @return in box message
      */
     public String getInbox() {
         return inbox;
     }

    /**
      * Setter
      *
      * @param inbox message
      */
     public void setInbox(String inbox) {
         this.inbox = inbox;
     }

    @Override
     public void update(Observable o, Object arg) {
         // Confirms the Observable is a Message Board Object
         if (o == messageBoard) {
             // Sets the user in box message as the incoming new message board
             setInbox(messageBoard.getMessage());
             // Prints to screen
             System.out.println(getInbox());
         }
     }
}

Test Application

package com.alkathirikhalid.demo;

/**
  *
  * @author alkathirikhalid
  */
public class TestApp {

    /**
      * @param args the command line arguments
      */
     public static void main(String[] args) {
         // New Message Board Instance
         MessageBoard messageBoard = new MessageBoard();
         // New User Instance Observing Message Board
         User user = new User(messageBoard);
         // Add User as an Observer of Message Board
         messageBoard.addObserver(user);
         // Update the Message Board with new Message
         messageBoard.setMessage(“New Message!”);
     }

}

Writing Your Own Implementation

Message Board Listener Interface

package com.alkathirikhalid.demo;

/**
  *
  * @author alkathirikhalid
  */
public interface MessageBoardListener {

    void update(String message);
}

Message Board Class

package com.alkathirikhalid.demo;

public class MessageBoard {

    private MessageBoardListener messageBoardListener;
     /**
      * The message on the Message Board
      */
     private String message;

    public void setMessageBoardListener(MessageBoardListener messageBoardListener) {
         this.messageBoardListener = messageBoardListener;
     }

    /**
      * Getter
      *
      * @return message Board
      */
     public String getMessage() {
         return message;
     }

    /**
      * Setter
      *
      * @param message Board
      */
     public void setMessage(String message) {
         this.message = message;
         // notify all of Message Board listeners
         messageBoardListener.update(message);
     }
}

User

package com.alkathirikhalid.demo;

public class User implements MessageBoardListener {

    private String inbox;

    public String getInbox() {
         return inbox;
     }

    public void setInbox(String inbox) {
         this.inbox = inbox;
     }

    @Override
     public void update(String message) {
         setInbox(message);
         // Prints to screen
         System.out.println(getInbox());
     }
}

Test Application

package com.alkathirikhalid.demo;

/**
  *
  * @author alkathirikhalid
  */
public class TestApp {

    /**
      * @param args the command line arguments
      */
     public static void main(String[] args) {
         // New Message Board Instance
         MessageBoard messageBoard = new MessageBoard();
         // New User Instance
         User user = new User();
         // Add User as a Listening to the Message Board
         messageBoard.setMessageBoardListener(user);
         // Update the Message Board with new Message
         messageBoard.setMessage(“New Message!”);
     }

}

Result

The same for both implementations

New Message!
Posted in Programming, Web Application, Web Developement | Leave a comment

DZ09 Smart Watch

So I was searching for an affordable smart watch with the below criteria’s:

  • China Made
  • Affordable
  • Programmable
  • Experimental

After like 2 weeks of research and going through reviews I was left with 2 choices:

  • DZ09
  • DM98

DZ09

DZ09

  • Affordable
  • Running on Nucleus RTOS
  • Runs .vxp apps
  • Able to run custom firmware supported by the device MTK Chip (There are different variation will elaborate later on)

DM98

DM98

  • Not so Affordable (At the moment give it some time)
  • Running Android 4.4
  • Runs .apk apps
  • Able to run custom ROM

Upon purchase, to my surprise all is well it was delivered in a nice package, everything is intact and functioning as expected, I tested:

  • Memory card Support
  • Sim Car Support
  • Bluetooth connectivity
  • Bluetooth communication
  • Making call and receiving calls
  • Taking pictures
  • Playing audio
  • Recording audio

Required App to Sync with Android Phone:

I have to admit it was my first actual online purchase and shipping experience, reason is because I would always prefer to buy what am seeing or holding, I guess this doesn’t get old.

Hacking TIME

After a week or so of getting bored of it I wanted more out of it like installing Apps and custom ROMS:

  • How about installing apps? I downloaded .vxp apps and try clicking to install… nothing happened!
  • Ok so how about making a back up? I downloaded FlashTool v5.1516.00 and tried to make a read back file… no that didn’t work!

Ok something isn’t right?! So I went out and do some research on XDA was it helpful?! no no no well maybe just a bit, points out that there are multiple DZ09 this was expected, ok so lets get to the bottom line, what hardware is my DZ09 packing?!

Hardware Validation

I needed to know the chip in the DZ09 as all the forums was talking plus the seller was advertising MT6260.

mauimeta

Well that’s not right mine is MT6261, ok maybe it isn’t so bad after all.

Hey hey how about Memory how much do we have of that? all the forums was talking plus the seller oh the good old seller was advertising 64MB.

norflash

Well that’s not right mine is 4MB, ok maybe it is that bad after all. With that much memory you can’t do anything literally the device is at its max! and all the ROMS out there are not for 4MB!!!

It turns out there are actual clones/fake of clones! and not actual DZ09!

clones

Everything looks good all in all but they are actually using old, outdated and unwanted chips from U8 (right device) smartwatches into DZ09 (left devices) smartwatches you get the look and feel but not the performance and specified specs, But hey you get what you pay for! 37RM including Shipping!

Making The Best Of What I Have

Now that I know what I am dealing with, lets get back to making a back up! do not follow the online tutorial if you are dealing with a piece of hardware like mine, set the read back file to 4MB:

  • 0x00400000

Yes Successfully extracted the ROM (4,096KB) and successfully extracted the read back file and generated:

  • config_mtk.cfg (3KB)
  • EXT_BOOTLOADER (31KB)
  • INT_BOOTLOADER (7KB)
  • FILE_01_mtk (1,060KB)
  • FILE_02_mtk (2,666KB)

Available Download:

With the backup at hand I was bold enough and I definitely bricked the device by using the wrong custom firmware which lead me to have a purple ugly screen that the icons seem out of place and of course I restored it back to life! Didn’t I just mention “With that much memory you can’t do anything literally the device is at its max! and all the ROMS out there are not for 4MB!!!”

Well I love the cheap phone watch I currently exclusively use it for:

  • Telling time, who am I kidding of course its a watch!
  • My third Alarm clock
  • External Drive for files (32GB), I paired it with PC via Bluetooth Intend for End of day short notes as its much faster to transfer big files via cable than Bluetooth
  • The battery can last me 2-3ish days as its minimum use to tell time only on lowest screen brightness and reduce screen time out

I will find other use for it soon…

Posted in Mobile Developement | Tagged , | 4 Comments

C.V.S.S

Certificate verification System Service, a web app for managing certificate issuing institutions.

Introduction

Institutions, Organizations, Employers and even Individuals, can now verify a certificate authenticity coming from the intended institution to the intended candidate, hence preventing forgery, duplication and even outdated certificates.

If you provide certification to any courses or training provided by your company or institution then you are at the right place to preventing forgery, duplication and even outdated certificates in circulation.

The system can also be used to simply offer e-certificates and save on paper.

Aims

CVSS bridge the gap between employee and employer who needs to verify a certificate by allowing institutions to provide minimum information (Candidate First.Last name, certificate id, description and date issued) of a certificate.

Traditionally Employer might call an institute directly but there are barriers such as :

  • Weekends

  • Public holidays

  • Different language

  • Time zone

  • E.t.c.

CVSS is here to serve all who:

  • Have no website

  • Rarely update their web sites

  • Have no IT background / person

  • Provide e-certificates

  • Save cost on printing ink and paper

  • C.V.S.S. is environmentally friendly

Verification Procedure

Verifying institutes and certificates provider by means such as:

  • Registered institution

  • Domain name @institute.edu / @institute.org / @institute.com / @institute.*

  • Gazette history

  • Reputation,

  • Address / location

  • Call

  • Walk in

  • e.t.c.

Admin Flow

Member

Allows admins to signup or sign in to CVSS

2.JPG

Fig 1: Member Section

Signup

Allows admins to provide their username, company email and password for account login, a confirmation code will be send to the email provided for verification.

3.JPG

Fig 2: Sign up

Account Activation

Upon signup admin will receive a confirmation code to activate the account. Copy and Paste the code or click the code link to activate your account from the email you received.

4.JPG

Fig 3: Account Activation

Sign In

Admin provide their username and password to access C.V.S.S.

5.JPG

Fig 4: Sign in

Dashboard

Provides admin with information such as last login and last logout time stamps.

6.JPG

Fig 5: Manager Section: Dashboard

Account

Provides admin with information such as account type, dated joined, status e.t.c.

Institution

Provides admin with first time option to set up their institution name and location this information is fixed and can not be changed by Admin.

Certificate

Provides admin with the ability to add the certificates into their institute with the option of either Attended / Complete / Pass remarks on the certificate.

8.JPG

Fig 6: Manager Section: Certificate

All Certificates

Provides admin with a list of all available certificates in their account with the ability to directly edit on any of the certificate ID, Name, Description and Date and also ability to delete a certificate.

9.JPG

Fig 7: Manager Section: All Certificates

Upgrade

Provides admin with the ability to add more certificate volume into their account, the basic free tire is 100 certificates per account per institution.

1.JPG

Fig 8: Manager Section: Upgrade

  1. Free Account Max 100 Certificates | 0$ Monthly Subscription
  2. Copper Account Max 200 Certificates | 2$ Monthly Subscription
  3. Bronze Account Max 300 Certificates | 3$ Monthly Subscription
  4. Silver Account Max 400 Certificates | 4$ Monthly Subscription
  5. Gold Account Max 500 Certificates | 5$ Monthly Subscription

Need more? contact us: cs@cvss.online

Current subscription price is at reduce price specifically for beta users .

User Flow

Home

The welcoming page allows a visitor to select the Institution they want to assert the certificate is from.

1.JPG

Fig 1: Selecting an Institute

Search

The second screen allows the visitor to input the certificate ID to search for instance 1000101.

2.JPG

Fig 2: Searching for a Certificate

Result

The visitor is present with the certificate information as per the certificate ID

1.JPG

Fig 3: Certificate Confirmation

API Access

The e-certificates can be distributed directly to candidates or added to websites. We will demonstrate base on the test link below:

Get method

Using calling method to the web container to get access of information

  • search?certificateid={certificateid}&institution={institution}

  • search?institution={institution}&certificateid={certificateid}

Links

Using links to be added to web sites or sent via emails

Badge

Using clickable badges / images to be added to web sites or sent via email

View Certificatecertificate.jpg

Contact Us

We are looking for institutions to offer the free tire and free consultations, no charges at all, drop us an email at cs@cvss.online

Let us know how we might help you.

Cheers!

Posted in Web Application, Web Developement | Leave a comment

Enhanced your Desktop, make it Organized and with functionality built in

So I decided to improve and manage better my desktop as I was getting tired of folders, files and short cuts just lying on the desktop, which was turning out to be unorganized and annoying to my eyes.

alkathirikhalid

Fig 1: Cluttered Desktop with Folders, Files and Shortcuts

Since am into knowing the bandwidth usage for my uploads and downloads the solutions was rainmeter provides “customizable skins, like memory and battery power, RSS feeds and weather forecasts, right on your desktop. Many skins are even functional: they can record your notes and to-do lists, launch your favorite applications, and control your media player – all in a clean, unobtrusive interface that you can rearrange and customize to your liking.”

The initial rainmeter skin is simple and aims at minimalistic features of raimeter, rainmeter itself is free and open source allowing individuals to be creative and create more variation of rainmeter and share with everyone else.

alkathirikhalid

Fig 2: Avengers S.H.I.E.L.D OS Options

My favorite after trying so many is Avengers S.H.I.E.L.D OS which has options allowing you to customize the UI without coding. And the end result for my Desktop is as seen below.

alkathirikhalid

Fig 3: Enhanced Desktop, Organized layout with functionality built in

I can access my applications right on the desktop including launching favorite website by just a click, I can see the ram and CPU usage, and not to mention I can control music right on the desktop as rainmeter integrates with winamp player.

www.alkathirikhalid.com

Thank You.

Posted in Desktop Developement | Leave a comment

A Voice In My Hand

This is a speech disorder assistive technology that allows individuals with speech impairment to communicate with their Android Phone. Users with special needs can now communicate comfortably in public areas, make a verbal order, request or introducing themselves has been made easy.

It can be used as a communication aid, a learning tool to pronounce words or simply for entertainment purposes hence much more suitable for users with speech impairment, I have improved its code to handle some aspects such as:-

  • Made simple for individuals with low cognitive
  • Speech synthesizers voice data detection
  • Wider cleaner Screen View
  • Tactile feedback
  • User Settings

Any further customization can be made possible upon requests, I have also decided to pimp it with a website so it can drive traffic to my app, this is an experimental marketing tactic, all Google analytics are fully functional for the site and app to allow me to deduce my return on investments (ROI), feel free to visit and download the App at www.avoiceinmyhand.com

alkathirikhalid Fig 1: Main Screenalkathirikhalid

Fig 2: Settings ScreenalkathirikhalidFig 3: Main Screen Landscape Mode

It’s been a month now since I built and launched both “A Voice In My Hand” Site and an Android App, it’s time to analyze the collective one month data from both the site and the android mobile app, for best practice it is wise to provide a Privacy Policy for your users both when visiting the site or downloading the App, mine can be found at http://avoiceinmyhand.com/privacypolicy/

Another pointer to add is that some companies or organization will have Privacy Policy for each App or Site or in short multiple Privacy Policy that address multiple applications which in turn leads to 20 plus Pages of Privacy Policy and in turn appears longer, confusing and a lot of users would not bother reading or for some paranoid user would not bother with your product especially if your company is not a Big time company.

The latest approach is to write a general Privacy Policy but it would not hurt to consult a lawyer, the one Privacy Policy is to address all the products and services in general within your company in one Privacy Policy document with precision and direct intent of your company intentions to acquire any data from users through any of it’s products or service. Making it simple would allow more legitimate users to scan or even read through and gain more trust in your company’s products and services.

alkathirikhalid 

Fig 4: Privacy Policy Page

Now I can deduce the data collected from both the site and the android app, some of the data from the screen will be blanked out for security reasons. Analytics allows an Account holder to have multiple Accounts and within each Account a User can have multiple Properties such as web sites and mobile applications, as seen below I have named my properties in a manner that is easy to distinguish between them by adding “Site” and “App” at the end of each property name, this is my naming convention for each project.

alkathirikhalid

Fig 5: Mobile Analytics

Launched Site date 25th September 2013 to supplement traffic to my app, as seen below the App has had a shoot in the number of downloads all thanks to the creation of the site which directs users to my app, as seen in the image below. This proves to an extend it is crucial to have a site to direct traffic to your app or vice verses.

alkathirikhalid

Fig 6: A rise in the number of downloads

The number of visits to the site is 126 with in the month as seen below coming form a number of sources such as direct, word press, Google search, face book and Google+. This does not necessary reflect the number of downloads of your app as user can also access your app through other means such as with in Google Play, other third party sites that offer reviews and links to Google Play itself. Just remember the site just directs but the actual download takes play at Google Play.

alkathirikhalid

Fig 7: Site visits and sources

These same information can be accessed via mobile device, which provide the same data but in a compact and presentable means not to mention convenient right from your pocket, as seen below:-

alkathirikhalid

Fig 8: Total Site Visits and Location

alkathirikhalid

Fig 9: Total Site visits and sources

alkathirikhalid

Fig 10: Page views and average engagement/visit duration

alkathirikhalid

Fig 11: Traffic sources based on Country

alkathirikhalid

Fig 12: Network Provider

alkathirikhalid  Fig 13: Number of pages and visits per page at the site

alkathirikhalid

Fig 14: Social traffic Acquisition

alkathirikhalidFig 15: Much more data

Lets deduce the App Data collected within the one month durations since both the Site and App has analytics, it allows us to be in the position to separate the two for more precise data, as seen the number of visitors was 126 but only 94 installations are recorded this could be due to that fact that some users phone might not be running Android or the Android Version is not supported, as the App “A Voice In My Hand” only support Android 4.0 and above:-

alkathirikhalidFig 16: Number of Active Users

The engagement information is quite useful since it allows us some insight as to when exactly are our users using our apps, this insight might allow us to determine the purpose in my case the App is used for entertainment especially during holidays such as weekends (Sundays) this points to social gathering or relaxing event, there is a portion slot on Monday but this is false Positive as Sunday still continues on other Countries and hence shown as Monday due to the time variation, there is a section on Thursday this could be due to the fact some Muslim Countries holidays or weekends are set as Thursday and Friday, this data will allow me to know when to launch for maximum engagement.

alkathirikhalidFig 17: Screen Views and Engagement/behavior pattern

Location data is also useful as it would determine whether or not to support other languages and set localization for your app as the statistics point Spanish language would be a great start for maximum audience.

alkathirikhalidFig 18: Audience Location and Sessions

Device type also is useful to determine the test environments for your app or anything else you could think of that Device information can be useful, the 4th last device “Sony Ericsson E10i Xperia X10 Mini” if you notice any device which for instance in this the mini X10 which only can run up to Android 2.1 but our App is Android 4.0, this is a rooted device running on a custom rom, hence if in future as a developer you notice some crushes you can opt to not support such a device as the out come is hardly predictable.

alkathirikhalidFig 19: Mobile Device used

Engagement per screen, this data is very useful as in the case some apps have critical data or settings that rarely any user access it the developer might change the layout to make the data more easily navigable, if you compare “Settings” data it is quite low as opposed to the number of views in the “MainActivity” main app, this is because settings are usually set just once and there is actually no need for the user to go to settings every time they open the application.

alkathirikhalidFig 20: Number of Screens and Views of the App per Screen  

The Developer console provides more useful information to developers such as whether there were any crashes encountered, as seen below no crash encountered with my app with any device.

alkathirikhalid

Fig 21: Developer Console, No Crashes

Further more recommendation are provided by the Developer Console in my case to design the app for tablets and offer translation to other languages such as German, Spanish and Russian.

alkathirikhalid    Fig 22: Developer Console providing Tips

I have had a total of 1,870 downloads to date, once you attain a download of above 1000, you as a developer will be receiving a lot of emails invitations from other sites such as

For those who are interested in publishing apps with Opera you can go through the link and also check out the User Agreement

Not to mention you will also be receiving a lot of spam if you provided your email address, spam such as someone trying to sell you a service or product in the name of improving your app or simply boast or claim they have helped a lot of people and they would like to help you blah blah. If only they understood the power of precise and brief information wins the day.

Due to providing a Site for my App I have accumulated not only more downloads and directed traffic but also raised my credibility as a Software Engineer, due to the fact that my email and name is available for individuals not only on my Personal site but also on “A Voice In My Hand” site and due to this I personally get contacted for freelance job which ranges from:- Ecommerce Systems, Web Sites, Search Engine Optimization, Android App development, Consultation and Training.

www.alkathirikhalid.com

Thank You.

Posted in Mobile Developement | Leave a comment

Root, Unlock Boot loader, Flash Custom ROM Jelly Bean 4.1.2 and Over Clock a Sony Ericsson xperia X10 mini Éclair 2.1

This is to demonstrate on how to get more from your old Sony Ericsson Xperia X10 mini, I was somewhat locked down on the amount of things I can do with my old phone since it was running on Android Éclair 2.1 given that it only has a Qualcomm MSM7227, Single Core 0.6 GHz processor, it always seem the right time to root and hack a phone once it’s warranty or usefulness has expired and that is exactly what I did with mine which I bought on mid year 2011 for the sol purpose of Android Apps Development. Note before taking this approach you might brick your phone and also ensure your antivirus and or windows defender is disabled.alkathirikhalidRooting a phone is easy these days with a lot of tutorials on how to root a specific Phone, first of all you need to enable debugging in your phone so as you will be in the position to send data and applications to your phone all credits go to http://forum.xda-developers.com/showthread.php?t=1254225 once your phone is rooted you should see super user app in your phone.

Ensure you have Sony PC Companion installed http://www.sonymobile.com/gb/tools/pc-companion/ this will allow you phone to be detectable when Unlocking your boot loader and you should get something like my image below, this will ensure your boot loader is unlocked.

alkathirikhalid

Fig 1: Verifying Boot loader has been unlocked

Once all that is done now you need to flash your custom ROM into your phone I used E10i_JBMP-Release4 since all the hardware has been tested and works smoothly http://forum.xda-developers.com/showthread.php?t=1779745, its fast and smooth until I ended up opening a lot of windows my phone slowed down and hanged, when it happened I was away from my computer and had to wait till the phone battery died since Sony Ericsson Xperia X10 mini has an internal battery, charged it and restarted it again this time changing its settings and over clocking it.

First thing I did was to give super user permission (Root access: Apps and ADB) to Android Debug Bridge so I can send more shell commands directly from my PC to my phone as in the case above When my phone hanged I had to wait till the battery died, with adb command I can easily send a reboot command (adb reboot) to my phone faster than using the phone itself, I can also send Linux core shell commands to my phone over the command prompt such as list (ls).

alkathirikhalid

Fig 2: Giving Root access to Apps and ADB

alkathirikhalid

Fig 3: Testing device shell access over cmd

It’s time to improve performance on the Xperia X10 mini, and here are the following.

  1. enable auto install directly into the SD card
  2. enable swap files (virtual memory)
  3. increase the processor clock speed
  4. memory management

But before all that I somewhat dislike cables laying around everywhere so I decided to connect to my phone via Wi-Fi and these are the steps you need to take, having a rooted device comes with it’s advantages, if you are working on big sized applications a cable would be your best choice for speed and data integrity over networks might lead to lost packets. Now you need to understand how adb works such as:

  • Emulator 1, will have a console: 5554 and adb: 5555
  • Emulator 2,  will have a console: 5556 and, adb: 5557
  • And So on

First we need to get super user permission for our terminal (su) then we set the adb service port to as above 5555/5557/5559 “adb port+2” take a pick (setprop service.adb.tcp.port 5555), after we pass this code we need to restart the adb to take effect of our new settings (stop adb) and (start adb), once all that is done we can verify that our settings are working to check just type (getprop service.adb.tcp.port) and it should return the port you set in my case 5555.

alkathirikhalid

Fig 4: Setting device adb service port

You need to know your phone local IP address for your network, you can either get it from the terminal or head to Advance WIFI Settings and grab it from there, in my case it’s 192.168.0.115

alkathirikhalid

Fig 5: Viewing device IP address

Now we need to make our adb server to switch from listening from USB to over WIFI network, I first start the adb server (adb start-server) then check for the number of devices connected (adb devices) which returns an empty list, now we need to connect our adb to our phone (adb connect 192.168.0.115:5555) I didn’t put the port number as by default the port number assigned to the first device is 5555 as I described above, command prompt return connected to 192.168.0.115:5555 and we are good to go. Remember for security reasons if another developer or hacker is within the same network they can connect to your device by just knowing your device IP address.

alkathirikhalid

Fig 6: Connect adb server to phone

If these see settings do not fancy you, you can always revert back on your devices by restarting it or passing:

  • su
  • setprop service.adb.tcp.port –1
  • stop adbd
  • start adbd

and from your command prompt

  • adb usb

To enable auto install directly into your SD card (adb shell pm set-install-location <LOCATION>) 0: Auto—Let system decide the best location. 1: Internal—install on internal device storage. 2: External—install on external media. and then check (adb shell pm get-install-location) you can access your device shell directly from your command prompt since we have super user (Root access: apps and adb) and are connected and the result is 2 which means external, bare in mind not all apps should be moved to the SD card as it might not be available when mounted/connected to the PC apps that need to run all the time should be left in your internal storage.

alkathirikhalid

Fig 7: Getting device install location

Now lets enable swap file (virtual memory) to allow our phone to use part of the External storage as RAM, head to JBMini Settings and select Swap Settings, enable it and select your desired swap size in my case 128MB will do just fine.

alkathirikhalid

Fig 8: Setting Virtual memory

Now let’s over clock our Qualcomm MSM7227, Single Core 0.6 GHz processor you need to head to Settings > Performance > Processor, I first set my Maximum CPU frequency at 0.806 GHz and things started going south and by my bad luck I checked the Set on Boot Option which means the system just keeps going back to the same problem, the phone froze restarts the battery indication is red even though its full charge in short the phone was not functional (word of caution ensure set on boot is disabled/unchecked before making any first attempt changes) I had to flash the custom ROM again. This time I set the Maximum CPU frequency at 0.710 GHz and the CPU governor ONDEMAND and Under volt the CPU to improve battery performance.

alkathirikhalid

Fig 9: Over clocking CPU speed

Now for memory management I set zRam to compress memory for increase virtual capacity by 18% which is the default value, too much will stress the system on compressing and decompressing memory, allow purging of assets and kernel same page merging.

alkathirikhalid

Fig 10: Memory Management and Compression

You may also desire to change the Background process limit to At most 3 from  Standard limit, within your Developer Options, this is not necessary it all depends on what applications you are going to develop.

alkathirikhalid

Fig 11: Limiting background process to at most 3 processes

and wow an increased of speed and usefulness on a tiny device with restricting hardware has been achieved!

www.alkathirikhalid.com

Thank you.

Posted in Mobile Developement | 1 Comment

My Guestbook App

I am going to build a bottom up guestbook application to store all my guest list for an up coming event, host it in a local network for all the local machines to have access to the application.

The steps taken to build up  the application are: a) creating a MySQL database using MySQL Workbench, b) then forward engineer the EER (Enhanced Entity Relationship) diagram to MySQL workable code and execute it to propagate the desired database with its tables, c) using the Netbeans IDE to build up the web application, d) creating entity classes to interact with the database, e) creating java server faces to interact with the entity classes, f) CSS buttons to keep the application clear of heavy images hence keeping the application size compact and loading time optimal.

alkathirikhalid

Fig 1: Netbeans 7.2 IDE

Since running MySQL as a service takes up resources on start up, I have disabled it hence MySQL is initialized only when needed, as seen above I right click and start the administration tool to bring up MySQL workbench.

alkathirikhalid

Fig 2: MySQL Workbench

Within the Workbench click on “Create New EER Model” to get started to draw the enhanced entity relationship  diagram, depending on the complexity of your application you might use a table or multiple tables for your application.

alkathirikhalid

Fig 3: MySQL Model

Click on “Add Diagram” to get started and follow up on the next image.

alkathirikhalid

Fig 4: Create an EER Diagram

Double click or click and drag the table icon from the left into the drawing sheet, the whole creation process is drag and drop from the tools bar into the drawing sheet.

alkathirikhalid

Fig 5: Build a table(s) with column and set it’s attributes

Creating the columns is a breeze with all its attributes, you may have multiple tables as desired but for a one table application ensure a column is selected as a primary key so as to be in the position to create the entity classes later on, and also to allow the application to grow in the case when another table is added to the schema.

alkathirikhalid

Fig 6: You can insert data manually into the EER Diagram

Click on insert on the bottom, for practical reasons I will skip the insertion of data directly into the database and insert them through the application once it’s built in order to test and see the workings of the application, a good example would be to see and test it’s validation before importing all data into the database.

alkathirikhalid

Fig 7: Completed Enhance Entity Relational Diagram

Once your table/s are ready with all the primary and secondary keys incorporated, click on “Database” and select “Forward Engineer” to transform your diagram into workable MySQL code.

alkathirikhalid

Fig 8: Forward Engineering Settings

Always choose to “Drop Objects Before Each CREATE Object” so as to be in the position to reuse the same MySQL code in the case when the database needs changes specifically an update, that way your script will be in the position to run or override and implement changes to an existing database.

The next step would require your MySQL server to be running, ensure it is running before clicking next.

alkathirikhalid

Fig 9: Forward Engineer to Database process completed successfully

After the step is complete, you can close the MySQL Workbench and head back to the Netbeans IDE, the first part is complete, we have created our database and it’s table/s. Now we continue building the rest of the application.

alkathirikhalid

Fig 10: Our new Database is ready

In Netbeans click on services and then click on the database to verify the tables were created from the Forward Engineering process, as seen above all seem well.

alkathirikhalid

Fig 11: Build your Web Application

Click on new project, select Java web and then select Web application as seen in the above image, and then click next.

alkathirikhalid

Fig 12: Java Web Application Structure

The Netbeans IDE generates the java web application with it’s codes, since the data we require should be populated from the database there is nothing much we need here except for recreation purposes to make the application more appealing, now lets fix the connection.

alkathirikhalid

Fig 13: Selecting the Database connection for the application

Create the data source that would be use by the application to pull up the data from the database in order to populate the page views.

alkathirikhalid

Fig 14: Generate the entity classes

Here we generate the entity classes that will interact with the database.

alkathirikhalid

Fig 15: Generate the entity classes

alkathirikhalid

Fig 16: Generate the entity classes

alkathirikhalid

Fig 17: Inserting testing data

alkathirikhalid

Fig 18: incorporating CSS Buttons to minimize heavy image use

alkathirikhalid

Fig 19: Running the Guestbook Application

alkathirikhalid

Fig 20: The application lists the guest data

alkathirikhalid

Fig 21: Inputting data to test AJAX validation

alkathirikhalid

Fig 22: Validation working as expected

alkathirikhalid

Fig 23: Inputting further data into the application

alkathirikhalid

Fig 24: Application accepts data

The application is in order, all is left is clean and build the application and deploy the war file, since am on a local machine the application is accessible through glassfish with in the same network, external accessibility can be achieved by installing DYNDNS updater or having a dedicate IP and port forwarding the router to the glassfish server on port 80, before doing so you would need to secure the application by creating a login page.

Thank You.

www.alkathirikhalid.com

Posted in Web Developement | Leave a comment