• Like

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

TitaniumによるiPhone/Androidアプリ開発

  • 12,145 views
Published

Titanium Mobileを用いたiPhoneアプリ開発について、実例をまじえつつ概説します。OAuthを利用したTwitter APIへのアクセスについても実例をおみせします。

Titanium Mobileを用いたiPhoneアプリ開発について、実例をまじえつつ概説します。OAuthを利用したTwitter APIへのアクセスについても実例をおみせします。

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
12,145
On SlideShare
0
From Embeds
0
Number of Embeds
10

Actions

Shares
Downloads
118
Comments
0
Likes
18

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. TitaniumiPhone/Android
  • 2. ( id:r_kurain, @kurain ) / ( iPhone, iPad )Monolith (iPhone)
  • 3. Titanium blog TitaniumTitanium Android !
  • 4. AgendaiPhoneTitaniumTitanium
  • 5. TitaniumJavascript iPhone/Android “ ”Titanium MobileAppceleratorApache License v2.0 Titanium Web
  • 6. Appcelerator Titanium Desktop $9m Paypal @masuidrive
  • 7. OS X Snow LeopardXCode + iOS SDK (4.2 )Android SDK (Android )
  • 8. Project Name README/LICENSE/CHANGELOG/tiapp.xml Resources iphone Default.png appicon.png
  • 9. var tabGroup = Titanium.UI.createTabGroup();var win1 = Titanium.UI.createWindow({ title:Tab 1, backgroundColor:#fff});var tab1 = Titanium.UI.createTab({ icon:KS_nav_views.png, title:Tab 1, window:win1});tabGroup.addTab(tab1);tabGroup.open();
  • 10. var win1 = Titanium.UI.createWindow({ title:Tab 1, backgroundColor:#fff});var label = Titanium.UI.createLabel({ text:Hello World,});win1.add(label);win1.open();
  • 11. (2 )
  • 12. Twitter Client Twitter Client OAuth Tweet
  • 13. KitchenSink Sample https://github.com/appcelerator/KitchenSink project import
  • 14. TableViewTweet TimelineUITableViewTitanium.UI.TableView Ti.UI.TableViewRow
  • 15. table_view.jsvar data = [];var tableView =Ti.UI.createTableView( {!! data:data! });!Ti.UI.currentWindow.add(tableView);
  • 16. JS createWindowvar win = Titanium.UI.createWindow( { title:Tab 1, url:table_view.js, backgroundColor:#fff });
  • 17. Tweet API TweetTitanium.Network.HTTPClient
  • 18. HTTP Request Ti.Network.HTTPClientvar screen_name = kurain;var url = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+screen_name;var xhr = Ti.Network.createHTTPClient();xhr.open("GET",url);xhr.onload = function() { var tweets = JSON.parse(this.responseText);}xhr.send();
  • 19. Callbackxhr.onload = function() { var tweets = JSON.parse(this.responseText); var data = []; for(var i=0;i<tweets.length;i++) { var row = Ti.UI.createTableViewRow(); var label = Ti.UI.createLabel( { text: tweets[i].text } ); row.add(label); data.push(row); } var tableView = Titanium.UI.createTableView( {! ! data:data! } ); Titanium.UI.currentWindow.add(tableView);}
  • 20. Demo
  • 21. Twitter IconTweet margin
  • 22. Ti.UI.ImageViewvar url = tweets[i].user.profile_image_urlvar image = Ti.UI.createImageView( { image:url, left: 0, width: 48, height: 48 });row.add(image);
  • 23. Pull to refreshDynamic ScrollingEdit and Move
  • 24. OAuthAPI OAuthoauth-adapter http://code.google.com/p/oauth-adapter/ Javascript OAuth library
  • 25. OAuth-AdapterTi.include(oauth_adapter.js);var oAuthAdapter = new OAuthAdapter( your-consumer-secret, your-consumer-key, HMAC-SHA1);oAuthAdapter.loadAccessToke(twitter);
  • 26. OAuth SendoAuthAdapter.send( https://api.twitter.com/1/statuses/update.json, [[status, @kurain Say Hello to#titanium!]], Twitter, //Message Title Published., //Succeed Message Not published. //Failed Message);
  • 27. OAuthif (oAuthAdapter.isAuthorized() == false) { var receivePin = function() { oAuthAdapter.getAccessToken( https://api.twitter.com/oauth/access_token ); oAuthAdapter.saveAccessToken(twitter); }; oAuthAdapter.showAuthorizeUI( https://api.twitter.com/oauth/authorize? + oAuthAdapter.getRequestToken( https://api.twitter.com/oauth/request_token ), receivePin );}
  • 28. OAuthstatus OAuth
  • 29. NavigationBarvar r = Titanium.UI.createButton( {! systemButton:Titanium.UI.iPhone.SystemButton.ADD });//addEventListener !!r.addEventListener(click,function() {! tweet(Hoge!); });Titanium.UI.currentWindow.setRightNavButton(r);
  • 30. Objective-C PluginTiBar Barcode@masuidrive AdMob plugin
  • 31. OpenGLclose
  • 32. AndroidOS debugger
  • 33. titanium-mobile-doc-ja http://code.google.com/p/titanium-mobile-doc-ja/ API , PDF, Build Rakefile, etc.. id:donayama
  • 34. Titanium OAuth
  • 35. Thank you.