Introduction to Module Development with Appcelerator Titanium

8,321 views
7,925 views

Published on

VIDEO: http://bit.ly/P1UlGr starts at 1:13

Overview of creating modules with Appcelerator Titanium. We integrate SkyhookWireless location SDK and Card.io mobile card sdk

Source:
Source code for ios cardio module presented at @codestrong http://bit.ly/PQlsW9
Source code for android skyhookwireless module presented at @codestrong http://bit.ly/z4zfdl

2 Comments
4 Likes
Statistics
Notes
No Downloads
Views
Total views
8,321
On SlideShare
0
From Embeds
0
Number of Embeds
1,581
Actions
Shares
0
Downloads
65
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide

Introduction to Module Development with Appcelerator Titanium

  1. 1. Introduction to Module Development Aaron K. Saunders Founder/CTO Clearly Innovative Inc @aaronksaunders aaron@clearlyinnovative.com
  2. 2. About Me • Founder & CTO Clearly Innovative Inc. • Full stack development for mobile and web integrations w/javascript & nodejs • Appcelerator Platform Evangelist; Titan • IOS and Android Module Development • 2yrs of Appcelerator blogging • Working on book with ACS and Alloy Integration
  3. 3. What thispresentation is about
  4. 4. Android Topics • Introduction to module development, not advanced • Basic integration of third party library and intent based library • Understand the Titanium Studio Menu commands for scripts • Understanding Ant build script on Android
  5. 5. IOS Topics • Introduction to module development, not advanced • Basic integration of third party library • Understand the Titanium Studio Menu commands for scripts • Understanding command line scripts
  6. 6. What thispresentation is notabout
  7. 7. Out of Scope • Advanced view integration in modules • Additional information on NDK integration on Android • Addressing complex third party library conflicts on IOS
  8. 8. Android first becauseit needs some love
  9. 9. Your Environment • Instructions on the wiki are your best starting point • Use the commands provided in Titanium Studio • Be sure you have followed instructions for setting up Titanium Studio • Installing Java Development Tools
  10. 10. Android ModuleQuickly
  11. 11. Create AndroidModule • Select “New Titanium Mobile Module Project” from Menu • Fill out all of the fields presented • Save the project • Edit the build.properties to point to the ANDROID_NDK path • Run project
  12. 12. Run through script ondevice
  13. 13. Add somefunctionality
  14. 14. Skyhook SDK
  15. 15. Integration Steps • Import 3rd party library • Pass authentication credentials into module • Setup callbacks in module • Pass results back from module • Render results
  16. 16. Edit app.js • Instantiate the module object • Create a proxy object • Provide credentials to module • Setup success and error callback • Execute API method on proxy object
  17. 17. Edit app.js
  18. 18. Edit module file • Remove the template method calls generated by script • Create property for the username • Create property for realm
  19. 19. Edit module file
  20. 20. Edit proxy file • Get properties for username and realm; framework does most of the heavy lifting for you • Get the callback functions from the passed in parameters
  21. 21. Edit proxy file
  22. 22. Edit proxy file
  23. 23. Edit proxy file • So now we have all the data in… We need to get the data out • Create hashMap, add the objects and call our callback
  24. 24. Code for completedmodule
  25. 25. IOS module
  26. 26. Your Environment • Instructions on the wiki are your best starting point • Use the commands provided in Titanium Studio • Be sure you have followed instructions for setting up Titanium Studio • Installing IOS & Xcode Development Tools
  27. 27. Card.io SDK
  28. 28. Integration Steps • Import 3rd party library • Pass application key into module • Setup callbacks in module • Pass results back from module • Render results
  29. 29. Libraries &Headers
  30. 30. Edit app.js • Instantiate the module object • Provide application key to module • Setup success and error callback • Execute API method on module
  31. 31. Edit app.js
  32. 32. Edit header file • Set the interface for the card.io delegate • Set up private variable for the function callback with success or error information
  33. 33. Edit header file
  34. 34. Edit module file • Remove the template method calls generated by script • Make sure we de-allocate any memory that we have allocated • Get the parameters from the javascript passed into objective-c • Make card.io API call to display card capture information
  35. 35. Edit module file
  36. 36. Edit module file • Handle the response from the UI after it is rendered • Handle the two delegates from API for user cancel or data entered • Pass a new hashmap containing results back to the javascript app
  37. 37. Edit module file
  38. 38. Edit module file
  39. 39. OVERLOAD!! • Blog posting next two weeks • All code provided on github • Additional Intent based module included
  40. 40. Aaron K. Saunders @aaronksaundersaaron@clearlyinnovative.com blog.clearlyinnovative.com

×