Android CERN App Mentors: Łukasz Wasylkowski Timur Pocheptsov Fons Rademakers
Overview Content (~60%): o News (rss feeds) Offline storage Social media sharing o Static information (history, physics, accelerators) o Live info o Photos and videos o More info Widget Fragment-based skeleton Layouts for the application as a whole Classes connecting modules Different for phone and tablet ~65% of iOS app
Android vs iOS
Android API API levels from 1 to 18 Every new API adds new functionality and often changes how things works One needs to implement activities and fragments onCreate, onStart, onResume, onPause, onStop, onRestart, onDestroy
Basic concepts Layouts in XML files Activity loads layout and sets listeners Many things can be done statically and programatically Android is very flexible but basic
Implementation Menu file –(menu parser)—> Menu Menu consists of menu description and ItemAction objects o ItemAction know what certain menu item shold show and what parameters it needs Item actions are filled by separate classes o Menu file is parsed as menu o But its parts for specific menu items are parsed in their own classes Main activity shows menu and requests fragments from ItemAction
Implementation RSS class gets feed URL as parameter RSS downloading class separated First the feed is downloaded, parsed and inserted into database o At this point views can load content Images and descriptions are queued in AsyncTask<> class o They show in view as soon as they’re downloaded o Views have to take care of cancelling requests for downloading if they’re not visible anymore
Problems Eclipse o 2 to 10 minutes to install application on emulator o Errors in application caused by IDE (!) (messing up generated R class) Third party libraries o RSS parser o Animated flip view
Thank you Thank you