Friday, April 26, 2013

Day 9: Finalized DB schema and other storage plans.

Was not able to go ahead with the schedule due to extra office work. Anyway last night managed to come with the storage structure for the system. The storage will be spread out as the following:

  1. Common DB (SQL Server 2008 R2) - Common Server
  2. Branch DB (SQL Server 2008 R2) - Branch Server
  3. Mobile Phone DB (SQL Server Compact) - Mobile Phone
  4. XML file in the mobile phone to store & send the order over the internet. - Mobile Phone
Common DB Structure

Orders
  • TokenNumber - PK
  • OrderedForBranch - FK to Branch.BranchCode & BranchTable.BranchCode
  • OrderedDate
  • TableReserved
  • TableAttendTime
  • TableNo.
Menu Order
  • MenuID - FK to Menu.MenuID
  • TokenNumber - FK to Orders.TokenNumber
  • Quantity
Menu
  • MenuID - PK
  • FoodCode - Unique
  • FoodDescription
  • FoodPrice
  • FoodImage
Branch
  • BranchCode - PK
  • BranchName
BranchTable
  • BranchCode - PK, FK to BranchCode.BranchCode
  • TableNo. - PK
  • TableType (2,4,6,8 or 10 seater)
  • Image
Branch DB

Menu
  • MenuID - PK
  • FoodCode
  • FoodDescription
  • FoodPrice
  • Available
IncomingOrders
  • TokenNumber
  • TableNo.
  • NotifiedTime
  • OrderedDate
  • OrderedForBranch
Mobile DB
A cloned version of the Menu, Branch & BranchTable schemas from the CommonDB will be created on the Mobile DB to avoid delays in connecting, retrieving and displaying information remotely.

XML File to store or send order from Mobile:
<order>
  <orderid></orderid>
  <items>
    <item>
      <code></code>
      <price></price>
    </item>
  </items>
  <orderedforbranch tablereserved ="false">
    <tableno></tableno>
  </orderedforbranch>
  <ordereddate></ordereddate>
</order>

Instead of having a location setting table separately (within a branch), I've decided to have a table called BranchTable which contain list of tables at each branch, where some tables might contain surrounding images along with it.

I haven't considered a configuration arrangement to edit the expiration datetime of reserved table. Currently it can be assumed (hard coded) as 15 minutes from table attend time, as well as the expiration of an order (if unattended) as 2 hours from the table attend time. Also the Administration console for changing food prices and images are not considered as part of the proposal.

As for the current research, I couldn't finalize a way to detect the automatic arrival of user at a particular branch using GPS as the Windows Phone 7 simulator needs to be configured to suit the development PC with internet connectivity. Until further research, the option to notify the correct location of arrival will be enforced upon the user.

During the weekend, planning to create two similar clones of DB servers to simulate DB requirements for two different branches, and a SQL Server Compact server for the mobile. Read a tip of free SQL Server hosting available on Amazon.

Got a suggestion from a colleague to include NUnit testing framework to avoid repeated debugging.

Thursday, April 25, 2013

Day 8: 24.04.2013 (Wednesday)

Read an article on using the MVVM pattern for Windows Phone 7 development.

MVVM Stands for:

  • M - Model
  • V - View
  • VM - View Model
Model is used for handling the business logic of the application.

View is the user interface, and in Windows Phone 7 it is implemented using XAML.

The View Model stands as a transforming middle layer between the model and the view. It basically takes changes from the view and call the appropriate functionality in the model, while it also transforms the data generated in the model to make it useful in the view.



Thursday, April 18, 2013

Day 7: Created Essential Tables


  • Created a mock of the necessary tables using Visio 2010 as below

  • Have to decide which of these table/data structures will be created on the phone and on the common server. 
  • Referred to articles and watched a video on MSDN of the various storage methods available in Windows Phone 7:
    • Isolated Storage settings (stores it during the application)
    • File & folder structure
    • SQL Server Compact

Wednesday, April 17, 2013

