eclipsecon2011 cross-platform mobile development with eclipse

22
Cross-Platform Mobile Development with Eclipse EclipseCon 2011 March 21st - 24th Santa Clara, California @hbehrens and @peterfriese working with @itemis mobile

Upload: heiko-behrens

Post on 22-Jan-2015

3.727 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

  • 1. Cross-Platform Mobile Development with EclipseEclipseCon 2011 March 21st - 24th Santa Clara, California@hbehrens and @peterfriese working with @itemismobile

2. @moskovich: Your mobile phone has morecomputing power than all of NASA in 1969.NASA put a man on the moon... 3. ...we put a bird into pigs. 4. countless devices 5. diversity of platforms 6. Javapublic class SpeakersList extends GenericListActivity { List speakers; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle("Speakers"); speakers = getItemsFromProvider(); ArrayList rowAdapters = new ArrayList(); Iterable items1 = speakers; for (Speaker i : items1) rowAdapters.add(new Cell1(i)); setListAdapter(new GenericItemAdapter(this, rowAdapters)); finishCreation(); } 7. C#public partial class SpeakerDetailsDetailsView : PhoneApplicationPage{public SpeakerDetailsDetailsView(){InitializeComponent();}protected override void OnNavigatedTo(NavigationEventArgs e){string selectedIndex = "";if (NavigationContext.QueryString.TryGetValue("itemByIndex", out selectedIndex)){int index = int.Parse(selectedIndex);DataContext = App.RootViewModelProvider.BlogpostsModelProvider().BlogItems[index];}}} 8. Objective-C@implementation SpeakersListViewController- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if(section == 0) { return [[[contentProvider valueForKeyPath:@"content"] asArray] count]; } else return 0;}- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { id item = [self.items objectAtIndex: indexPath.row]; IPContentProvider *provider = [(itemisAppProviders*)contentProvider.providersproviderForSpeakerByName: [item valueForKeyPath:@"name"]]; SpeakerDetailsViewController *controller = [[SpeakerDetailsViewController alloc] init]; controller.contentProvider = provider; [self.navigationController pushViewController: controller animated: TRUE]; [controller release];} 9. HTML{% extends "generated/application.html" %}{% block title%}Speakers{% endblock %}{% block content_class %}table list{% endblock %}{% block content %}

  • {% for s in data|to_list %}
  • {% url views.SpeakerDetailsBySpeakerByName s.name|urlencode as url %}
    {{s.name|safe}}
    {% endfor %}

{% endblock %} 10. object-orientation 11. principle 12. stateless 13. App Anatomy 101 14. Views 15. Views Cells 16. Views Cells Navigation 17. EntitiesViews SessionCellstitle roomNavigation 18. Views SessionCellstitle roomNavigationEntities ContentProviders 19. DSL for mobiletabbarApplication itemisApp { button { title= "Tuesday" icon= "calendar.png" view= SessionList( SessionsByDay("2011-03-22") ) } button { title= "Wednesday" icon= "calendar.png" view= SessionList( SessionsByDay("2011-03-23") ) } button { title= "Thursday" icon= "calendar.png" view= SessionList( SessionsByDay("2011-03-24") ) } button { title= "Speakers" icon= "person.png" view= SpeakersList( AllSpeakers() ) }} 20. Xpand 21. Demo :) 22. @hbehrens and @peterfriese working with @itemismobile