Ashvin Savani “arckid” – Flash Platform Expert

All about RIA development using Flash, Flex, Flash Media Server (Flashcom) with various middleware and backends.

Archive for the ‘Programming’ Category

Meeting – Creating IMAP client with Adobe AIR – Part 1

Hello friends,

Today, Once again We came up with interesting meeting series. Instead of just one speaker, We are including many speakers who have expertise in different topics. As mentioned in the meeting topic, Here are the modules we are planning to include in whole series of meetings:

  1. Basics of AIR. (By Ashvin Savani)
  2. Basics of Protocol. (By Ashvin Savani)
  3. Basics of IMAP. (By Ashvin Savani)
  4. How to understand any protocol specifications from specification document / RFCs.
  5. Basics of Socket Communication in Flash Action Script 3.
  6. Handshaking with IMAP Server.
  7. UI – Login Screen.
  8. UI and Event Handling.
  9. Authentication with IMAP Server.
  10. Retrieving Folder Structure from Server.
  11. UI – Displaying Folder Structure.
  12. Retrieving Email headers for given folder (From, To, CC, BCC, etc.,).
  13. Retrieving Email data for given email.
  14. Separating Email Body and Attachments from email data.
  15. UI – Displaying Email Body.
  16. Decoding Email Attachments in to file data.
  17. (Not Sure – For Now) Scan the file via anti virus tool before display it.
  18. UI – Displaying whole email.
  19. UI – Replying email.
  20. Basics: Sending an email via SMTP.
  21. SMTP specifications and normal procedures.
  22. Handshaking with SMTP.
  23. Sending an email with SMTP.
  24. Final touch up to the application.
  25. Lessons Learnt by each attendee.

I hope, all of us will really enjoy this series and it would be meaningful add on pack to the knowledge of everyone of us:

As usual, Sponsor for Event, Place and Equipments is Avinashi and FlashBrain.

Part 1 – Venue and Time:

FlashBrain Unit, Avinashi Systems.
Seminar Hall, 2nd Floor,
Kohinoor Complex, Saiyedpura,
Surat – 395 003.

User Group ManagerAshvin Savani
User Group Co-Manager
Naresh Khokhaneshiya

Update:

  • We were able to finish 3 topics on first part of our meeting on 2nd Aug 08.

Support for TIMESTAMP in SQLite with AIR (as local database)

In past week at FlashBrain, Where do I work; We were working on one cool AIR application with Flash. Naresh – My good friend and colleague at FlashBrain was dealing with timestamps for better algorithm for online and offline sync with AIR.

We were trying to put timestamp on local and remote database to compare the data based on time to get idea about which record is last updated. Our remote database is MySQL and local database is SQLite which is a part of AIR. TIMESTAMP is a known data type for MySQL and which automatically inserts the timestamp based on whenever you create the record. While, in SQLite it does not support TIMESTAMP as native data type for fields.

Usually, SQLite converts or casts the data types automatically and in this process it guesses the data types and tries to convert the data in to nearest possible data type. So if you will enter TIMESTAMP like you are doing in MySQL, it will treat the data as numeric and will not solve the purpose for TIMESTAMP. SQLite only supports DATETIME as field data type. This DATETIME is also stored in specific format of DDDD.DDDD which is julian day number expressed as floating point value. So to store TIMESTAMP in to a SQLite with AIR, you need to convert your TIMESTAMP value in to this DDDD.DDDD format before you insert in to SQLite. Also, at time of retrival of data, you need to convert the data in to your desired data type before you use it.

Here is example, Naresh entered in our internal Knowledge Base, Which we named as Knowledge Dose:

Inserting the data in to SQLite:

INSERT INTO <table> (<column>) VALUES (’2008-06-09 07:20:00′);

here, the important thing is – <column> data type should be DATETIME.

Fetching the data back from SQLite:

SELECT datetime(<column>) AS <variableName> FROM <table>;

I hope this would be helpful to someone!