Day 6: XML Structure for Storing order


  • Created an XML Structure for storing an order in the phone like the following:
  • Started designing the CommonDB structure. Hope to catch up soon with the plan.
  • Tried a demo in retrieving location information.

Friday, April 12, 2013

Day 5: Navigating between states in Windows Phone 7

Utilized the free time at office to watch some video tutorials at office. This time watched some tutorials from MSDN. Further to the explanation learnt  from PluralSight.com yesterday, the videos explained clearly how a Windows Phone 7 application could be handled between the Activated, Deactivated, Launch and Close events.

It was much more clear that Tomb-stoning state refers to either the Deactivated or Closed events.

Though not relevant, also watched a video on the difference between a sample Android application and Windows Phone 7 application.

Won't able to study stuff tonight due to the long travelling home. Hope to start some of the DB design work during the weekend.

Thursday, April 11, 2013

Day 4: Windows Phone 7 Application life cycle.


  • Watched tutorials on Windows Phone 7 on Pluralsight.com.
  • Learned about the Application life cycle of a Windows Phone 7 application, and some terminologies involved with it.
    • Persistent Data: Data that is maintained across a given session of an application
      • Ex: User settings etc
    • Transient Data: Data that is maintained for a particular/individual session of an application.
      • User entering or touching some data only to be used once in the application
    •  Page State: How a page looks like
      • The location ,color and sizing if controls on a page etc.
    • Application State: Information about the whole application
      • Using some service classes, not associated with a given page, but contributes in the overall functioning of an application.
    • Tombstoning: This is a term specifically used for Windows Phone 7, which refers to a process of Deactivating an application while preserving the state (includes Transient Data, Page State & Application State)
The Application Life Cycle consists of the following phases:
  • Launch: Starting an application
  • Running
  • Closed (Ex: User clicks the back button)
  • Reactivate: A deactivated application can be reactivated to its previous state (Using Transient data).
  • Deactivate (Clicking on something other than the application, like datetime at the top of the screen, or if the phone lock screen appears, or when some other application is run from the current programme).
Application Lifecycle of a Windows Phone 7

These lessons learnt would be needed to be considered during the ordering and notification process,especially the state related information, so that the user food order could be saved in the mobile phone until the notification of arrival is made.

Wednesday, April 10, 2013

Day 3 (10th April, 2013)


  • Continued reading Charles Petzold's book. Found an interesting piece of information which is common to all latest touch phones:

OLED (Organic Light Emitting Diode) display consumes less than half the power of an LCD display of the same size, but only when the screen is mostly black. For an all-white screen, an OLED consumes more than three times the power of an LCD.

  •  Regarding the touching feature of Windows Phone 7, they say:

The screens incorporate capacitance-touch technology, which means that they respond to a human fingertip but not to a stylus or other forms of pressure. Windows Phone 7 screens are required to respond to at least four simultaneous touch-points.
 Al though for the project multi touch will not be necessary, nor can be tested on the Windows Phone Emulator on the PC. During development the mouse click events would mimic the functionality of a human finger.

Tuesday, April 9, 2013

Day 2: More Video Tutorials and first Mobile App

Watched 2nd set of tutorials from www.pluralsight.com on how to create a normal windows phone app, a windows phone panoramic application which slides the contents across the screen, and a windows phone pivot app, which is similar to panoramic, but allows to view more details while sliding.

Soon after the videos I quickly started up creating the first GUI for the project based on the article provided at http://www.cespage.com/silverlight/wp7tut27.html. That article discusses how to create an image carousel on a Windows Phone 7 interface. It doesn't support click events.

Here below are the initial screen and the main screen on the Windows Phone Emulator for 512MB RAM:

The initial screen when the Windows Phone Emulator loaded for the first time


The initial screen for the mobile app developed with a sliding image carousel


Monday, April 8, 2013

Day 1: Windows Mobile 7 Basics


  • Last night watched some introductory videos on Windows Mobile 7 application development from www.pluralsight.com. 
  • Did some reading in the introduction section of Charles Petzold's Programming Windows Phone 7
  • Have to watch remaining videos tonight.