HTTP Protocol

حد سأل نفسه ايه اللي بيحصل لما اطلب من المتصفح صفحة انترنت ويجيبهالي ؟
فيه بروتوكول مسئول عن الكلام دا اسمه HTTP

طب يعني ايه بروتوكول ؟

البروتوكول هو عبارة عن مجموعة لشوية قواعد متفق عليها للتواصل بين طرفين أو أكتر
يعني مثلاً ممكن ست كبيرة تكون متفقة مع البقال اللي تحتها انها تنزله سبت فيه ورقة مكتوب عليها لستة طلبات + الثمن
وبالتالي البقال عارف ان لما ينزله السبت دا فهايجيب الطلبات دي ويحطها في السبت ويحط معاها الفاتورة
أي خطأ في البروتوكول دا هايؤدي لفشل التواصل بين الطرفين, زي ان الست تنسى تحط فلوس او تنسى تحط لستة الطلبات فبالتالي البقال مش هايعرف يعمل حاجة والعملية هاتبوظ


Singleton Design pattern


Singleton is a design pattern used to limit the number of a class instances to one (or may be more)
and restricting any user wants a new object to use the already constructed object eliminating multiple copies of the same object

Hello Servlet


what’s Servelet ?
Servlet is the type of class used to make a dynamic web page using java code

how we can make a servlet
a simple servlet class can be done by implementing the Servlet interface
but usually we use the servlet in an HTTP conection to make an HTTP response to the user in a form of HTML page, in this case it’s better to use HttpServlet abstract class

Hello Struts


Struts is a java framework for web implements the MVC design pattern.
Struts facilitates the work of page redirection, form submitting, data validation and much more.

a common scenario is a login page
login.jsp that contains two inputs user name and password
a simple java class/bean that maps this information ( has two properties username and password)
an action servlet that receives the login page data and put them into the bean
then make a specific action (Logining) after that redirecting to another page (success page or return to the login page if error happened)

Observer design pattern


Suppose we’ve a system like thermometer that measures the room temperature

public class Thermometer {
    private int temp = 0;
    public void setTemp(int temp) {
        this.temp = temp;
	System.out.println("Subject | temp = " + temp);

    public int getTemp() {
        return temp;

We want to get notified when every change in temperature happens.
Suppose that many other systems wants to be notified and these systems may varies and we want to make a good solution to handle this without the need to modify our code multiple times to handle new added systems



The concept of multithreading is similar to the concept of multitasking

Operating systems allows multiple processes to run on the same time like word and paint and calc

We want the same behavior in the scope of a single process/java application, we want to be able to launch multiple functions at the same time, this concept is called multithreading, and every bunch of code that runs in parallel with another is called to be run on a thread.

We can make a simple thread in only 3 steps

  1. Extending Thread class
  2. Overriding run method
  3. Call start method to start the thread


Building simple Data Access Layer


The aim of this tutorial is to manage the access of a table in database from separate layer written in java, this layer usually called Data Access Layer (DAL)
this layer consists of A simple class/POJO/Bean called Data Transfer Object(DTO) this object is just a simple mapping to the table, every column in the table would be a member variable in the class.

our aim is to order this layer to create, modify, delete or search for an entity Using simple java objects rather than dialing with SQL statements and Database issues.

Database Creation

We want to create a simple table for users, we may create it using these fields

  • id
  • name
  • password
  • age


Javascript form validation


Client side validation is so important
by preventing the user from submitting wrong data into the server, it would be better for the server not receiving invalid data and it’s better for the user not to wait until the page reloads tells him that the data is incorrect.

some examples we may check for

  • Required
  • Length
  • Minimum/Maximum (numerical input)
  • Pattern (E-mail)



Action bar

Action bar

There are two types of Android menus

  • Options menu
    the menu that appears when you press the menu button
    this type of menus is binded to the activity (Every activity can have one options menu)
  • Context menu
    the menu when you do a long press on a view (like Text view or list item)
    this type of menus is binded to the view (Every view can have one context menu)


Android Location APIs


Obtaining location becomes an important feature of today’s applications.
We can get location via two providers

  • GPS Location Provider

    • Obtain user location from satellite
    • More accurate
    • Only works outdoors
    • Consumes battery power
    • Takes much time to get the location
  • Network Location Provider

    • Obtain user location from Cell tower and wifi signals
    • Works indoors, outdoors
    • Responds faster than GPS
    • Consumed less power


Go to Top