Download - APPlause - DemoCamp Munich
Cross-Platform Mobile Developmentwith Eclipse
@peterfriese / @itemismobile
countless devices
diversity of platforms
Javapublic class SpeakersList extends GenericListActivity<Speaker> {
List<Speaker> speakers;
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setTitle("Speakers");
speakers = getItemsFromProvider();
ArrayList<AbstractRowAdapter> rowAdapters = new ArrayList<AbstractRowAdapter>();
Iterable<Speaker> items1 = speakers; for (Speaker i : items1) rowAdapters.add(new Cell1(i));
setListAdapter(new GenericItemAdapter(this, rowAdapters)); finishCreation();
}
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]; } }}
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.providers
providerForSpeakerByName: [item valueForKeyPath:@"name"]]; SpeakerDetailsViewController *controller = [[SpeakerDetailsViewController alloc] init]; controller.contentProvider = provider; [self.navigationController pushViewController: controller animated: TRUE]; [controller release];}
HTML{% extends "generated/application.html" %}{% block title%}Speakers{% endblock %}{% block content_class %}table list{% endblock %}
{% block content %}<ul>{% for s in data|to_list %} <li> {% url views.SpeakerDetailsBySpeakerByName s.name|urlencode as url %} <a href="{{ url }}"> <div class="cell_text">{{s.name|safe}}</div> </a> </li>{% endfor %}</ul>{% endblock %}
App Anatomy 101
App Anatomy 101Views
App Anatomy 101CellsViews
App Anatomy 101NavigationCellsViews
App Anatomy 101NavigationCellsViews
App Anatomy 101
Navigation
Cells
Views
App Anatomy 101EntitiesSession
titleroom
Navigation
Cells
Views
App Anatomy 101
Sessiontitleroom
Entities
Navigation
Cells
Views
App Anatomy 101
Sessiontitleroom
Entities
Navigation
Cells
Views
App Anatomy 101
ContentProviders
Sessiontitleroom
Entities
Navigation
Cells
Views
App Anatomy 101
ContentProviders
Sessiontitleroom
Entities
Navigation
Cells
Views
App Anatomy 101
Sessiontitleroom
ContentProviders
Entities
Navigation
Cells
Views
Demo :)
@hbehrens and @peterfriese working with @itemismobile