Appcelerator titanium

773 views

Published on

http://novavision-it.tn/

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
773
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Appcelerator titanium

  1. 1. DEVELOPING ANDROIDAPPS USING TITANIUM
  2. 2. Soltani Kadhem Web and Mobile Developer
  3. 3. • iPhone (objective-C)• Android (Java , Google Style)• RIM (Java, Blackberry)• Symbian (old school C)
  4. 4. What is Titanium Mobile ? • Open source • Build native, cross-platform mobile apps • Using only JavaScript,HTML and CSS • One codebase for multiple platforms
  5. 5. Small intro about Titanium Studio - Powerful Eclipse-based IDE - It will help you create, run for test and deploy (to app store) .
  6. 6. i Studio (why it so powerful)… • It always notifies you about latest SDK and Studio updates .
  7. 7. i Studio (why it so powerful)… • It is so smart, because it catches mistakes immediately!
  8. 8. i Studio (why it so powerful)… • Syntax highlighting
  9. 9. i Studio (why it so powerful)… • Content assist and more…
  10. 10. Project structure…
  11. 11. {code}LET’S GET INTO THE INTERESTINGPART. CODING…
  12. 12. Titanium, DESIGNING A SAMPLE UI Ti.UI.createWindow({ backgroundColor:"#FFF" }); win.open();
  13. 13. Titanium, ADD a container var view = Ti.UI.createView({ top:10, left:10, height:300, width:300, backgroundColor:"#AAA", borderRadius:10 }); win.add(view);
  14. 14. Titanium, add a button var button = Ti.UI.createButton({ title:"Click Me", top:10, left:10, height:40, width:280 }); view.add(button);
  15. 15. Titanium, add a button button.addEventListener("cli ck", function(){ alert("Comment gagner de largent avec google"); } );
  16. 16. Titanium, OPEN A DIALOG var dlg = Ti.UI.createOptionDialog({ title:"Delete?", options: ["Yes","No"], cancel:1 }); dlg.addEventListener("click" , function(e){ alert(e.index); }); dlg.show();
  17. 17. Titanium, ITS NOT ONLY ABOUT UI • DATABASE • WEB SERVICES • MEDIA ELEMENTS • SOCIAL NETWORK
  18. 18. Titanium, EVERYTHING SQLITE SQLite Manager
  19. 19. Why SQLite fit? • SQLite does not need tobe «installed» before it is used. •There is no « setup » procedure. •There is no need for an administrator to create a new database. •There is no real notion of « initiating a connection ». •Accessing SQLite DB is damn easy(open,query,close).
  20. 20. {code}
  21. 21. Titanium, INSTALL A DATABASE Use database with your default data – var db = Ti.Database.install( ‘test.db’, ‘DB1’) Create or open an existing database - var db = Ti.Database.open(‘DB1’)
  22. 22. Titanium, CREATE TABLE db.execute(‘ CREATE TABLE IF NOT EXISTS users ( id INTEGER, Name TEXT, LastName TEXT, mail TEXT, PRIMARY KEY(id) )’);
  23. 23. Titanium, INSERT var result = db.execute(“ INSERT INTO users (Name, LastName, mail) VALUES (‘Kadhem’, ‘Soltani’, ‘kadhem.soltani@outlook,com’) “);
  24. 24. Titanium, UPDATE var result = db.execute(‘ UPDATE users SET Name = ‘Wael’ WHERE id = 1 );
  25. 25. Titanium, DELETE var result = db.execute(‘ DELETE FROM users WHERE id = 1‘);
  26. 26. Titanium, READ var result = db.execute(‘ SELECT (id, Name, LastName) FROM users WHERE id = 1 );
  27. 27. Titanium, READ Iterate through rows - while (result.isValidRow()) { var name = result.fieldByName(‘name’); result.next(); }
  28. 28. Thank you, QUESTIONS? ?
  29. 29. roduction To Appcelerator Titanium http://www.youtube.com/watch? v=I6iESgpZIwE http://www.youtube.com/watch? v=ohvw3WebAkY Kadhem,soltani@outlook,com

×